+static void sighandler(int sig)
+{
+ if(sig == SIGHUP)
+ reopen = 1;
+}
+
+static void reopenlog(void)
+{
+ FILE *new;
+
+ if(outname == NULL) {
+ flog(LOG_WARNING, "accesslog: received SIGHUP but logging to stdout, so ignoring");
+ return;
+ }
+ if((new = fopen(outname, "a")) == NULL) {
+ flog(LOG_WARNING, "accesslog: could not reopen log file `%s' on SIGHUP: %s", outname, strerror(errno));
+ return;
+ }
+ fclose(out);
+ out = new;
+}
+