replace perror() messages with log_ereport in thrpool.c

Wed, 02 Nov 2022 17:47:39 +0100

author
Olaf Wintermann <olaf.wintermann@gmail.com>
date
Wed, 02 Nov 2022 17:47:39 +0100
changeset 408
56edda8701e0
parent 407
78af44222463
child 409
62aad4d94d5d

replace perror() messages with log_ereport in thrpool.c

src/server/util/thrpool.c file | annotate | diff | comparison | revisions
--- a/src/server/util/thrpool.c	Tue Nov 01 20:46:15 2022 +0100
+++ b/src/server/util/thrpool.c	Wed Nov 02 17:47:39 2022 +0100
@@ -57,7 +57,7 @@
     for(int i=0;i<pool->min_threads;i++) {
         pthread_t t;
         if (pthread_create(&t, NULL, threadpool_func, pool) != 0) {
-            perror("Error: threadpool_start: pthread_create");
+            log_ereport(LOG_FAILURE, "threadpool_start: pthread_create failed: %s", strerror(errno));
             return 1;
         }
     }
@@ -135,7 +135,7 @@
     if(create_thread) {
         pthread_t t;
         if (pthread_create(&t, NULL, threadpool_func, pool) != 0) {
-            perror("Error: threadpool_run: pthread_create");
+            log_ereport(LOG_FAILURE, "threadpool_run: pthread_create failed: %s", strerror(errno));
         }
     }
     if(destroy_thread) {

mercurial