diff options
author | Ingo Schwarze <schwarze@cvs.openbsd.org> | 2019-06-28 14:20:41 +0000 |
---|---|---|
committer | Ingo Schwarze <schwarze@cvs.openbsd.org> | 2019-06-28 14:20:41 +0000 |
commit | 0579dc34ca62d17a6fc1bd4662b0390a6d097c1e (patch) | |
tree | aac5f5e894a88242f194654d65f93ffd52d162f6 /lib | |
parent | 11a95e36dd26166202bcffe1fb7e3b8a72509d9e (diff) |
Actually, the C standard only guarantees that atexit(3) returns non-zero
on error, so tweak previous to test "atexit(...) != 0" for portability.
"OK ok ok sorry backwards" deraadt@
Diffstat (limited to 'lib')
-rw-r--r-- | lib/libutil/pidfile.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/libutil/pidfile.c b/lib/libutil/pidfile.c index 0dc47d6e376..e2d301868f8 100644 --- a/lib/libutil/pidfile.c +++ b/lib/libutil/pidfile.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pidfile.c,v 1.13 2019/06/28 05:33:35 deraadt Exp $ */ +/* $OpenBSD: pidfile.c,v 1.14 2019/06/28 14:20:40 schwarze Exp $ */ /* $NetBSD: pidfile.c,v 1.4 2001/02/19 22:43:42 cgd Exp $ */ /*- @@ -83,7 +83,7 @@ pidfile(const char *basename) (void) fclose(f); pidfile_pid = pid; - if (atexit(pidfile_cleanup) == -1) { + if (atexit(pidfile_cleanup) != 0) { save_errno = errno; (void) unlink(pidfile_path); free(pidfile_path); |