mirror of
https://github.com/freebsd/freebsd-src
synced 2024-09-06 17:18:32 +00:00
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
This commit is contained in:
parent
9ea45e75fa
commit
19f27f3c34
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=311917
|
@ -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,
|
||||
|
|
Loading…
Reference in a new issue