mirror of
https://github.com/samba-team/samba.git
synced 2025-03-11 16:58:40 +03:00
Tidy up tmp file handling.
Jeremy. (This used to be commit 1751a6316af91d5d2e31c3a7e8de2841aae033c7)
This commit is contained in:
parent
852242a1b5
commit
730791a6a8
@ -45,13 +45,8 @@ static BOOL setup_stdout_file(char *outfile,BOOL shared)
|
||||
gain_root_group_privilege();
|
||||
}
|
||||
|
||||
if(sys_stat(outfile, &st) == 0) {
|
||||
/* Check we're not deleting a device file. */
|
||||
if(st.st_mode & S_IFREG)
|
||||
unlink(outfile);
|
||||
else
|
||||
flags = O_RDWR;
|
||||
}
|
||||
unlink(outfile);
|
||||
|
||||
/* now create the file */
|
||||
fd = sys_open(outfile,flags,mode);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user