summaryrefslogtreecommitdiff
path: root/usr.bin
diff options
context:
space:
mode:
authormmcc <mmcc@cvs.openbsd.org>2015-11-03 04:58:59 +0000
committermmcc <mmcc@cvs.openbsd.org>2015-11-03 04:58:59 +0000
commit64e169d728fa2b5156996f8deb2e228ea0023c68 (patch)
treeb7995a754c94aed518e68e5da64214c5dc63742d /usr.bin
parent93dd1615ab6e75d5a39755cd1ab2818925d28200 (diff)
Surround pledge calls with blank lines.
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/dc/dc.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/usr.bin/dc/dc.c b/usr.bin/dc/dc.c
index f720470681a..27afad516d2 100644
--- a/usr.bin/dc/dc.c
+++ b/usr.bin/dc/dc.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: dc.c,v 1.16 2015/10/10 19:28:54 deraadt Exp $ */
+/* $OpenBSD: dc.c,v 1.17 2015/11/03 04:58:58 mmcc Exp $ */
/*
* Copyright (c) 2003, Otto Moerbeek <otto@drijf.net>
@@ -88,8 +88,10 @@ dc_main(int argc, char *argv[])
file = fopen(argv[0], "r");
if (file == NULL)
err(1, "cannot open file %s", argv[0]);
+
if (pledge("stdio", NULL) == -1)
err(1, "pledge");
+
if (fstat(fileno(file), &st) == -1)
err(1, "%s", argv[0]);
if (S_ISDIR(st.st_mode))
@@ -104,8 +106,10 @@ dc_main(int argc, char *argv[])
*/
return (0);
}
+
if (pledge("stdio", NULL) == -1)
err(1, "pledge");
+
src_setstream(&src, stdin);
reset_bmachine(&src);
eval();