mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-11-13 06:33:44 +01:00
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
This commit is contained in:
parent
b8179871a6
commit
729555e1ca
@ -3109,7 +3109,10 @@ start_daemon(void)
|
|||||||
return;
|
return;
|
||||||
start_daemon_called = 1;
|
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();
|
pid = fork();
|
||||||
if (pid < 0) {
|
if (pid < 0) {
|
||||||
log_err(LD_GENERAL,"fork failed. Exiting.");
|
log_err(LD_GENERAL,"fork failed. Exiting.");
|
||||||
@ -3189,7 +3192,10 @@ finish_daemon(const char *desired_cwd)
|
|||||||
}
|
}
|
||||||
if (nullfd > 2)
|
if (nullfd > 2)
|
||||||
close(nullfd);
|
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]);
|
close(daemon_filedes[1]);
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
|
@ -65,8 +65,6 @@
|
|||||||
#include <openssl/rand.h>
|
#include <openssl/rand.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define _FORTIFY_SOURCE 3
|
|
||||||
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#ifdef HAVE_FCNTL_H
|
#ifdef HAVE_FCNTL_H
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
|
Loading…
Reference in New Issue
Block a user