shithub: qk1

Download patch

ref: f931251fabd44ccfa46a8180f0c57230cbb1aa7c
parent: a86ff36d8fb1a4a3c3095c889c2d01ee7dbeec88
author: qwx <qwx@sciops.net>
date: Thu Jul 22 14:36:01 EDT 2021

sys: always kill all threads on exit, use the same code for qw

--- a/qk1.c
+++ b/qk1.c
@@ -43,8 +43,7 @@
 	vseprint(s, s+sizeof s, fmt, arg);
 	va_end(arg);
 	Host_Shutdown();
-	fprint(2, "%s: %s\n", argv0, s);
-	exits(s);
+	sysfatal("%s", s);
 }
 
 void *
--- a/qw/sys.c
+++ b/qw/sys.c
@@ -38,18 +38,16 @@
 }
 
 void
-Sys_Error(char *error, ...)
+Sys_Error(char *fmt, ...)
 { 
-	char buf[1024], *out;
+	char s[1024];
 	va_list arg;
 
-	va_start(arg, error);
-	out = vseprint(buf, buf+sizeof(buf), error, arg);
+	va_start(arg, fmt);
+	vseprint(s, s+sizeof s, fmt, arg);
 	va_end(arg);
-	out = seprint(out, buf+sizeof(buf), "\n");
-	write(2, buf, out-buf);
 	Host_Shutdown();
-	sysfatal("ending.");
+	sysfatal("%s", s);
 }
 
 int