diff options
author | Charles Longeau <chl@cvs.openbsd.org> | 2007-09-25 10:04:48 +0000 |
---|---|---|
committer | Charles Longeau <chl@cvs.openbsd.org> | 2007-09-25 10:04:48 +0000 |
commit | 6deef5f410cef47581f0950e6123d85bb88f7f62 (patch) | |
tree | 1ab3c22f113f842784ecac0b0f1199cc70ec20c6 /usr.bin/cvs/logmsg.c | |
parent | 46a3d8424a8bb13e2ea8cef300bf9ea45e009ffe (diff) |
missing header for mkstemp
check mkstemp return value against -1 instead of NULL
ok joris@
Diffstat (limited to 'usr.bin/cvs/logmsg.c')
-rw-r--r-- | usr.bin/cvs/logmsg.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/usr.bin/cvs/logmsg.c b/usr.bin/cvs/logmsg.c index c630608cba4..b76e56e3972 100644 --- a/usr.bin/cvs/logmsg.c +++ b/usr.bin/cvs/logmsg.c @@ -1,4 +1,4 @@ -/* $OpenBSD: logmsg.c,v 1.44 2007/09/04 17:57:41 tobias Exp $ */ +/* $OpenBSD: logmsg.c,v 1.45 2007/09/25 10:04:47 chl Exp $ */ /* * Copyright (c) 2007 Joris Vink <joris@openbsd.org> * @@ -23,6 +23,7 @@ #include <fcntl.h> #include <paths.h> #include <signal.h> +#include <stdlib.h> #include <string.h> #include <unistd.h> @@ -99,7 +100,7 @@ cvs_logmsg_create(struct cvs_flisthead *added, struct cvs_flisthead *removed, (void)xasprintf(&fpath, "%s/cvsXXXXXXXXXX", cvs_tmpdir); - if ((fd = mkstemp(fpath)) == NULL) + if ((fd = mkstemp(fpath)) == -1) fatal("cvs_logmsg_create: mkstemp %s", strerror(errno)); cvs_worklist_add(fpath, &temp_files); |