|
@@ -2,7 +2,7 @@
|
2
|
2
|
* (c) Copyright 2005 Andrea Lo Pumo aka AlpT <alpt@freaknet.org>
|
3
|
3
|
*
|
4
|
4
|
* This source code is free software; you can redistribute it and/or
|
5
|
|
- * modify it under the terms of the GNU General Public License as published
|
|
5
|
+ * modify it under the terms of the GNU General Public License as published
|
6
|
6
|
* by the Free Software Foundation; either version 2 of the License,
|
7
|
7
|
* or (at your option) any later version.
|
8
|
8
|
*
|
|
@@ -56,7 +56,7 @@ void log_init(char *prog, int dbg, int log_stderr)
|
56
|
56
|
*
|
57
|
57
|
* If `filename' is not null, it is opened and set as the logfile.
|
58
|
58
|
* When `filename' is null, it just updates the `log_fd' global variable.
|
59
|
|
- *
|
|
59
|
+ *
|
60
|
60
|
* On errors it returns -1;
|
61
|
61
|
*/
|
62
|
62
|
int log_to_file(char *filename)
|
|
@@ -71,7 +71,7 @@ int log_to_file(char *filename)
|
71
|
71
|
|
72
|
72
|
if(!(log_file=fopen(filename, "w"))) {
|
73
|
73
|
log_fd=stderr;
|
74
|
|
- error("Cannot open the \"%s\" logfile: %s",
|
|
74
|
+ error("Cannot open the \"%s\" logfile: %s",
|
75
|
75
|
filename, strerror(errno));
|
76
|
76
|
return -1;
|
77
|
77
|
}
|
|
@@ -131,7 +131,7 @@ void error(const char *fmt,...)
|
131
|
131
|
str[1]=' ';
|
132
|
132
|
strncpy(str+2, fmt, strlen(fmt));
|
133
|
133
|
str[strlen(fmt)+2]=0;
|
134
|
|
-
|
|
134
|
+
|
135
|
135
|
va_start(args, fmt);
|
136
|
136
|
print_log(LOG_ERR, str, args);
|
137
|
137
|
va_end(args);
|
|
@@ -147,7 +147,7 @@ void loginfo(const char *fmt,...)
|
147
|
147
|
str[1]=' ';
|
148
|
148
|
strncpy(str+2, fmt, strlen(fmt));
|
149
|
149
|
str[strlen(fmt)+2]=0;
|
150
|
|
-
|
|
150
|
+
|
151
|
151
|
va_start(args, fmt);
|
152
|
152
|
print_log(LOG_INFO, str, args);
|
153
|
153
|
va_end(args);
|