summaryrefslogtreecommitdiff
path: root/source3/smbwrapper
diff options
context:
space:
mode:
Diffstat (limited to 'source3/smbwrapper')
-rw-r--r--source3/smbwrapper/smbw_dir.c14
-rw-r--r--source3/smbwrapper/wrapped.c6
2 files changed, 10 insertions, 10 deletions
diff --git a/source3/smbwrapper/smbw_dir.c b/source3/smbwrapper/smbw_dir.c
index 74b58a7d3b..6453c55871 100644
--- a/source3/smbwrapper/smbw_dir.c
+++ b/source3/smbwrapper/smbw_dir.c
@@ -587,19 +587,23 @@ a wrapper for fchdir()
int smbw_fchdir(unsigned int fd)
{
struct smbw_dir *dir;
+ int ret;
smbw_busy++;
dir = smbw_dir(fd);
- if (!dir) {
- errno = EBADF;
+ if (dir) {
smbw_busy--;
- return -1;
+ return chdir(dir->path);
}
+ ret = real_fchdir(fd);
+ if (ret == 0) {
+ sys_getwd(smbw_cwd);
+ }
+
smbw_busy--;
-
- return chdir(dir->path);
+ return ret;
}
/*****************************************************
diff --git a/source3/smbwrapper/wrapped.c b/source3/smbwrapper/wrapped.c
index 790d56c936..d5f47aac46 100644
--- a/source3/smbwrapper/wrapped.c
+++ b/source3/smbwrapper/wrapped.c
@@ -164,11 +164,7 @@
int fchdir(int fd)
{
- if (smbw_fd(fd)) {
- return smbw_fchdir(fd);
- }
-
- return real_fchdir(fd);
+ return smbw_fchdir(fd);
}
#ifdef HAVE___FCHDIR