mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2025-02-24 14:51:11 +01:00
Make add_file_log return 0 on success.
svn:r594
This commit is contained in:
parent
7432d97336
commit
22ef733058
2 changed files with 4 additions and 3 deletions
|
@ -155,12 +155,13 @@ void add_stream_log(int loglevel, const char *name, FILE *stream)
|
|||
logfiles = lf;
|
||||
}
|
||||
|
||||
void add_file_log(int loglevel, const char *filename)
|
||||
int add_file_log(int loglevel, const char *filename)
|
||||
{
|
||||
FILE *f;
|
||||
f = fopen(filename, "a");
|
||||
if (!f) return;
|
||||
if (!f) return -1;
|
||||
add_stream_log(loglevel, filename, f);
|
||||
logfiles->needs_close = 1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -28,7 +28,7 @@
|
|||
void log_set_severity(int severity);
|
||||
|
||||
void add_stream_log(int loglevel, const char *name, FILE *stream);
|
||||
void add_file_log(int severity, const char *filename);
|
||||
int add_file_log(int severity, const char *filename);
|
||||
void close_logs();
|
||||
void reset_logs();
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue