git.samba.org
/
ira
/
wip.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
5b3f28f
)
libreplace: fix coverity ID 517 - untangle close from open in test/os2_delete.c
author
Michael Adam
<obnox@samba.org>
Thu, 27 Mar 2008 10:26:33 +0000
(11:26 +0100)
committer
Michael Adam
<obnox@samba.org>
Thu, 27 Mar 2008 10:46:39 +0000
(11:46 +0100)
This is not a proper bug but the code is clearer now
and we are tracking failure of open separate from that of close.
Michael
(This used to be commit
451fc9ae05f841883081a334e179cf31625a772c
)
source3/lib/replace/test/os2_delete.c
patch
|
blob
|
history
diff --git
a/source3/lib/replace/test/os2_delete.c
b/source3/lib/replace/test/os2_delete.c
index c6ef180017897daa1f770ec4f953eb2dcf1e5787..b45c135355a0a7be5f339e4225f1009ea2a0a943 100644
(file)
--- a/
source3/lib/replace/test/os2_delete.c
+++ b/
source3/lib/replace/test/os2_delete.c
@@
-39,8
+39,15
@@
static void create_files(void)
int i;
for (i=0;i<NUM_FILES;i++) {
char fname[40];
+ int fd;
sprintf(fname, TESTDIR "/test%u.txt", i);
- close(open(fname, O_CREAT|O_RDWR, 0600)) == 0 || FAILED("close");
+ fd = open(fname, O_CREAT|O_RDWR, 0600);
+ if (fd < 0) {
+ FAILED("open");
+ }
+ if (close(fd) != 0) {
+ FAILED("close");
+ }
}
}