Error return is boolean false, not -1
authorDerrell Lipman <derrell.lipman@unwireduniverse.com>
Fri, 24 Oct 2008 15:35:10 +0000 (11:35 -0400)
committerDerrell Lipman <derrell.lipman@unwireduniverse.com>
Fri, 24 Oct 2008 15:35:10 +0000 (11:35 -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/false is for,
  and the usages of this function assume that it returns a boolean false as
  the error condition.

- per Jelmer's request, use false vs. False in new code, even if not making
  changes globally.

Derrell

source/libsmb/libsmb_file.c

index 423450b23ee9b74f6c1fa47011d066cac4ad74ef..27b7e4f823b6bfc23d95902db66519cd15635368 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, "\\.");