diff options
author | Peter Wemm <peter@FreeBSD.org> | 1997-09-14 08:21:44 +0000 |
---|---|---|
committer | Peter Wemm <peter@FreeBSD.org> | 1997-09-14 08:21:44 +0000 |
commit | 387dcb61ff144b361a50bdba18a0fd337c32fda8 (patch) | |
tree | a075938d51d4f12ebcce82b895e7f2a4bb4e1f59 /usr.bin/xinstall/xinstall.c | |
parent | 87963de0e490f077455806ff75d94e4020495397 (diff) | |
download | src-387dcb61ff144b361a50bdba18a0fd337c32fda8.tar.gz src-387dcb61ff144b361a50bdba18a0fd337c32fda8.zip |
When calling strip, temporarily close the file, call strip and then
reopen it after strip has finished. This makes it work when
/usr/bin/strip replaces the file rather than doing an in-place edit
(such as the binutils-2.8 strip, which is a variation of objcopy).
This is necessary if install(1) and strip(1) are going to cooperate
on an ELF system.
Notes
Notes:
svn path=/head/; revision=29379
Diffstat (limited to 'usr.bin/xinstall/xinstall.c')
-rw-r--r-- | usr.bin/xinstall/xinstall.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/usr.bin/xinstall/xinstall.c b/usr.bin/xinstall/xinstall.c index a4c8da571c0b..2889bab644c0 100644 --- a/usr.bin/xinstall/xinstall.c +++ b/usr.bin/xinstall/xinstall.c @@ -42,7 +42,7 @@ static const char copyright[] = static char sccsid[] = "From: @(#)xinstall.c 8.1 (Berkeley) 7/21/93"; #endif static const char rcsid[] = - "$Id: xinstall.c,v 1.23 1997/05/24 05:39:19 peter Exp $"; + "$Id: xinstall.c,v 1.24 1997/08/27 06:29:23 charnier Exp $"; #endif /* not lint */ /*- @@ -388,9 +388,17 @@ install(from_name, to_name, fset, flags) (void)close(from_fd); } - if (dostrip) + if (dostrip) { + (void)close(to_fd); + strip(to_name); + /* Reopen target. */ + to_fd = open(to_name, O_RDWR, 0); + if (to_fd < 0) + err(EX_OSERR, "%s", to_name); + } + /* * Unfortunately, because we strip the installed file and not the * original one, it is impossible to do the comparison without |