svn commit: samba r9667 - in branches/SOC/SAMBA_3_0/source/client: .
kalim at samba.org
kalim at samba.org
Fri Aug 26 21:18:40 GMT 2005
Author: kalim
Date: 2005-08-26 21:18:39 +0000 (Fri, 26 Aug 2005)
New Revision: 9667
WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=9667
Log:
Changed the way cmd_mput checks if a directory exists. (Thanks to derrell for catching that).
-Kalim
Modified:
branches/SOC/SAMBA_3_0/source/client/client.c
Changeset:
Modified: branches/SOC/SAMBA_3_0/source/client/client.c
===================================================================
--- branches/SOC/SAMBA_3_0/source/client/client.c 2005-08-26 20:29:01 UTC (rev 9666)
+++ branches/SOC/SAMBA_3_0/source/client/client.c 2005-08-26 21:18:39 UTC (rev 9667)
@@ -1663,25 +1663,25 @@
if (!seek_list(temp_list, lname))
break;
} else { /* Yes */
- int dh;
SAFE_FREE(rname);
if(asprintf(&rname, "smb:%s%s%s", service, cur_dir, lname) < 0) break;
/*dos_format(rname);*/
/* test if the directory exists by opening it */
- if (!((dh=smbc_opendir(rname)) < 0)) {
+ /*if (!((dh=smbc_opendir(rname)) < 0)) {
smbc_closedir(dh);
continue;
+ }*/
+ /* test if the directory exists by making it */
+ ret = smbc_mkdir(rname, 755);
+ if ((ret != 0) && (errno != EEXIST))
+ {
+ d_printf("Error: %s. Unable to open or create dir %s, skipping...\n", strerror(errno), rname);
+ /* Skip the directory */
+ lname[strlen(lname)-1] = '/';
+ if (!seek_list(temp_list, lname))
+ break;
}
- /* directory does not exist, try making it */
- if (!(smbc_mkdir(rname, 755) < 0))
- continue;
-
- d_printf("Unable to open or create dir, skipping...\n");
- /* Skip the directory */
- lname[strlen(lname)-1] = '/';
- if (!seek_list(temp_list, lname))
- break;
}
continue;
} else {
More information about the samba-cvs
mailing list