When doing a non-io open the stat failing is no cause for a debug zero
authorJeremy Allison <jra@samba.org>
Tue, 23 Apr 2002 18:50:10 +0000 (18:50 +0000)
committerJeremy Allison <jra@samba.org>
Tue, 23 Apr 2002 18:50:10 +0000 (18:50 +0000)
to be printed, it just means file not found.
Jeremy.
(This used to be commit 25dea499b82da5e84412bf10781adbd240aa46f0)

source3/smbd/open.c

index f8ba1ca8d8b41128faa59509431f3c9a161b59b8..4d49b2cb591739eda582e2637a40a55d12b76327 100644 (file)
@@ -169,11 +169,15 @@ static BOOL open_file(files_struct *fsp,connection_struct *conn,
 
                if (fsp->fd == -1)
                        ret = vfs_stat(conn, fname, psbuf);
-               else
+               else {
                        ret = vfs_fstat(fsp,fsp->fd,psbuf);
+                       /* If we have an fd, this stat should succeed. */
+                       if (ret == -1)
+                               DEBUG(0,("Error doing fstat on open file %s (%s)\n", fname,strerror(errno) ));
+               }
 
+               /* For a non-io open, this stat failing means file not found. JRA */
                if (ret == -1) {
-                       DEBUG(0,("Error doing fstat on open file %s (%s)\n", fname,strerror(errno) ));
                        fd_close(conn, fsp);
                        return False;
                }