diff options
-rw-r--r-- | source4/heimdal_build/replace.c | 19 | ||||
-rw-r--r-- | source4/lib/appweb/mpr/var.c | 8 |
2 files changed, 20 insertions, 7 deletions
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 <stdio.h> +#include <unistd.h> +#include <fcntl.h> #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; diff --git a/source4/lib/appweb/mpr/var.c b/source4/lib/appweb/mpr/var.c index 533248dd06..d3d21f7eee 100644 --- a/source4/lib/appweb/mpr/var.c +++ b/source4/lib/appweb/mpr/var.c @@ -2165,8 +2165,10 @@ bool mprIsNan(double f) #elif VXWORKS /* FUTURE */ return (0); -#else +#elif defined(FP_NAN) return (f == FP_NAN); +#else + return 0; #endif } /******************************************************************************/ @@ -2178,8 +2180,10 @@ bool mprIsInfinite(double f) #elif VXWORKS /* FUTURE */ return (0); -#else +#elif defined(FP_INFINITE) return (f == FP_INFINITE); +#else + return 0; #endif } |