ref: 989994f0c56ca190df70aaadfbf20ac8f15fd576
parent: 20e767d202964f6121b2a2f2061c7506987dd593
author: mkf <mkf@cloud9p.org>
date: Mon Sep 30 02:43:52 EDT 2024
remove overkill sandboxing and replace %τ with ctime. thanks mora.
--- a/ircd.c
+++ b/ircd.c
@@ -104,7 +104,7 @@
List channels;
QLock clock;
char *servername;
-char date[32];
+char *date;
int debug;
@@ -1317,9 +1317,7 @@
if(servername == nil)
servername = getenv("sysname");
- tmfmtinstall();
- if(!sprint(date, "%τ", tmfmt(gmtime(time(nil)), "MMM _D hh:mm:ss YYYY")))
- sysfatal("sprint(date, ...): %r");
+ date = ctime(time(nil));
afd = announce(argv[0], adir);
if(afd < 0)
@@ -1341,7 +1339,7 @@
close(lfd);
continue;
}
- switch(rfork(RFPROC|RFNOMNT|RFMEM)){
+ switch(rfork(RFPROC|RFMEM)){
case -1:
perror("fork");
close(lfd);
@@ -1375,7 +1373,9 @@
if(timeout(c))
break;
}else{
- perror("read");
+ errstr(err, sizeof(err));
+ if(strcmp(err, "") != 0)
+ perror("read");
quit(c, "read error");
break;
}