Branch: Tag:

1999-03-25

1999-03-25 16:11:18 by Fredrik Hübinette (Hubbe) <hubbe@hubbe.net>

now calls error() if exit() is called twice..

Rev: src/builtin_functions.c:1.163

5:   \*/   /**/   #include "global.h" - RCSID("$Id: builtin_functions.c,v 1.162 1999/03/20 22:54:16 grubba Exp $"); + RCSID("$Id: builtin_functions.c,v 1.163 1999/03/25 16:11:18 hubbe Exp $");   #include "interpret.h"   #include "svalue.h"   #include "pike_macros.h"
1234:      void f_exit(INT32 args)   { +  static int in_exit=0;    CHECK_SECURITY_OR_ERROR(SECURITY_BIT_SECURITY, ("exit: permission denied.\n"));    if(args < 1)    SIMPLE_TOO_FEW_ARGS_ERROR("exit", 1);
1241:    if(sp[-args].type != T_INT)    SIMPLE_BAD_ARG_ERROR("exit", 1, "int");    +  if(in_exit) error("exit already called!\n"); +  in_exit=1; +     assign_svalue(&throw_value, sp-args);    throw_severity=THROW_EXIT;    pike_throw();