Fix annoying debug messages when no snapshots are used
authorVolker Lendecke <vl@samba.org>
Tue, 28 Apr 2009 09:16:19 +0000 (11:16 +0200)
committerMichael Adam <obnox@samba.org>
Tue, 28 Apr 2009 09:26:55 +0000 (11:26 +0200)
Not being able to open the shadow copy directory is the same as having no
shadow copy support at all. The VFS module should in this case not log with
debug level 0 and set ENOSYS to indicate "no shadow copies used" to the higher
levels.

Signed-off-by: Michael Adam <obnox@samba.org>
source/modules/vfs_shadow_copy2.c

index 118981d6bff2318ab30f847e567a6db87954b8ef..584336cd7112309149c989a305ba26155f522374 100644 (file)
@@ -540,9 +540,10 @@ static int shadow_copy2_get_shadow_copy2_data(vfs_handle_struct *handle,
        p = SMB_VFS_NEXT_OPENDIR(handle, snapdir, NULL, 0);
 
        if (!p) {
-               DEBUG(0,("shadow_copy2: SMB_VFS_NEXT_OPENDIR() failed for '%s' - %s\n", 
-                        snapdir, strerror(errno)));
+               DEBUG(2,("shadow_copy2: SMB_VFS_NEXT_OPENDIR() failed for '%s'"
+                        " - %s\n", snapdir, strerror(errno)));
                talloc_free(tmp_ctx);
+               errno = ENOSYS;
                return -1;
        }