From 9a7ad9bc671dfac4e4bff7b42c15771dfebe74e0 Mon Sep 17 00:00:00 2001 From: Gleydson Soares Date: Tue, 29 Dec 2015 19:04:47 +0000 Subject: fix exit status on pledge(2) failure. OK tb@ jsg@ --- usr.bin/which/which.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'usr.bin/which') diff --git a/usr.bin/which/which.c b/usr.bin/which/which.c index 3281a78c6d9..8aa6428f78a 100644 --- a/usr.bin/which/which.c +++ b/usr.bin/which/which.c @@ -1,4 +1,4 @@ -/* $OpenBSD: which.c,v 1.21 2015/10/10 19:02:19 deraadt Exp $ */ +/* $OpenBSD: which.c,v 1.22 2015/12/29 19:04:46 gsoares Exp $ */ /* * Copyright (c) 1997 Todd C. Miller @@ -85,7 +85,7 @@ main(int argc, char *argv[]) err(1, "Can't set uid to %u", geteuid()); if (pledge("stdio rpath", NULL) == -1) - err(1, "pledge"); + err(2, "pledge"); for (n = 0; n < argc; n++) if (findprog(argv[n], path, progmode, allmatches) == 0) -- cgit v1.2.3