diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2001-01-12 18:01:44 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2001-01-12 18:01:44 +0000 |
commit | c3fc24a76d3ba3726e698d79d99a811b8836fb90 (patch) | |
tree | 95c7a5002cba0770fdc4b52843e3da2a03837d82 | |
parent | dd93fcee1946dc43132bc58fef838d86dc67196f (diff) |
save_errno handling; itojun ok
-rw-r--r-- | sbin/ping6/ping6.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/sbin/ping6/ping6.c b/sbin/ping6/ping6.c index b79813f05a0..848c044545e 100644 --- a/sbin/ping6/ping6.c +++ b/sbin/ping6/ping6.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ping6.c,v 1.22 2000/12/31 05:03:52 itojun Exp $ */ +/* $OpenBSD: ping6.c,v 1.23 2001/01/12 18:01:43 deraadt Exp $ */ /* $KAME: ping6.c,v 1.109 2000/12/27 11:32:37 itojun Exp $ */ /* @@ -1020,16 +1020,19 @@ main(argc, argv) /* * onalrm -- * This routine transmits another ping6. + * XXX almost certainly not race-safe? */ /* ARGSUSED */ void onalrm(signo) int signo; { + int save_errno = errno; struct itimerval itimer; if (!npackets || ntransmitted < npackets) { pinger(); + errno = save_errno; return; } @@ -1051,6 +1054,7 @@ onalrm(signo) (void)signal(SIGALRM, onint); (void)setitimer(ITIMER_REAL, &itimer, NULL); + errno = save_errno; } /* |