lists.arthurdejong.org
RSS feed

nss-pam-ldapd commit: r1403 - in nss-pam-ldapd: . compat nslcd

[Date Prev][Date Next] [Thread Prev][Thread Next]

nss-pam-ldapd commit: r1403 - in nss-pam-ldapd: . compat nslcd



Author: arthur
Date: Wed Mar 23 22:28:28 2011
New Revision: 1403
URL: http://arthurdejong.org/viewvc/nss-pam-ldapd?view=rev&revision=1403

Log:
provide a definition of daemon() for systems that lack it

Modified:
   nss-pam-ldapd/compat/daemon.h
   nss-pam-ldapd/configure.ac
   nss-pam-ldapd/nslcd/nslcd.c

Modified: nss-pam-ldapd/compat/daemon.h
==============================================================================
--- nss-pam-ldapd/compat/daemon.h       Wed Mar 23 21:30:28 2011        (r1402)
+++ nss-pam-ldapd/compat/daemon.h       Wed Mar 23 22:28:28 2011        (r1403)
@@ -1,7 +1,7 @@
 /*
    daemon.h - definition of daemon() for systems that lack it
 
-   Copyright (C) 2002, 2003, 2008 Arthur de Jong
+   Copyright (C) 2002, 2003, 2008, 2011 Arthur de Jong
 
    This library is free software; you can redistribute it and/or
    modify it under the terms of the GNU Lesser General Public
@@ -24,8 +24,11 @@
 
 #include <unistd.h>
 
-/* deamonize process, optionally chdir to / and optionally close stdin,
-   strdout and stderr and redirect them to /dev/null */
+#if !HAVE_DECL_DAEMON
+/* we define daemon() here because on some platforms the function is
+   undefined: deamonize process, optionally chdir to / and optionally
+   close stdin, strdout and stderr and redirect them to /dev/null */
 int daemon(int nochdir,int noclose);
+#endif /* not HAVE_DECL_DAEMON */
 
 #endif /* not COMPAT__DAEMON_H */

Modified: nss-pam-ldapd/configure.ac
==============================================================================
--- nss-pam-ldapd/configure.ac  Wed Mar 23 21:30:28 2011        (r1402)
+++ nss-pam-ldapd/configure.ac  Wed Mar 23 22:28:28 2011        (r1403)
@@ -570,6 +570,7 @@
   # replace daemon() function if it is not on the system
   AC_SEARCH_LIBS(daemon,bsd)
   AC_REPLACE_FUNCS(daemon)
+  AC_CHECK_DECLS([daemon],,,[#include <unistd.h>])
 
   # replace ether_aton_r() and ether_ntoa_r() if they are not found
   AC_CHECK_FUNCS(ether_aton_r ether_ntoa_r,,[AC_LIBOBJ(ether)])

Modified: nss-pam-ldapd/nslcd/nslcd.c
==============================================================================
--- nss-pam-ldapd/nslcd/nslcd.c Wed Mar 23 21:30:28 2011        (r1402)
+++ nss-pam-ldapd/nslcd/nslcd.c Wed Mar 23 22:28:28 2011        (r1403)
@@ -52,9 +52,7 @@
 #ifndef HAVE_GETOPT_LONG
 #include "compat/getopt_long.h"
 #endif /* not HAVE_GETOPT_LONG */
-#ifndef HAVE_DAEMON
 #include "compat/daemon.h"
-#endif /* not HAVE_DAEMON */
 #include <dlfcn.h>
 #include <libgen.h>
 
-- 
To unsubscribe send an email to
nss-pam-ldapd-commits-unsubscribe@lists.arthurdejong.org or see
http://lists.arthurdejong.org/nss-pam-ldapd-commits