File klibc-2.0.4-umount.patch of Package klibc

diff -Nurp klibc-2.0.4/usr/utils/umount.c klibc-2.0.4-umount/usr/utils/umount.c
--- klibc-2.0.4/usr/utils/umount.c	2014-07-26 03:15:07.000000000 +0300
+++ klibc-2.0.4-umount/usr/utils/umount.c	2014-09-22 05:49:21.436413186 +0300
@@ -7,42 +7,34 @@
 #include <string.h>
 #include <unistd.h>
 
-char *progname;
-
 int main(int argc, char *argv[])
 {
-	int c, flag = 0;
-
-	progname = argv[0];
+	int c, flags = 0;
 
 	do {
 		c = getopt(argc, argv, "fli");
-		if (c == EOF)
-			break;
 		switch (c) {
 		case 'f':
-			flag |= MNT_FORCE;
-			break;
+			flags |= MNT_FORCE;
+			continue;
 		case 'l':
-			flag |= MNT_DETACH;
-			break;
+			flags |= MNT_DETACH;
 		case 'i':
+		default:
 			/* ignore for now; no support for umount helpers */
-			break;
+			continue;
 		case '?':
-			fprintf(stderr, "%s: invalid option -%c\n",
-				progname, optopt);
-			exit(1);
+			fprintf(stderr, "%s: invalid option -%c\n", argv[0], optopt);
+			return 1;
 		}
-	} while (1);
+	} while (c != EOF);
 
 	if (optind + 1 != argc) {
-		fprintf(stderr, "Usage: %s [-f] [-l] [-i] mntpoint\n",
-			progname);
+		fprintf(stderr, "Usage: %s [-f] [-l] [-i] mntpoint\n", argv[0]);
 		return 1;
 	}
 
-	if (umount2(argv[optind], flag) == -1) {
+	if (umount2(argv[optind], flags) == -1) {
 		perror("umount2");
 		return 255;
 	}
openSUSE Build Service is sponsored by