summaryrefslogtreecommitdiff
path: root/src/common/log.c
diff options
context:
space:
mode:
authorPeter Palfrader <peter@palfrader.org>2003-11-19 02:09:43 +0000
committerPeter Palfrader <peter@palfrader.org>2003-11-19 02:09:43 +0000
commit9a676b04ddcebfdaab34f187a1a745f811e429d8 (patch)
treec9e91603c744ba1e88eda38b8d996a24ed17ac0a /src/common/log.c
parent3d145769de5805e4150e9683a855586fe9c59c9a (diff)
downloadtor-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.c4
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;