2 ===================================================================
3 RCS file: /cvsroot/lirc/lirc/configure.ac,v
4 retrieving revision 1.2
5 diff -u -p -r1.2 configure.ac
6 --- configure.ac 22 Jul 2007 07:30:25 -0000 1.2
7 +++ configure.ac 24 Oct 2007 01:29:16 -0000
8 @@ -42,15 +42,6 @@ AC_FUNC_VPRINTF
9 AC_CHECK_FUNCS(gethostname gettimeofday mkfifo select socket strdup \
10 strerror strtoul snprintf strsep vsyslog)
13 -AC_CHECK_FUNCS(daemon)
14 -if test "$ac_cv_func_daemon" != yes; then
15 - AC_CHECK_LIB(bsd,daemon,daemon="-lbsd")
16 - if test "$daemon" = ""; then
17 - AC_MSG_ERROR([*** daemon() function not available on this system])
22 AC_CHECK_FUNCS(forkpty)
23 if test "$ac_cv_func_forkpty" != yes; then
24 @@ -1468,7 +1459,17 @@ test x${enableval} = xyes && AC_DEFINE(D
25 AC_ARG_ENABLE(daemonize,
26 [ --disable-daemonize disable daemons from daemonizing],
27 test x${enableval} = xyes && AC_DEFINE(DAEMONIZE),
28 -AC_DEFINE(DAEMONIZE))
30 +AC_CHECK_FUNCS(daemon)
31 +if test "$ac_cv_func_daemon" != yes; then
33 + AC_CHECK_LIB(bsd,daemon,daemon="-lbsd")
34 + if test "$daemon" = ""; then
35 + AC_MSG_ERROR([*** daemon() function not available on this system and --disable-daemonize not specified])
42 [ --with-syslog=facility use syslog instead of logfile],
44 ===================================================================
45 RCS file: /cvsroot/lirc/lirc/tools/irexec.c,v
46 retrieving revision 5.6
47 diff -u -p -r5.6 irexec.c
48 --- tools/irexec.c 7 Jun 2003 22:12:52 -0000 5.6
49 +++ tools/irexec.c 24 Oct 2007 01:29:16 -0000
51 #include "lirc_client.h"
54 +struct lirc_config *config;
62 + fprintf(stderr,"%s: can't daemonize\n",
65 + lirc_freeconfig(config);
71 int main(int argc, char *argv[])
73 - struct lirc_config *config;
76 char* program="irexec";
78 progname="irexec " VERSION;
79 @@ -60,7 +75,7 @@ int main(int argc, char *argv[])
80 printf("%s\n",progname);
88 @@ -76,7 +91,7 @@ int main(int argc, char *argv[])
92 - if(lirc_init(program, daemonize ? 0:1)==-1) exit(EXIT_FAILURE);
93 + if(lirc_init(program, do_daemon ? 0:1)==-1) exit(EXIT_FAILURE);
95 if(lirc_readconfig(optind!=argc ? argv[optind]:NULL,&config,NULL)==0)
97 @@ -84,18 +99,7 @@ int main(int argc, char *argv[])
103 - if(daemon(0,0)==-1)
105 - fprintf(stderr,"%s: can't daemonize\n",
108 - lirc_freeconfig(config);
110 - exit(EXIT_FAILURE);
113 + if(do_daemon) daemonize();
114 while(lirc_nextcode(&code)==0)
116 if(code==NULL) continue;
117 @@ -103,7 +107,7 @@ int main(int argc, char *argv[])
124 printf("Execing command \"%s\"\n",c);
126 Index: tools/lircrcd.c
127 ===================================================================
128 RCS file: /cvsroot/lirc/lirc/tools/lircrcd.c,v
129 retrieving revision 5.3
130 diff -u -p -r5.3 lircrcd.c
131 --- tools/lircrcd.c 6 May 2006 09:40:07 -0000 5.3
132 +++ tools/lircrcd.c 24 Oct 2007 01:29:17 -0000
133 @@ -128,8 +128,6 @@ static int termsig;
135 static struct client_data clis[MAX_CLIENTS];
137 -static int daemonized=0;
139 static struct lirc_config *config;
141 static int send_error(int fd,char *message,char *format_str, ...);
142 @@ -313,7 +311,7 @@ static void remove_client(int i)
143 void add_client(int sock)
148 struct sockaddr client_addr;
151 @@ -989,6 +987,7 @@ int main(int argc, char **argv)
154 getcwd(dir, sizeof(dir));
158 fprintf(stderr, "%s: daemon() failed\n", progname);
159 @@ -998,7 +997,7 @@ int main(int argc, char **argv)
160 lirc_freeconfig(config);
166 openlog(progname, LOG_CONS|LOG_PID, LOG_USER);