diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2013-12-12 07:26:13 -0800 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2013-12-12 07:26:13 -0800 |
commit | 8e493b2eaf671e962a55e13c17bf42c51a3fd2bd (patch) | |
tree | 982c1453e38cfd8226ac3221983cecd863d22210 | |
parent | 986d9c78daa61375d23e30ce2441925c27bc4482 (diff) | |
download | txr-8e493b2eaf671e962a55e13c17bf42c51a3fd2bd.tar.gz txr-8e493b2eaf671e962a55e13c17bf42c51a3fd2bd.tar.bz2 txr-8e493b2eaf671e962a55e13c17bf42c51a3fd2bd.zip |
* configure: Fix warnings in test cases for HAVE_FORK_STUFF
and HAVE_DAEMON.
* eval.c: daemon support must be wrapped in #if HAVE_DAEMON
-rw-r--r-- | ChangeLog | 7 | ||||
-rwxr-xr-x | configure | 6 | ||||
-rw-r--r-- | eval.c | 4 |
3 files changed, 14 insertions, 3 deletions
@@ -1,3 +1,10 @@ +2013-12-12 Kaz Kylheku <kaz@kylheku.com> + + * configure: Fix warnings in test cases for HAVE_FORK_STUFF + and HAVE_DAEMON. + + * eval.c: daemon support must be wrapped in #if HAVE_DAEMON + 2013-12-11 Kaz Kylheku <kaz@kylheku.com> * txr.c (txr_main): Change stderr to line buffered mode. @@ -1235,9 +1235,10 @@ int main(int argc, char **argv) { int status, fd[2]; pid_t p = fork(); + int res = pipe(fd); (void) execvp(argv[0], argv); (void) waitpid(p, &status, 0); - (void) pipe(fd); + (void) res; return 0; } ! @@ -1377,8 +1378,7 @@ cat > conftest.c <<! int main(int argc, char **argv) { - daemon(0, 0); - return 0; + return daemon(0, 0); } ! rm -f conftest @@ -2087,11 +2087,13 @@ static val errno_wrap(val newval) return oldval; } +#if HAVE_DAEMON static val daemon_wrap(val nochdir, val noclose) { int result = daemon(nochdir ? 1 : 0, noclose ? 1 : 0); return result == 0 ? t : nil; } +#endif static void reg_fun(val sym, val fun) { @@ -2589,7 +2591,9 @@ void eval_init(void) reg_fun(intern(lit("make-time-utc"), user_package), func_n7(make_time_utc)); reg_fun(intern(lit("errno"), user_package), func_n1o(errno_wrap, 0)); +#if HAVE_DAEMON reg_fun(intern(lit("daemon"), user_package), func_n2(daemon_wrap)); +#endif #if HAVE_SYSLOG reg_var(intern(lit("log-pid"), user_package), &log_pid_v); |