mirror of
https://github.com/samba-team/samba.git
synced 2024-12-27 03:21:53 +03:00
libreplace: fix coverity ID 517 - untangle close from open in test/os2_delete.c
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 451fc9ae05
)
This commit is contained in:
parent
5b3f28f152
commit
5c30841fe7
@ -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");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user