From: cheloha Date: Wed, 9 Feb 2022 01:58:57 +0000 (+0000) Subject: cat(1): drop "rpath" promise in no-file case X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=720008b660ac55202e0bb85806ab3f465334fe9d;p=openbsd cat(1): drop "rpath" promise in no-file case If we're only working with the standard input we don't need "rpath". Tweaked by mestre@. Thread: https://marc.info/?l=openbsd-tech&m=163941848104274&w=2 No objections on tech@ after several weeks. --- diff --git a/bin/cat/cat.c b/bin/cat/cat.c index 129c3696870..a2eff2e1b30 100644 --- a/bin/cat/cat.c +++ b/bin/cat/cat.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cat.c,v 1.33 2022/02/09 01:56:28 cheloha Exp $ */ +/* $OpenBSD: cat.c,v 1.34 2022/02/09 01:58:57 cheloha Exp $ */ /* $NetBSD: cat.c,v 1.11 1995/09/07 06:12:54 jtc Exp $ */ /* @@ -95,6 +95,9 @@ main(int argc, char *argv[]) argv += optind; if (argc == 0) { + if (pledge("stdio", NULL) == -1) + err(1, "pledge"); + cat_file(NULL); } else { for (; *argv != NULL; argv++)