aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorturret <turret@duck.com>2024-01-12 19:41:15 +0000
committerturret <turret@duck.com>2024-01-12 19:41:15 +0000
commitdfb0d84c8113629f1af0fa39519a38c4c48f7140 (patch)
tree6e6912e49dfbc1e6c88e112b79fc1732d423847e
parentf4940132d84307eb2273dc617fc3defd33764bb7 (diff)
downloaddiscord-bot-skeleton-dfb0d84c8113629f1af0fa39519a38c4c48f7140.tar.gz
discord-bot-skeleton-dfb0d84c8113629f1af0fa39519a38c4c48f7140.tar.bz2
discord-bot-skeleton-dfb0d84c8113629f1af0fa39519a38c4c48f7140.zip
init: add random seed & bug fixes
-rw-r--r--init/init.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/init/init.c b/init/init.c
index ad1e182..ecd3c25 100644
--- a/init/init.c
+++ b/init/init.c
@@ -92,6 +92,9 @@ int main(void)
if(curl_global_init(CURL_GLOBAL_DEFAULT))
panic("init: curl init failed");
+ /* init random seed */
+ srand(time(NULL));
+
/* Rest of the program.. */
do_initcalls();
@@ -112,7 +115,7 @@ int main(void)
print(LOG_WARNING "init: failed to reap process %d",
process);
if(siginfo.si_status != 0) {
- panic("init: process %d exited with non-zero status (%d)", siginfo.si_status);
+ panic("init: process %d exited with non-zero status (%d)", siginfo.si_pid, siginfo.si_status);
}
} else if(sig == SIGINT) {
panic("init: keyboard interrupt");