summaryrefslogtreecommitdiffstats
path: root/source
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>1998-10-08 01:23:33 +0000
committerAndrew Tridgell <tridge@samba.org>1998-10-08 01:23:33 +0000
commit6121f7c8c2d63fd12266327a6f2ac9a5e717dccc (patch)
tree374eb9503fef3fc0a3852db45462b768cdc12ae0 /source
parente5ed0e6f96835c5b189368faf4555d07f1f6b19c (diff)
downloadsamba-6121f7c8c2d63fd12266327a6f2ac9a5e717dccc.tar.gz
samba-6121f7c8c2d63fd12266327a6f2ac9a5e717dccc.tar.xz
samba-6121f7c8c2d63fd12266327a6f2ac9a5e717dccc.zip
fixed a problem with fchdir() that broke "cvs -d" in smbsh
Diffstat (limited to 'source')
-rw-r--r--source/smbwrapper/smbw_dir.c14
-rw-r--r--source/smbwrapper/wrapped.c6
2 files changed, 10 insertions, 10 deletions
diff --git a/source/smbwrapper/smbw_dir.c b/source/smbwrapper/smbw_dir.c
index 74b58a7d3b9..6453c55871f 100644
--- a/source/smbwrapper/smbw_dir.c
+++ b/source/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/source/smbwrapper/wrapped.c b/source/smbwrapper/wrapped.c
index 790d56c9366..d5f47aac46c 100644
--- a/source/smbwrapper/wrapped.c
+++ b/source/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