pike.git / src / threads.c

version» Context lines:

pike.git/src/threads.c:1:   #include "global.h" - RCSID("$Id: threads.c,v 1.169 2003/05/07 21:01:03 mast Exp $"); + RCSID("$Id: threads.c,v 1.170 2003/10/06 13:01:31 mast Exp $");      PMOD_EXPORT int num_threads = 1;   PMOD_EXPORT int threads_disabled = 0;      #ifdef _REENTRANT   #include "threads.h"   #include "array.h"   #include "mapping.h"   #include "object.h"   #include "pike_macros.h"
pike.git/src/threads.c:613: Inside #if defined(HAVE_BROKEN_LINUX_THREAD_EUID)
     #ifdef HAVE_BROKEN_LINUX_THREAD_EUID    /* Work-around for Linux's pthreads not propagating the    * effective uid & gid.    */    if (!geteuid()) {   #if defined(HAVE_PRCTL) && defined(PR_SET_DUMPABLE)    /* The sete?id calls will clear the dumpable state that we might    * have set with system.dumpable. */    int current = prctl(PR_GET_DUMPABLE); + #ifdef PIKE_DEBUG +  if (current == -1) +  fprintf (stderr, "%s:%d: Unexpected error from prctl(2). errno=%d\n", +  __FILE__, __LINE__, errno);   #endif -  + #endif    setegid(arg.egid);    seteuid(arg.euid);   #if defined(HAVE_PRCTL) && defined(PR_SET_DUMPABLE) -  if (prctl(PR_SET_DUMPABLE, current) == -1) -  fatal ("Didn't expect prctl to go wrong. errno=%d\n", errno); +  if (current != -1 && prctl(PR_SET_DUMPABLE, current) == -1) { + #if defined(PIKE_DEBUG) +  fprintf (stderr, "%s:%d: Unexpected error from prctl(2). errno=%d\n", +  __FILE__, __LINE__, errno);   #endif    } -  + #endif +  }   #endif /* HAVE_BROKEN_LINUX_THREAD_EUID */       mt_lock_interpreter();       while (threads_disabled) {    THREADS_FPRINTF(1, (stderr,    "new_thread_func(): Threads disabled\n"));    co_wait_interpreter(&threads_disabled_change);    }