diff options
author | Derrell Lipman <derrell.lipman@unwireduniverse.com> | 2009-02-14 09:42:59 -0500 |
---|---|---|
committer | Karolin Seeger <kseeger@samba.org> | 2009-02-16 09:57:05 +0100 |
commit | 35850edb5267a880d36658004e095a73489f310e (patch) | |
tree | 4233a29e69598a4485a65a685e7bd0d502ba6f73 /source | |
parent | b2faf96cf737a3169e90d90939248d74f1fb3fc9 (diff) | |
download | samba-35850edb5267a880d36658004e095a73489f310e.tar.gz |
Check for the right error return value
(cherry picked from commit 4d2598282bb9f0c08da9f949ff23ff253c0ca7ac)
Diffstat (limited to 'source')
-rw-r--r-- | source/libsmb/libsmb_stat.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/source/libsmb/libsmb_stat.c b/source/libsmb/libsmb_stat.c index bfcacdc87a0..38a44417564 100644 --- a/source/libsmb/libsmb_stat.c +++ b/source/libsmb/libsmb_stat.c @@ -323,13 +323,14 @@ SMBC_statvfs_ctx(SMBCCTX *context, /* Is it a file or a directory? */ if (S_ISDIR(statbuf.st_mode)) { /* It's a directory. */ - if ((pFile = SMBC_opendir_ctx(context, path)) < 0) { + if ((pFile = SMBC_opendir_ctx(context, path)) == NULL) { return -1; } bIsDir = true; } else if (S_ISREG(statbuf.st_mode)) { /* It's a file. */ - if ((pFile = SMBC_open_ctx(context, path, O_RDONLY, 0)) < 0) { + if ((pFile = SMBC_open_ctx(context, path, + O_RDONLY, 0)) == NULL) { return -1; } bIsDir = false; |