From c2661aec24f244c1cf94dca02592b3410b9b6f31 Mon Sep 17 00:00:00 2001 From: Derrell Lipman Date: Sat, 14 Feb 2009 09:41:55 -0500 Subject: Check for the right error return value --- source3/libsmb/libsmb_stat.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'source3/libsmb') 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; -- cgit