From 47f32bc998101f27bcfd31094a63dd00d9334952 Mon Sep 17 00:00:00 2001 From: Binbin Date: Wed, 21 Jun 2023 22:57:11 +0800 Subject: [PATCH] Print strerror when bio initialization fails (#12333) Now we can see something like this: ``` Fatal: Can't initialize Background Jobs. Error message: Cannot allocate memory ``` --- src/bio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/bio.c b/src/bio.c index 640fbb024..10ecf8db2 100644 --- a/src/bio.c +++ b/src/bio.c @@ -142,7 +142,7 @@ void bioInit(void) { for (j = 0; j < BIO_WORKER_NUM; j++) { void *arg = (void*)(unsigned long) j; if (pthread_create(&thread,&attr,bioProcessBackgroundJobs,arg) != 0) { - serverLog(LL_WARNING,"Fatal: Can't initialize Background Jobs."); + serverLog(LL_WARNING, "Fatal: Can't initialize Background Jobs. Error message: %s", strerror(errno)); exit(1); } bio_threads[j] = thread;