wibble.
authorPierre Habouzit <madcoder@debian.org>
Fri, 17 Nov 2006 00:49:35 +0000 (01:49 +0100)
committerPierre Habouzit <madcoder@debian.org>
Fri, 17 Nov 2006 00:49:35 +0000 (01:49 +0100)
Signed-off-by: Pierre Habouzit <madcoder@debian.org>
dotlock.c
sendlib.c

index 3f55d40..abf92f0 100644 (file)
--- a/dotlock.c
+++ b/dotlock.c
 #include <lib-lib/lib-lib.h>
 
 #include <sys/utsname.h>
-
-#ifndef _POSIX_PATH_MAX
-#include <posix1_lim.h>
-#endif
-
 #include "dotlock.h"
-#include "config.h"
 
 #ifdef HAVE_GETOPT_H
 #include <getopt.h>
@@ -482,7 +476,7 @@ static int dotlock_lock (const char *frealpath)
 {
   char lockfile[_POSIX_PATH_MAX + LONG_STRING];
   char nfslockfile[_POSIX_PATH_MAX + LONG_STRING];
-  size_t prev_size = 0;
+  ssize_t prev_size = 0;
   int fd;
   int count = 0;
   int hard_count = 0;
index ef2b9da..ae595c3 100644 (file)
--- a/sendlib.c
+++ b/sendlib.c
@@ -1732,17 +1732,8 @@ send_msg(const char *path, const char **args, const char *msg, char **tempfile)
     setsid ();
 
     /* next we close all open files */
-#if defined(OPEN_MAX)
-    for (fd = 0; fd < OPEN_MAX; fd++)
+    for (fd = 0; fd < getdtablesize(); fd++)
       close (fd);
-#elif defined(_POSIX_OPEN_MAX)
-    for (fd = 0; fd < _POSIX_OPEN_MAX; fd++)
-      close (fd);
-#else
-    close (0);
-    close (1);
-    close (2);
-#endif
 
     /* now the second fork() */
     if ((pid = fork ()) == 0) {