diff --git a/src/Makefile.in b/src/Makefile.in index 1e049c4ee54f05add2a36b5364f066d992036230..82c2aa31d9bd2a4546cc478f6e12d0bd28f26bdf 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -241,6 +241,8 @@ lib: $(LIBDIR_SRC) $(LIBDIR_SRC)/master.pike $(LIBDIR_SRC)/modules $(LIBDIR_SRC) cp -r $(LIBDIR_SRC) . -rm -r `find lib -type d -name CVS` -rm `find lib -type f -name '*~'` + -rm `find lib -type f -name '.#*'` + -rm `find lib -type f -name '#*#'` -touch ./lib # make export archive (requires compiled Pike) diff --git a/src/builtin_functions.c b/src/builtin_functions.c index db58e2d62f2f376010d9a76ef9d69ecd5dd5a394..996623426614d38a22351924c690ad91fc9b2a67 100644 --- a/src/builtin_functions.c +++ b/src/builtin_functions.c @@ -4,7 +4,7 @@ ||| See the files COPYING and DISCLAIMER for more information. \*/ #include "global.h" -RCSID("$Id: builtin_functions.c,v 1.60 1998/01/15 05:59:40 hubbe Exp $"); +RCSID("$Id: builtin_functions.c,v 1.61 1998/01/15 17:54:14 hubbe Exp $"); #include "interpret.h" #include "svalue.h" #include "pike_macros.h" @@ -354,7 +354,6 @@ void f_add_constant(INT32 args) #ifndef __NT__ #define IS_SEP(X) ( (X)=='/' ) #define IS_ABS(X) (IS_SEP((X)[0])?1:0) -#define #else #define IS_SEP(X) ( (X) == '/' || (X) == '\\' ) #define IS_ABS(X) (IS_SEP((X)[0])?1:(isalpha((X)[0]) && (X)[1]==':' && IS_SEP((X)[2]))?3:0) diff --git a/src/cpp.c b/src/cpp.c index c745da50288c4d2cd29554d146a327690d8b9dff..c53a0d63fc5ee530c1f51a487ea3df951c34bbc5 100644 --- a/src/cpp.c +++ b/src/cpp.c @@ -1879,7 +1879,11 @@ void f_cpp(INT32 args) do_magic_define(&this,"__FILE__",insert_current_file_as_string); do_magic_define(&this,"__DATE__",insert_current_date_as_string); do_magic_define(&this,"__TIME__",insert_current_time_as_string); + simple_add_define(&this,"__PIKE__"," 1 "); +#ifdef __NT__ + simple_add_define(&this,"__NT__"," 1 "); +#endif for (tmpf=pike_predefs; tmpf; tmpf=tmpf->next) simple_add_define(&this, tmpf->name, tmpf->value); diff --git a/src/signal_handler.c b/src/signal_handler.c index 85c6cc3a6b0e3ec9a99404cc300cd85d2ba047cd..31737f078565d7b7a31afff3e2fcc9551905b49c 100644 --- a/src/signal_handler.c +++ b/src/signal_handler.c @@ -257,6 +257,8 @@ static RETSIGTYPE receive_signal(int signum) #endif #endif #endif + fprintf(stderr,"pid %d died with code %d\n",pid,status); + if(pid>0) { int tmp2=firstwait+1; @@ -332,7 +334,7 @@ static void exit_pid_status(struct object *o) static void report_child(int pid, int status) { -/* fprintf(stderr,"pid %d exited with status %d\n",pid,status); */ + fprintf(stderr,"pid %d exited with status %d\n",pid,status); if(pid_mapping) { @@ -751,22 +753,26 @@ void f_fork(INT32 args) #ifdef HAVE_KILL static void f_kill(INT32 args) { - pid_t pid; if(args < 2) error("Too few arguments to kill().\n"); + switch(sp[-args].type) { case T_INT: - pid=sp[-args].u.integer; break; case T_OBJECT: { + INT32 pid; struct pid_status *p; if((p=(struct pid_status *)get_storage(sp[-args].u.object, pid_status_program))) { pid=p->pid; + free_svalue(sp-args); + sp[-args].type=T_INT; + sp[-args].subtype=NUMBER_NUMBER; + sp[-args].u.integer=pid; break; } } @@ -774,11 +780,11 @@ static void f_kill(INT32 args) error("Bad argument 1 to kill().\n"); } - if(sp[-args].type != T_INT) if(sp[1-args].type != T_INT) error("Bad argument 1 to kill().\n"); - sp[-args].u.integer=!kill(sp[-args].u.integer,sp[1-args].u.integer); + sp[-args].u.integer=!kill(sp[-args].u.integer, + sp[1-args].u.integer); check_signals(0,0,0); pop_n_elems(args-1); } @@ -809,6 +815,19 @@ void check_signals(struct callback *foo, void *bar, void *gazonk) { if(++lastsig == SIGNAL_BUFFER) lastsig=0; +#ifdef SIGCHLD + if(sigbuf[lastsig]==SIGCHLD) + { + int tmp2 = firstwait; + while(lastwait != tmp2) + { + if(++lastwait == WAIT_BUFFER) lastwait=0; + report_child(wait_buf[lastwait].pid, + wait_buf[lastwait].status); + } + } +#endif + push_int(sigbuf[lastsig]); apply_svalue(signal_callbacks + sigbuf[lastsig], 1); pop_stack();