Author: ngie
Date: Wed Jan 11 07:17:03 2017
New Revision: 311917
URL: https://svnweb.freebsd.org/changeset/base/311917

Log:
  Fix up r311227
  
  Check for creat returning a value != -1, not a non-zero value
  
  MFC after:    3 days
  Pointyhat to: ngie
  Reported by:  Coverity
  CID:          1368366

Modified:
  head/contrib/netbsd-tests/lib/libc/gen/t_dir.c

Modified: head/contrib/netbsd-tests/lib/libc/gen/t_dir.c
==============================================================================
--- head/contrib/netbsd-tests/lib/libc/gen/t_dir.c      Wed Jan 11 06:01:23 
2017        (r311916)
+++ head/contrib/netbsd-tests/lib/libc/gen/t_dir.c      Wed Jan 11 07:17:03 
2017        (r311917)
@@ -59,12 +59,12 @@ ATF_TC_BODY(seekdir_basic, tc)
        long here;
 
 #ifdef __FreeBSD__
-#define        CREAT(x, m)     do {                                    \
-               int _creat_fd;                                  \
-               ATF_REQUIRE_MSG((_creat_fd = creat((x), (m))),  \
-                   "creat(%s, %x) failed: %s", (x), (m),       \
-                   strerror(errno));                           \
-               (void)close(_creat_fd);                 \
+#define        CREAT(x, m)     do {                                            
\
+               int _creat_fd;                                          \
+               ATF_REQUIRE_MSG((_creat_fd = creat((x), (m))) != -1,    \
+                   "creat(%s, %x) failed: %s", (x), (m),               \
+                   strerror(errno));                                   \
+               (void)close(_creat_fd);                                 \
        } while(0);
 
        ATF_REQUIRE_MSG(mkdir("t", 0755) == 0,
_______________________________________________
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to