summaryrefslogtreecommitdiff
path: root/source3/lib
diff options
context:
space:
mode:
Diffstat (limited to 'source3/lib')
-rw-r--r--source3/lib/util.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/source3/lib/util.c b/source3/lib/util.c
index ca17fbdcb4..a048c8b3a7 100644
--- a/source3/lib/util.c
+++ b/source3/lib/util.c
@@ -755,12 +755,17 @@ time_t file_modtime(char *fname)
BOOL directory_exist(char *dname,struct stat *st)
{
struct stat st2;
+ BOOL ret;
+
if (!st) st = &st2;
if (sys_stat(dname,st) != 0)
return(False);
- return(S_ISDIR(st->st_mode));
+ ret = S_ISDIR(st->st_mode);
+ if(!ret)
+ errno = ENOTDIR;
+ return ret;
}
/*******************************************************************