pike.git / src / builtin_functions.c

version» Context lines:

pike.git/src/builtin_functions.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: 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"   #include "interpret.h"   #include "svalue.h"   #include "pike_macros.h"   #include "object.h"   #include "program.h"   #include "array.h"   #include "pike_error.h"
pike.git/src/builtin_functions.c:2674:   PMOD_EXPORT void f_throw(INT32 args)   {    if(args < 1)    SIMPLE_TOO_FEW_ARGS_ERROR("throw", 1);    assign_svalue(&throw_value,Pike_sp-args);    pop_n_elems(args);    throw_severity=0;    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].    *!    *! Using @[exit()] with any other value than @expr{0@} (zero) indicates    *! that something went wrong during execution. See your system manuals    *! for more information about return codes.    *!    *! The arguments after the @[returncode] will be used for a call to    *! @[werror] to output a message on stderr.
pike.git/src/builtin_functions.c:2715:    if (s) {    apply_svalue(s, args-1);    pop_stack();    } else {    fprintf(stderr, "No efun::werror() at exit.\n");    pop_n_elems(args-1);    }    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();   }      /*! @decl void _exit(int returncode)    *!    *! This function does the same as @[exit], but doesn't bother to clean    *! up the Pike interpreter before exiting. This means that no destructors    *! will be called, caches will not be flushed, file locks might not be
pike.git/src/builtin_functions.c:2746:       get_all_args("_exit", args, "%d", &code);      #ifdef PIKE_DEBUG    {    /* This will allow -p to work with _exit -Hubbe */    exit_opcodes();    }   #endif    +  /* FIXME: Shouldn't _exit(2) be called here? */    exit(code);   }      /*! @decl int time();    *! @decl int time(int(1..1) one)    *! @decl float time(int(2..) t)    *!    *! This function returns the number of seconds since 00:00:00 UTC, 1 Jan 1970.    *!    *! The second syntax does not query the system for the current