Signed-off-by: Pierre Habouzit <madcoder@debian.org>
#include <lib-lib/lib-lib.h>
#include <sys/utsname.h>
#include <lib-lib/lib-lib.h>
#include <sys/utsname.h>
-
-#ifndef _POSIX_PATH_MAX
-#include <posix1_lim.h>
-#endif
-
#ifdef HAVE_GETOPT_H
#include <getopt.h>
#ifdef HAVE_GETOPT_H
#include <getopt.h>
{
char lockfile[_POSIX_PATH_MAX + LONG_STRING];
char nfslockfile[_POSIX_PATH_MAX + LONG_STRING];
{
char lockfile[_POSIX_PATH_MAX + LONG_STRING];
char nfslockfile[_POSIX_PATH_MAX + LONG_STRING];
int fd;
int count = 0;
int hard_count = 0;
int fd;
int count = 0;
int hard_count = 0;
setsid ();
/* next we close all open files */
setsid ();
/* next we close all open files */
-#if defined(OPEN_MAX)
- for (fd = 0; fd < OPEN_MAX; fd++)
+ for (fd = 0; fd < getdtablesize(); 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) {
/* now the second fork() */
if ((pid = fork ()) == 0) {