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

2015-06-17 Thread Christos Zoulas
On Jun 17, 11:07pm, t...@catvmics.ne.jp (Takeshi Nakayama) wrote:
-- Subject: Re: CVS commit: src/usr.bin/xinstall

| >>> "Christos Zoulas"  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.

Fixed, thanks!

christos


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

2015-06-17 Thread Takeshi Nakayama
>>> "Christos Zoulas"  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 -  1.119
+++ xinstall.c  17 Jun 2015 10:40:45 -
@@ -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