Tidy up tmp file handling.
authorJeremy Allison <jra@samba.org>
Thu, 5 Apr 2001 19:17:54 +0000 (19:17 +0000)
committerJeremy Allison <jra@samba.org>
Thu, 5 Apr 2001 19:17:54 +0000 (19:17 +0000)
Jeremy.
(This used to be commit 1751a6316af91d5d2e31c3a7e8de2841aae033c7)

source3/lib/smbrun.c

index 5b05c64bf0c23916cf6ce653b2d86f58726207ce..983c61f8624ec114a4afd97e8abb998e369cc48d 100644 (file)
@@ -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);