You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by bj...@locus.apache.org on 2000/08/06 16:44:58 UTC

cvs commit: apache-2.0/src/lib/apr/threadproc/os2 signals.c

bjh         00/08/06 07:44:58

  Modified:    src/lib/apr/threadproc/os2 signals.c
  Log:
  Add an OS/2 apr_signal(), pretty much copied from unix/signals.c
  
  Revision  Changes    Path
  1.8       +19 -0     apache-2.0/src/lib/apr/threadproc/os2/signals.c
  
  Index: signals.c
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/lib/apr/threadproc/os2/signals.c,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- signals.c	2000/08/02 05:26:40	1.7
  +++ signals.c	2000/08/06 14:44:56	1.8
  @@ -52,6 +52,7 @@
    * <http://www.apache.org/>.
    */
   
  +#define INCL_DOSEXCEPTIONS
   #include "threadproc.h"
   #include "fileio.h"
   #include "apr_thread_proc.h"
  @@ -79,3 +80,21 @@
       return rc;
   }
   
  +
  +
  +/*
  + * Replace standard signal() with the more reliable sigaction equivalent
  + * from W. Richard Stevens' "Advanced Programming in the UNIX Environment"
  + * (the version that does not automatically restart system calls).
  + */
  +Sigfunc *apr_signal(int signo, Sigfunc * func)
  +{
  +    struct sigaction act, oact;
  +
  +    act.sa_handler = func;
  +    sigemptyset(&act.sa_mask);
  +    act.sa_flags = 0;
  +    if (sigaction(signo, &act, &oact) < 0)
  +        return SIG_ERR;
  +    return oact.sa_handler;
  +}