diff options
Diffstat (limited to 'winsup/cygwin/syscalls.cc')
-rw-r--r-- | winsup/cygwin/syscalls.cc | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/winsup/cygwin/syscalls.cc b/winsup/cygwin/syscalls.cc index af26e008b..7950299ca 100644 --- a/winsup/cygwin/syscalls.cc +++ b/winsup/cygwin/syscalls.cc @@ -2047,10 +2047,12 @@ extern "C" long int pathconf (const char *file, int v) { fhandler_base *fh; + long ret = -1; myfault efault; if (efault.faulted (EFAULT)) return -1; + if (!*file) { set_errno (ENOENT); @@ -2059,11 +2061,11 @@ pathconf (const char *file, int v) if (!(fh = build_fh_name (file, NULL, PC_SYM_FOLLOW, stat_suffixes))) return -1; if (!fh->exists ()) - { - set_errno (ENOENT); - return -1; - } - return fh->fpathconf (v); + set_errno (ENOENT); + else + ret = fh->fpathconf (v); + delete fh; + return ret; } extern "C" int |