diff options
author | Jelmer Vernooij <jelmer@samba.org> | 2008-12-14 17:17:55 +0100 |
---|---|---|
committer | Jelmer Vernooij <jelmer@samba.org> | 2008-12-14 17:17:55 +0100 |
commit | 573441ff9b63fed9ab0b7eaf52df337ccd5592be (patch) | |
tree | 77c354f48c04fd7d92aa02cd92125eca3d246eae /source3/libsmb/libsmb_dir.c | |
parent | cd25b6245f8185e36a365dcf4c28e7df13090d3e (diff) | |
parent | daeb3a190d16a5bc05be63b2b136ebe65d6f6cf7 (diff) | |
download | samba-573441ff9b63fed9ab0b7eaf52df337ccd5592be.tar.gz samba-573441ff9b63fed9ab0b7eaf52df337ccd5592be.tar.bz2 samba-573441ff9b63fed9ab0b7eaf52df337ccd5592be.zip |
Merge branch 'master' of ssh://git.samba.org/data/git/samba
Diffstat (limited to 'source3/libsmb/libsmb_dir.c')
-rw-r--r-- | source3/libsmb/libsmb_dir.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/source3/libsmb/libsmb_dir.c b/source3/libsmb/libsmb_dir.c index aa313f2c05..d12e7487f6 100644 --- a/source3/libsmb/libsmb_dir.c +++ b/source3/libsmb/libsmb_dir.c @@ -1193,8 +1193,6 @@ SMBC_mkdir_ctx(SMBCCTX *context, * Our list function simply checks to see if a directory is not empty */ -static int smbc_rmdir_dirempty = True; - static void rmdir_list_fn(const char *mnt, file_info *finfo, @@ -1203,7 +1201,8 @@ rmdir_list_fn(const char *mnt, { if (strncmp(finfo->name, ".", 1) != 0 && strncmp(finfo->name, "..", 2) != 0) { - smbc_rmdir_dirempty = False; + bool *smbc_rmdir_dirempty = (bool *)state; + *smbc_rmdir_dirempty = false; } } @@ -1292,8 +1291,7 @@ SMBC_rmdir_ctx(SMBCCTX *context, /* Local storage to avoid buffer overflows */ char *lpath; - - smbc_rmdir_dirempty = True; /* Make this so ... */ + bool smbc_rmdir_dirempty = true; lpath = talloc_asprintf(frame, "%s\\*", targetpath); @@ -1305,7 +1303,8 @@ SMBC_rmdir_ctx(SMBCCTX *context, if (cli_list(targetcli, lpath, aDIR | aSYSTEM | aHIDDEN, - rmdir_list_fn, NULL) < 0) { + rmdir_list_fn, + &smbc_rmdir_dirempty) < 0) { /* Fix errno to ignore latest error ... */ DEBUG(5, ("smbc_rmdir: " |