chiark
/
gitweb
/
~mdw
/
fwd
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Give the magic `current time' constant used by `fw_log' a sensible name.
[fwd]
/
fwd.c
diff --git
a/fwd.c
b/fwd.c
index 5b4e24803142669338c02c8797f883888108130d..df5c821c13106c5079e4fa5d8da549b98aaebe32 100644
(file)
--- a/
fwd.c
+++ b/
fwd.c
@@
-241,7
+241,7
@@
void fw_log(time_t t, const char *fmt, ...)
if (flags & FW_QUIET)
return;
if (flags & FW_QUIET)
return;
- if (t ==
-1
)
+ if (t ==
NOW
)
t = time(0);
tm = localtime(&t);
DENSURE(&d, 64);
t = time(0);
tm = localtime(&t);
DENSURE(&d, 64);
@@
-305,7
+305,7
@@
static void fw_tidy(int n, void *p)
default: abort();
}
default: abort();
}
- fw_log(
-1
, "closing down gracefully on %s", sn);
+ fw_log(
NOW
, "closing down gracefully on %s", sn);
source_killall();
}
source_killall();
}
@@
-327,7
+327,7
@@
static void fw_die(int n, void *p)
default: abort();
}
default: abort();
}
- fw_log(
-1
, "closing down abruptly on %s", sn);
+ fw_log(
NOW
, "closing down abruptly on %s", sn);
source_killall();
endpt_killall();
}
source_killall();
endpt_killall();
}
@@
-350,20
+350,20
@@
static void fw_reload(int n, void *p)
assert(n == SIGHUP);
if (!conffiles) {
assert(n == SIGHUP);
if (!conffiles) {
- fw_log(
-1
, "no configuration files to reload: ignoring SIGHUP");
+ fw_log(
NOW
, "no configuration files to reload: ignoring SIGHUP");
return;
}
return;
}
- fw_log(
-1
, "reloading configuration files...");
+ fw_log(
NOW
, "reloading configuration files...");
source_killall();
scan_create(&sc);
for (cf = conffiles; cf; cf = cf->next) {
if ((fp = fopen(cf->name, "r")) == 0)
source_killall();
scan_create(&sc);
for (cf = conffiles; cf; cf = cf->next) {
if ((fp = fopen(cf->name, "r")) == 0)
- fw_log(
-1
, "error loading `%s': %s", cf->name, strerror(errno));
+ fw_log(
NOW
, "error loading `%s': %s", cf->name, strerror(errno));
else
scan_add(&sc, scan_file(fp, cf->name, 0));
}
parse(&sc);
else
scan_add(&sc, scan_file(fp, cf->name, 0));
}
parse(&sc);
- fw_log(
-1
, "... reload completed OK");
+ fw_log(
NOW
, "... reload completed OK");
}
/*----- Startup and options parsing ---------------------------------------*/
}
/*----- Startup and options parsing ---------------------------------------*/
@@
-702,10
+702,10
@@
int main(int argc, char *argv[])
if (!sel_select(sel))
selerr = 0;
else if (errno != EINTR && errno != EAGAIN) {
if (!sel_select(sel))
selerr = 0;
else if (errno != EINTR && errno != EAGAIN) {
- fw_log(
-1
, "error from select: %s", strerror(errno));
+ fw_log(
NOW
, "error from select: %s", strerror(errno));
selerr++;
if (selerr > 8) {
selerr++;
if (selerr > 8) {
- fw_log(
-1
, "too many consecutive select errors: bailing out");
+ fw_log(
NOW
, "too many consecutive select errors: bailing out");
exit(EXIT_FAILURE);
}
}
exit(EXIT_FAILURE);
}
}