From c94f7637427f4c89d56c41fe4c75f2970b664a63 Mon Sep 17 00:00:00 2001 From: Ivo Timmermans Date: Tue, 28 Nov 2000 23:23:41 +0000 Subject: [PATCH] dropin.c/h contain a set of drop-in replacements for non-standard C library functions (read: GNU extensions). --- lib/Makefile.am | 6 +++--- lib/{daemon.c => dropin.c} | 17 +++++++++++++++-- lib/{daemon.h => dropin.h} | 12 ++++++++---- 3 files changed, 26 insertions(+), 9 deletions(-) rename lib/{daemon.c => dropin.c} (89%) rename lib/{daemon.h => dropin.h} (81%) diff --git a/lib/Makefile.am b/lib/Makefile.am index 7ac630a0..355493cd 100644 --- a/lib/Makefile.am +++ b/lib/Makefile.am @@ -1,15 +1,15 @@ ## Process this file with automake to produce Makefile.in -# $Id: Makefile.am,v 1.2.4.4 2000/11/24 23:12:58 guus Exp $ +# $Id: Makefile.am,v 1.2.4.5 2000/11/28 23:23:41 zarq Exp $ noinst_LIBRARIES = libvpn.a INCLUDES = -I. -I$(top_builddir) -I$(top_srcdir)/intl -libvpn_a_SOURCES = xmalloc.c pidfile.c utils.c getopt.c getopt1.c list.c rbl.c daemon.c +libvpn_a_SOURCES = xmalloc.c pidfile.c utils.c getopt.c getopt1.c list.c rbl.c dropin.c libvpn_a_LIBADD = @LIBOBJS@ @ALLOCA@ libvpn_a_DEPENDENCIES = $(libvpn_a_LIBADD) -noinst_HEADERS = xalloc.h pidfile.h utils.h getopt.h list.h rbl.h daemon.h +noinst_HEADERS = xalloc.h pidfile.h utils.h getopt.h list.h rbl.h dropin.h EXTRA_DIST = README diff --git a/lib/daemon.c b/lib/dropin.c similarity index 89% rename from lib/daemon.c rename to lib/dropin.c index f12599f4..faa2314b 100644 --- a/lib/daemon.c +++ b/lib/dropin.c @@ -1,5 +1,5 @@ /* - daemon.c -- replacement daemon() for platforms that do not have it + dropin.c -- a set of drop-in replacements for libc functions Copyright (C) 2000 Ivo Timmermans , 2000 Guus Sliepen @@ -17,7 +17,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - $Id: daemon.c,v 1.1.2.1 2000/11/24 23:30:50 guus Exp $ + $Id: dropin.c,v 1.1.2.1 2000/11/28 23:23:41 zarq Exp $ */ #include "config.h" @@ -86,3 +86,16 @@ int daemon(int nochdir, int noclose) } } #endif + + + + + +#ifndef HAVE_GET_CURRENT_DIR_NAME + +char *get_current_dir_name(void) +{ + return "."; +} + +#endif diff --git a/lib/daemon.h b/lib/dropin.h similarity index 81% rename from lib/daemon.h rename to lib/dropin.h index ce23b762..a104b38e 100644 --- a/lib/daemon.h +++ b/lib/dropin.h @@ -17,14 +17,18 @@ along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - $Id: daemon.h,v 1.1.2.1 2000/11/24 23:30:50 guus Exp $ + $Id: dropin.h,v 1.1.2.1 2000/11/28 23:23:41 zarq Exp $ */ -#ifndef __DAEMON_H__ -#define __DAEMON_H__ +#ifndef __DROPIN_H__ +#define __DROPIN_H__ #ifndef HAVE_DAEMON extern int daemon(int, int); #endif -#endif /* __DAEMON_H__ */ +#ifndef HAVE_GET_CURRENT_DIR_NAME +extern char* get_current_dir_name(void); +#endif + +#endif /* __DROPIN_H__ */ -- 2.39.5