mirror of
https://github.com/samba-team/samba.git
synced 2025-01-14 19:24:43 +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 451fc9ae05f841883081a334e179cf31625a772c)
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…
x
Reference in New Issue
Block a user