From 4caf19ca3539662fc39567ab8529b30118d0b080 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Wed, 13 Jul 2005 13:55:06 +0000 Subject: r8425: add err() and errx() functions needed by for compile_et on some systems (This used to be commit 72a769b6d1a1ce5f8a19010074960b692b4755db) --- source4/heimdal_build/replace.c | 49 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 source4/heimdal_build/replace.c (limited to 'source4/heimdal_build/replace.c') diff --git a/source4/heimdal_build/replace.c b/source4/heimdal_build/replace.c new file mode 100644 index 0000000000..0b7e1943f8 --- /dev/null +++ b/source4/heimdal_build/replace.c @@ -0,0 +1,49 @@ +/* + Unix SMB/CIFS implementation. + + some replacement functions for parts of roken that don't fit easily into + our build system + + Copyright (C) Andrew Tridgell 2005 + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +*/ + +#include "config.h" +#include +#include "err.h" + +#ifndef HAVE_ERR + void err(int eval, const char *format, ...) +{ + va_list ap; + va_start(ap, format); + vfprintf(stderr, format, ap); + perror(""); + va_end(ap); + exit(eval); +} +#endif + +#ifndef HAVE_ERRX + void errx(int eval, const char *format, ...) +{ + va_list ap; + va_start(ap, format); + vfprintf(stderr, format, ap); + va_end(ap); + exit(eval); +} +#endif -- cgit From af0574378b3e73ffe637618e2f504d58735d6543 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Thu, 14 Jul 2005 06:36:19 +0000 Subject: r8450: more configure tests for solaris. It now builds some binaries, but fails in the ejs floating point code. (This used to be commit 30e1b6140e9f6246cb66eef7cf108d1ccf62bd40) --- source4/heimdal_build/replace.c | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) (limited to 'source4/heimdal_build/replace.c') diff --git a/source4/heimdal_build/replace.c b/source4/heimdal_build/replace.c index 0b7e1943f8..46019d7bb5 100644 --- a/source4/heimdal_build/replace.c +++ b/source4/heimdal_build/replace.c @@ -24,6 +24,7 @@ #include "config.h" #include #include "err.h" +#include "roken.h" #ifndef HAVE_ERR void err(int eval, const char *format, ...) @@ -47,3 +48,31 @@ exit(eval); } #endif + +#ifndef HAVE_WARNX + void warnx(const char *format, ...) +{ + va_list ap; + va_start(ap, format); + vfprintf(stderr, format, ap); + va_end(ap); +} +#endif + +#ifndef HAVE_FLOCK + int flock(int fd, int op) +{ + switch (op & (LOCK_UN|LOCK_SH|LOCK_EX)) { + case LOCK_UN: + return fcntl_lock(fd, F_SETLK, 0, 0, F_UNLCK); + case LOCK_SH: + return fcntl_lock(fd, (op&LOCK_NB)?F_SETLK:F_SETLKW, + 0, 0, F_RDLCK); + case LOCK_EX: + return fcntl_lock(fd, (op&LOCK_NB)?F_SETLK:F_SETLKW, + 0, 0, F_WRLCK); + } + errno = EINVAL; + return -1; +} +#endif -- cgit From fa2b97a20a518708e4534e8aa2cce12024228488 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Thu, 14 Jul 2005 07:04:21 +0000 Subject: r8451: samba4 finally builds on solaris 8 sparc with heimdal and ejs its been a long haul ... (This used to be commit 3c4291e49abed14973b4a4fa1a9277918b896cac) --- source4/heimdal_build/replace.c | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) (limited to 'source4/heimdal_build/replace.c') diff --git a/source4/heimdal_build/replace.c b/source4/heimdal_build/replace.c index 46019d7bb5..f222e764e4 100644 --- a/source4/heimdal_build/replace.c +++ b/source4/heimdal_build/replace.c @@ -23,6 +23,8 @@ #include "config.h" #include +#include +#include #include "err.h" #include "roken.h" @@ -62,15 +64,22 @@ #ifndef HAVE_FLOCK int flock(int fd, int op) { + struct flock lock; + lock.l_whence = 0; + lock.l_start = 0; + lock.l_len = 0; + lock.l_pid = 0; + switch (op & (LOCK_UN|LOCK_SH|LOCK_EX)) { case LOCK_UN: - return fcntl_lock(fd, F_SETLK, 0, 0, F_UNLCK); + lock.l_type = F_UNLCK; + return fcntl(fd, F_SETLK, &lock); case LOCK_SH: - return fcntl_lock(fd, (op&LOCK_NB)?F_SETLK:F_SETLKW, - 0, 0, F_RDLCK); + lock.l_type = F_RDLCK; + return fcntl(fd, (op&LOCK_NB)?F_SETLK:F_SETLKW, &lock); case LOCK_EX: - return fcntl_lock(fd, (op&LOCK_NB)?F_SETLK:F_SETLKW, - 0, 0, F_WRLCK); + lock.l_type = F_WRLCK; + return fcntl(fd, (op&LOCK_NB)?F_SETLK:F_SETLKW, &lock); } errno = EINVAL; return -1; -- cgit From 0479a2f1cbae51fcd8dbdc3c148c808421fb4d25 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Tue, 10 Jul 2007 02:07:03 +0000 Subject: r23792: convert Samba4 to GPLv3 There are still a few tidyups of old FSF addresses to come (in both s3 and s4). More commits soon. (This used to be commit fcf38a38ac691abd0fa51b89dc951a08e89fdafa) --- source4/heimdal_build/replace.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'source4/heimdal_build/replace.c') diff --git a/source4/heimdal_build/replace.c b/source4/heimdal_build/replace.c index f222e764e4..41309fea6e 100644 --- a/source4/heimdal_build/replace.c +++ b/source4/heimdal_build/replace.c @@ -8,7 +8,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or + the Free Software Foundation; either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, @@ -17,8 +17,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + along with this program. If not, see . */ #include "config.h" -- cgit