summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDerrell Lipman <derrell.lipman@unwireduniverse.com>2009-02-14 09:41:55 -0500
committerDerrell Lipman <derrell.lipman@unwireduniverse.com>2009-02-14 09:44:36 -0500
commitc2661aec24f244c1cf94dca02592b3410b9b6f31 (patch)
treed033295718eb097e857efceb3a5c9f0615c69025
parent352c97561e9de6ccd0102859d18ed15913042622 (diff)
downloadsamba-c2661aec24f244c1cf94dca02592b3410b9b6f31.tar.gz
samba-c2661aec24f244c1cf94dca02592b3410b9b6f31.tar.bz2
samba-c2661aec24f244c1cf94dca02592b3410b9b6f31.zip
Check for the right error return value
-rw-r--r--source3/libsmb/libsmb_stat.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/source3/libsmb/libsmb_stat.c b/source3/libsmb/libsmb_stat.c
index d589f7ef71..3eec15f6bd 100644
--- a/source3/libsmb/libsmb_stat.c
+++ b/source3/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;