Branch: Tag:

2008-07-09

2008-07-09 13:29:01 by Henrik Grubbström (Grubba) <grubba@grubba.org>

Let exit() perform an _exit() if running in a forked child.

Rev: src/builtin_functions.c:1.684
Rev: src/builtin_functions.h:1.37
Rev: src/signal_handler.c:1.334

2:   || 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: builtin_functions.c,v 1.683 2008/07/04 16:06:47 mast Exp $ + || $Id: builtin_functions.c,v 1.684 2008/07/09 13:29:00 grubba Exp $   */      #include "global.h"
2681:    pike_throw();   }    + int in_forked_child = 0; +    /*! @decl void exit(int returncode, void|string fmt, mixed ... extra)    *!    *! Exit the whole Pike program with the given @[returncode].
2722:    args=1;    }    +  if (in_forked_child) { +  /* Don't bother to clean up if we're running in a forked child. */ +  f__exit(args); +  } +     assign_svalue(&throw_value, Pike_sp-args);    throw_severity=THROW_EXIT;    pike_throw();
2753:    }   #endif    +  /* FIXME: Shouldn't _exit(2) be called here? */    exit(code);   }