diff options
author | Nick Mathewson <nickm@torproject.org> | 2008-02-08 21:09:29 +0000 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2008-02-08 21:09:29 +0000 |
commit | 729555e1ca49ff140ceb65c8e9c108eae82d7120 (patch) | |
tree | a6d912cc6eb97c2eec8516f845bb15ac7d548dc3 /src | |
parent | b8179871a6dd5e225f0fef26d12b1eb38e8a6da7 (diff) | |
download | tor-729555e1ca49ff140ceb65c8e9c108eae82d7120.tar.gz tor-729555e1ca49ff140ceb65c8e9c108eae82d7120.zip |
r17967@catbus: nickm | 2008-02-07 11:44:51 -0500
Fix some warnings identified by building with -D_FORTIFY_SOURCE=2. Remove a redundant (and nuts) definition of _FORTIFY_SOURCE from eventdns.c.
svn:r13424
Diffstat (limited to 'src')
-rw-r--r-- | src/common/util.c | 10 | ||||
-rw-r--r-- | src/or/eventdns.c | 2 |
2 files changed, 8 insertions, 4 deletions
diff --git a/src/common/util.c b/src/common/util.c index ef138b6573..0631fdcb8f 100644 --- a/src/common/util.c +++ b/src/common/util.c @@ -3109,7 +3109,10 @@ start_daemon(void) return; start_daemon_called = 1; - pipe(daemon_filedes); + if (pipe(daemon_filedes)) { + log_err(LD_GENERAL,"pipe failed; exiting. Error was %s", strerror(errno)); + exit(1); + } pid = fork(); if (pid < 0) { log_err(LD_GENERAL,"fork failed. Exiting."); @@ -3189,7 +3192,10 @@ finish_daemon(const char *desired_cwd) } if (nullfd > 2) close(nullfd); - write(daemon_filedes[1], &c, sizeof(char)); /* signal success */ + /* signal success */ + if (write(daemon_filedes[1], &c, sizeof(char)) != sizeof(char)) { + log_err(LD_GENERAL,"write failed. Exiting."); + } close(daemon_filedes[1]); } #else diff --git a/src/or/eventdns.c b/src/or/eventdns.c index 17f9e5de56..a80e019298 100644 --- a/src/or/eventdns.c +++ b/src/or/eventdns.c @@ -65,8 +65,6 @@ #include <openssl/rand.h> #endif -#define _FORTIFY_SOURCE 3 - #include <string.h> #ifdef HAVE_FCNTL_H #include <fcntl.h> |