pike.git / src / threads.c

version» Context lines:

pike.git/src/threads.c:1:   /*   || This file is part of Pike. For copyright information see COPYRIGHT.   || Pike is distributed under GPL, LGPL and MPL. See the file COPYING   || for more information. - || $Id: threads.c,v 1.221 2003/09/24 00:20:49 mast Exp $ + || $Id: threads.c,v 1.222 2003/10/06 13:01:37 mast Exp $   */      #ifndef CONFIGURE_TEST   #include "global.h" - RCSID("$Id: threads.c,v 1.221 2003/09/24 00:20:49 mast Exp $"); + RCSID("$Id: threads.c,v 1.222 2003/10/06 13:01:37 mast Exp $");      PMOD_EXPORT int num_threads = 1;   PMOD_EXPORT int threads_disabled = 0;   #endif /* !CONFIGURE_TEST */      #ifdef _REENTRANT      #ifndef CONFIGURE_TEST      #include "threads.h"
pike.git/src/threads.c:725: 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) -  Pike_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();      #if defined(PIKE_DEBUG)    if(d_flag) {    THREAD_T self = th_self();    if( !th_equal(arg.thread_state->id, self) )    Pike_fatal("Current thread is wrong. %lx %lx\n",    (long)arg.thread_state->id, (long)self);