[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[Cluster-devel] cluster/gfs2/mount mount.gfs2.c umount.gfs2.c



CVSROOT:	/cvs/cluster
Module name:	cluster
Changes by:	rpeterso sourceware org	2006-07-28 13:58:10

Modified files:
	gfs2/mount     : mount.gfs2.c umount.gfs2.c 

Log message:
	1. Allow SIGINT signals so that gdb can break into hung mounts.
	2. Remove multiple trailing slashes for directory and mount point.
	3. Accept the -f option on umount that's sent to us during shutdown.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/gfs2/mount/mount.gfs2.c.diff?cvsroot=cluster&r1=1.15&r2=1.16
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/gfs2/mount/umount.gfs2.c.diff?cvsroot=cluster&r1=1.11&r2=1.12

--- cluster/gfs2/mount/mount.gfs2.c	2006/07/25 13:58:16	1.15
+++ cluster/gfs2/mount/mount.gfs2.c	2006/07/28 13:58:10	1.16
@@ -30,6 +30,7 @@
 	sigfillset(&sigs);
 	sigdelset(&sigs, SIGTRAP);
 	sigdelset(&sigs, SIGSEGV);
+	sigdelset(&sigs, SIGINT);
 	sigprocmask(how, &sigs, (sigset_t *) 0);
 }
 
@@ -83,9 +84,11 @@
 
 	if (optind < argc && argv[optind]) {
 		strncpy(mo->dir, argv[optind], PATH_MAX);
-		l = strlen(mo->dir);
-		if (mo->dir[l-1] == '/')
-			mo->dir[l-1] = 0;
+		l = strlen(mo->dir) - 1;
+		while (l > 0 && mo->dir[l] == '/') {
+			mo->dir[l] = '\0';
+			l--;
+		};
 	}
 
 	log_debug("mount %s %s", mo->dev, mo->dir);
--- cluster/gfs2/mount/umount.gfs2.c	2006/07/25 13:58:16	1.11
+++ cluster/gfs2/mount/umount.gfs2.c	2006/07/28 13:58:10	1.12
@@ -37,13 +37,16 @@
 	/* FIXME: check for "quiet" option and don't print in that case */
 
 	while (cont) {
-		optchar = getopt(argc, argv, "hVvX:");
+		optchar = getopt(argc, argv, "fhVvX:");
 
 		switch (optchar) {
 		case EOF:
 			cont = 0;
 			break;
 
+		case 'f':    /* autofs umount from /sbin/halt uses this */
+			break;
+
 		case 'v':
 			++verbose;
 			break;
@@ -68,9 +71,11 @@
 
 	if (optind < argc && argv[optind]) {
 		strncpy(mo->dir, argv[optind], PATH_MAX);
-		l = strlen(mo->dir);
-		if (mo->dir[l-1] == '/')
-			mo->dir[l-1] = 0;
+		l = strlen(mo->dir) - 1;
+		while (l > 0 && mo->dir[l] == '/') {
+			mo->dir[l] = '\0';
+			l--;
+		};
 	}
 
 	log_debug("umount %s", mo->dir);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]