svn commit: samba r6262 - in branches/SAMBA_3_0/source/client: .

sfrench at samba.org sfrench at samba.org
Sat Apr 9 05:01:01 GMT 2005


Author: sfrench
Date: 2005-04-09 05:01:00 +0000 (Sat, 09 Apr 2005)
New Revision: 6262

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=6262

Log:
Minor updates to cifs umount helper

Modified:
   branches/SAMBA_3_0/source/client/umount.cifs.c


Changeset:
Modified: branches/SAMBA_3_0/source/client/umount.cifs.c
===================================================================
--- branches/SAMBA_3_0/source/client/umount.cifs.c	2005-04-09 00:50:12 UTC (rev 6261)
+++ branches/SAMBA_3_0/source/client/umount.cifs.c	2005-04-09 05:01:00 UTC (rev 6262)
@@ -49,7 +49,7 @@
 #define MNT_EXPIRE 0x04
 #endif
 
-#define CIFS_IOC_CHECKUMOUNT _IOR('u', 2, int)
+#define CIFS_IOC_CHECKUMOUNT _IO('c', 2)
    
 static struct option longopts[] = {
 	{ "all", 0, NULL, 'a' },
@@ -93,14 +93,21 @@
 	/* presumably can not chdir into the target as we do on mount */
 
 	fileid = open(dir, O_RDONLY | O_DIRECTORY | O_NOFOLLOW, 0);
+	if(fileid == -1) {
+		if(verboseflg)
+			printf("error opening mountpoint %d %s",errno,strerror(errno));
+		return errno;
+	}
 
-	/* check if fileid valid if fileid == -1 BB FIXME */
-
 	rc = ioctl(fileid, CIFS_IOC_CHECKUMOUNT, NULL);
 
 	if(verboseflg)
-		printf("ioctl returned %d with errno %d\n",rc,errno);
+		printf("ioctl returned %d with errno %d %s\n",rc,errno,strerror(errno));
 
+	if(rc == ENOTTY)
+		printf("user unmounting via %s is an optional feature of the cifs filesystem driver (cifs.ko)\n\tand requires cifs.ko version 1.32 or later\n",thisprogram);
+	else if (rc > 0)
+		printf("user unmount of %s failed with %d %s",dir,errno,strerror(errno));
 	close(fileid);
 
 	return rc;



More information about the samba-cvs mailing list