diff options
author | Peter Palfrader <peter@palfrader.org> | 2003-11-19 02:09:43 +0000 |
---|---|---|
committer | Peter Palfrader <peter@palfrader.org> | 2003-11-19 02:09:43 +0000 |
commit | 9a676b04ddcebfdaab34f187a1a745f811e429d8 (patch) | |
tree | c9e91603c744ba1e88eda38b8d996a24ed17ac0a /src/common/log.c | |
parent | 3d145769de5805e4150e9683a855586fe9c59c9a (diff) | |
download | tor-9a676b04ddcebfdaab34f187a1a745f811e429d8.tar.gz tor-9a676b04ddcebfdaab34f187a1a745f811e429d8.zip |
Check that we can write to the logfile and log a warning to stderr if we can't
Move writing of pidfile after daemonizing, and also after setting the [ug]id:
This means that the tor user needs write priviliges to the pidfile location.
It needs it for unlinking the pidfile anyway.
svn:r846
Diffstat (limited to 'src/common/log.c')
-rw-r--r-- | src/common/log.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/common/log.c b/src/common/log.c index 3a60d0576d..397d27aaf1 100644 --- a/src/common/log.c +++ b/src/common/log.c @@ -150,6 +150,10 @@ void add_stream_log(int loglevel, const char *name, FILE *stream) logfiles = lf; } +/* + * If opening the logfile fails, -1 is returned and + * errno is set appropriately (by fopen) + */ int add_file_log(int loglevel, const char *filename) { FILE *f; |