shithub: riscv

Download patch

ref: 640adc8f8211d26f75c79b2c345040b9d490811f
parent: a37a13074c443c7104016187daad1e8171f0adc8
parent: 1ebcdca4ba208953fc8035c001b980eb7b51228b
author: cinap_lenrek <cinap_lenrek@felloff.net>
date: Wed Dec 21 20:59:00 EST 2016

merge

--- a/sys/src/libauth/newns.c
+++ b/sys/src/libauth/newns.c
@@ -152,7 +152,7 @@
 	cdroot = 0;
 	flags = 0;
 	argv0 = 0;
-	if (newnsdebug){
+	if(newnsdebug){
 		for (i = 0; i < argc; i++)
 			fprint(2, "%s ", argv[i]);
 		fprint(2, "\n");
@@ -181,9 +181,9 @@
 			return 0;
 		cdroot |= nsfile(fn, b, rpc);
 		Bterm(b);
-	}else if(strcmp(argv0, "clear") == 0 && argc == 0)
+	}else if(strcmp(argv0, "clear") == 0 && argc == 0){
 		rfork(RFCNAMEG);
-	else if(strcmp(argv0, "bind") == 0 && argc == 2){
+	}else if(strcmp(argv0, "bind") == 0 && argc == 2){
 		if(bind(argv[0], argv[1], flags) < 0 && newnsdebug)
 			fprint(2, "%s: bind: %s %s: %r\n", fn, argv[0], argv[1]);
 	}else if(strcmp(argv0, "unmount") == 0){
@@ -193,6 +193,11 @@
 			unmount(argv[0], argv[1]);
 	}else if(strcmp(argv0, "mount") == 0){
 		fd = open(argv[0], ORDWR);
+		if(fd < 0){
+			if(newnsdebug)
+				fprint(2, "%s: mount: %s: %r\n", fn, argv[0]);
+			return 0;
+		}
 		if(argc == 2){
 			if(famount(fd, rpc, argv[1], flags, "") < 0 && newnsdebug)
 				fprint(2, "%s: mount: %s %s: %r\n", fn, argv[0], argv[1]);