Error return is False, not -1
authorDerrell Lipman <derrell.lipman@unwireduniverse.com>
Fri, 24 Oct 2008 14:26:56 +0000 (10:26 -0400)
committerDerrell Lipman <derrell.lipman@unwireduniverse.com>
Fri, 24 Oct 2008 14:31:31 +0000 (10:31 -0400)
- There were a few places in SMBC_getatr() that returned -1 instead of a
  boolean.  -1 was intended to mean error, but that's what False is for, and
  the usages of this function assume that it returns a boolean with False as
  the error condition.

Derrell

source3/libsmb/libsmb_file.c

index 7b287096c21c48424b6573bb3e973117d418d8ec..ece056db87f1ea8d03b4ec925314e05a7f1bc7ee 100644 (file)
@@ -518,7 +518,7 @@ SMBC_getatr(SMBCCTX * context,
                 
                errno = EINVAL;
                TALLOC_FREE(frame);
-               return -1;
+               return False;
        }
         
        /* path fixup for . and .. */
@@ -527,14 +527,14 @@ SMBC_getatr(SMBCCTX * context,
                if (!fixedpath) {
                        errno = ENOMEM;
                        TALLOC_FREE(frame);
-                       return -1;
+                       return False;
                }
        } else {
                fixedpath = talloc_strdup(frame, path);
                if (!fixedpath) {
                        errno = ENOMEM;
                        TALLOC_FREE(frame);
-                       return -1;
+                       return False;
                }
                trim_string(fixedpath, NULL, "\\..");
                trim_string(fixedpath, NULL, "\\.");