sbase

suckless unix tools
git clone git://git.suckless.org/sbase
Log | Files | Refs | README | LICENSE

commit 8ef9b38e56b9b03fed5c1e4d5cb4a4cb66713868
parent 8c02cf675cf55ebc7fe2830a275257cea6ecf36d
Author: Michael Forney <mforney@mforney.org>
Date:   Sun, 24 May 2020 20:56:50 -0700

install: Use fchown to change owner

Diffstat:
Mxinstall.c | 6++----
1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/xinstall.c b/xinstall.c @@ -55,16 +55,14 @@ install(const char *s1, const char *s2, int depth) } if (concat(f1, s1, f2, s2) < 0) exit(1); - if (fchmod(f2, mode) < 0) eprintf("fchmod %s:", s2); + if (fchown(f2, owner, group) < 0) + eprintf("lchown %s:", s2); close(f1); close(f2); - if (lchown(s2, owner, group) < 0) - eprintf("lchown %s:", s2); - return 0; }