version 1.1, 1995/10/18 08:45:38 |
version 1.2, 1996/06/11 12:53:39 |
|
|
|
/* $OpenBSD$ */ |
|
/* $NetBSD: fio.c,v 1.5 1996/06/08 19:48:22 christos Exp $ */ |
|
|
/* |
/* |
* Copyright (c) 1980, 1993 |
* Copyright (c) 1980, 1993 |
* The Regents of the University of California. All rights reserved. |
* The Regents of the University of California. All rights reserved. |
|
|
*/ |
*/ |
|
|
#ifndef lint |
#ifndef lint |
static char sccsid[] = "from: @(#)fio.c 8.1 (Berkeley) 6/6/93"; |
#if 0 |
static char rcsid[] = "$Id$"; |
static char sccsid[] = "@(#)fio.c 8.1 (Berkeley) 6/6/93"; |
|
#else |
|
static char rcsid[] = "$OpenBSD$"; |
|
#endif |
#endif /* not lint */ |
#endif /* not lint */ |
|
|
#include "rcv.h" |
#include "rcv.h" |
|
|
; |
; |
if (cp[-1] != ':') |
if (cp[-1] != ':') |
break; |
break; |
while (c = *cp++) |
while ((c = *cp++) != '\0') |
if (c == 'R') |
if (c == 'R') |
this.m_flag |= MREAD; |
this.m_flag |= MREAD; |
else if (c == 'O') |
else if (c == 'O') |
|
|
} |
} |
|
|
static int sigdepth; /* depth of holdsigs() */ |
static int sigdepth; /* depth of holdsigs() */ |
static int omask; |
static sigset_t nset, oset; |
/* |
/* |
* Hold signals SIGHUP, SIGINT, and SIGQUIT. |
* Hold signals SIGHUP, SIGINT, and SIGQUIT. |
*/ |
*/ |
|
|
holdsigs() |
holdsigs() |
{ |
{ |
|
|
if (sigdepth++ == 0) |
if (sigdepth++ == 0) { |
omask = sigblock(sigmask(SIGHUP)|sigmask(SIGINT)|sigmask(SIGQUIT)); |
sigemptyset(&nset); |
|
sigaddset(&nset, SIGHUP); |
|
sigaddset(&nset, SIGINT); |
|
sigaddset(&nset, SIGQUIT); |
|
sigprocmask(SIG_BLOCK, &nset, &oset); |
|
} |
} |
} |
|
|
/* |
/* |
|
|
{ |
{ |
|
|
if (--sigdepth == 0) |
if (--sigdepth == 0) |
sigsetmask(omask); |
sigprocmask(SIG_SETMASK, &oset, NULL); |
} |
} |
|
|
/* |
/* |