From: cheloha Date: Tue, 8 Feb 2022 17:44:18 +0000 (+0000) Subject: rev(1): drop "rpath" promise in no-file branch. X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=60e87943b83ba9bdbf49d219ac833e04b55168b1;p=openbsd rev(1): drop "rpath" promise in no-file branch. We don't need "rpath" if we're only processing the standard input. Thread: https://marc.info/?l=openbsd-tech&m=164433848419371&w=2 ok deraadt@ millert@ --- diff --git a/usr.bin/rev/rev.c b/usr.bin/rev/rev.c index 9314c2b5e9e..5938e062322 100644 --- a/usr.bin/rev/rev.c +++ b/usr.bin/rev/rev.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rev.c,v 1.15 2022/01/29 00:11:54 cheloha Exp $ */ +/* $OpenBSD: rev.c,v 1.16 2022/02/08 17:44:18 cheloha Exp $ */ /* $NetBSD: rev.c,v 1.5 1995/09/28 08:49:40 tls Exp $ */ /*- @@ -68,6 +68,9 @@ main(int argc, char *argv[]) rval = 0; if (argc == 0) { + if (pledge("stdio", NULL) == -1) + err(1, "pledge"); + rval = rev_file(NULL); } else { for (; *argv != NULL; argv++)