diff options
author | Diego 'Flameeyes' Pettenò <flameeyes@gmail.com> | 2008-10-01 13:31:00 +0200 |
---|---|---|
committer | Diego 'Flameeyes' Pettenò <flameeyes@gmail.com> | 2008-10-01 21:52:56 +0200 |
commit | 354715db707564693698ebac1ef63aa6c4e13e77 (patch) | |
tree | a267caa0b974afd0fc57debad5fce11f98edad85 | |
parent | 5b1daf072556c1fc9a00e8735fa0cdba280c2231 (diff) | |
download | platform_external_libdaemon-354715db707564693698ebac1ef63aa6c4e13e77.tar.gz platform_external_libdaemon-354715db707564693698ebac1ef63aa6c4e13e77.tar.bz2 platform_external_libdaemon-354715db707564693698ebac1ef63aa6c4e13e77.zip |
Conditionally declare variables if their use is conditional.
Reduces warnings about unused variables by not declaring them if they
are under an #ifdef conditional.
-rw-r--r-- | libdaemon/dfork.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/libdaemon/dfork.c b/libdaemon/dfork.c index 6b94944..62469bb 100644 --- a/libdaemon/dfork.c +++ b/libdaemon/dfork.c @@ -236,7 +236,9 @@ pid_t daemon_fork(void) { goto fail; } else if (pid == 0) { +#ifdef TIOCNOTTY int tty_fd; +#endif /* Second child */ if (sigaction(SIGCHLD, &sa_old, NULL) < 0) { @@ -478,9 +480,9 @@ int daemon_close_all(int except_fd, ...) { int daemon_close_allv(const int except_fds[]) { struct rlimit rl; int fd; - int saved_errno; #ifdef __linux__ + int saved_errno; DIR *d; |