[cvslog] Module eggdrop1.7: Change committed

cvslog cvs at tsss.org
Thu Oct 18 04:39:00 CST 2001


CVSROOT    : /usr/local/cvsroot
Module     : eggdrop1.7
Commit time: 2001-10-18 09:38:03 UTC
Commited by: stdarg <stdarg at techmonkeys.org>

Modified files:
     src/logfile.c

Log message:

Forgot to reopen logfile after cycling.
I dunno why it keeps thinking msprintf.h and tclscript.c are modified..

---------------------- diff included ----------------------
Index: eggdrop1.7/src/logfile.c
diff -u eggdrop1.7/src/logfile.c:1.1 eggdrop1.7/src/logfile.c:1.2
--- eggdrop1.7/src/logfile.c:1.1	Thu Oct 18 04:06:43 2001
+++ eggdrop1.7/src/logfile.c	Thu Oct 18 04:37:53 2001
@@ -124,7 +124,7 @@
 
 static int logfile_cycle()
 {
-	log_t *log;
+	log_t *log, *prev;
 	char suffix[32];
 	char *newfname;
 
@@ -148,6 +148,14 @@
 		unlink(newfname);
 		movefile(log->filename, newfname);
 		free(newfname);
+
+		log->fp = fopen(log->filename, "a");
+		if (!log->fp) {
+			logfile_del(log->filename);
+			if (prev) log = prev;
+			else log = log_list_head;
+		}
+		else prev = log;
 	}
 	return(0);
 }
@@ -204,9 +212,11 @@
 	if (!log) return(1);
 	if (prev) prev->next = log->next;
 	else log_list_head = log->next;
-	get_timestamp(timestamp);
-	flushlog(log, timestamp);
-	fclose(log->fp);
+	if (log->fp) {
+		get_timestamp(timestamp);
+		flushlog(log, timestamp);
+		fclose(log->fp);
+	}
 	free(log->last_msg);
 	free(log->filename);
 	free(log);
----------------------- End of diff -----------------------



More information about the Changes mailing list