Source-Changes-D archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: CVS commit: src/usr.bin/xinstall



>>> "Christos Zoulas" <christos%netbsd.org@localhost> wrote

> 
> Module Name:	src
> Committed By:	christos
> Date:		Mon Jun 15 16:33:38 UTC 2015
> 
> Modified Files:
> 	src/usr.bin/xinstall: Makefile xinstall.c
> 
> Log Message:
> - improve error printing
> - deduplicate run functions and don't use the shell so that we handle
>   filenames with spaces and metacharacters consistently.

The latter change seems to make incompatibility as before:

- wait(2) after posix_spawnp? is missing.
- don't unlink file when execution of strip(1) is failed.

The following is a quick fix.

Index: xinstall.c
===================================================================
RCS file: /cvsroot/src/usr.bin/xinstall/xinstall.c,v
retrieving revision 1.119
diff -u -d -p -r1.119 xinstall.c
--- xinstall.c	15 Jun 2015 16:33:38 -0000	1.119
+++ xinstall.c	17 Jun 2015 10:40:45 -0000
@@ -990,7 +990,8 @@ run(const char *command, const char *fla
 	if (rv != 0) {
 		warnc(rv, "Cannot execute %s", command);
 		rv = -1;
-	}
+	} else
+		rv = wait(&status);
 #else
 	switch (vfork()) {
 	case -1:
@@ -1042,7 +1043,7 @@ strip(const char *to_name)
 		stripprog = _PATH_STRIP;
 #endif
 	}
-	run(stripprog, stripArgs, to_name, 0);
+	run(stripprog, stripArgs, to_name, 1);
 }
 
 /*

-- Takeshi Nakayama


Home | Main Index | Thread Index | Old Index