From fac402e60f83d372b6c4d88ffbccf4db4e09271f Mon Sep 17 00:00:00 2001 From: oes Date: Thu, 27 Nov 2003 19:20:27 +0000 Subject: [PATCH] Diagnostics: Now preserve the returncode of pthread_create in errno. Closes BR #775721. Thanks to Geoffrey Hausheer. --- jcc.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/jcc.c b/jcc.c index bd330371..8ecf8cf2 100644 --- a/jcc.c +++ b/jcc.c @@ -1,4 +1,4 @@ -const char jcc_rcs[] = "$Id: jcc.c,v 1.92.2.11 2003/05/14 12:32:02 oes Exp $"; +const char jcc_rcs[] = "$Id: jcc.c,v 1.92.2.12 2003/07/11 11:34:19 oes Exp $"; /********************************************************************* * * File : $Source: /cvsroot/ijbswa/current/Attic/jcc.c,v $ @@ -33,6 +33,9 @@ const char jcc_rcs[] = "$Id: jcc.c,v 1.92.2.11 2003/05/14 12:32:02 oes Exp $"; * * Revisions : * $Log: jcc.c,v $ + * Revision 1.92.2.12 2003/07/11 11:34:19 oes + * No longer ignore SIGCHLD. Fixes bug #769381 + * * Revision 1.92.2.11 2003/05/14 12:32:02 oes * Close jarfile on graceful exit, remove stray line * @@ -2315,8 +2318,9 @@ static void listen_loop(void) pthread_attr_init(&attrs); pthread_attr_setdetachstate(&attrs, PTHREAD_CREATE_DETACHED); - child_id = (pthread_create(&the_thread, &attrs, - (void*)serve, csp) ? -1 : 0); + errno = pthread_create(&the_thread, &attrs, + (void*)serve, csp); + child_id = errno ? -1 : 0; pthread_attr_destroy(&attrs); } #endif -- 2.39.2