drop "cpath" under -c (no file creation), add pledge comment/marker; OK bcallah

This commit is contained in:
kn 2023-11-28 15:41:09 +00:00
parent 40d8a1db18
commit e2f48b6be7
2 changed files with 18 additions and 0 deletions

View File

@ -1,6 +1,7 @@
COMMENT = truncate or extend the length of files
DISTNAME = truncate-5.2.1
CATEGORIES = sysutils
REVISION = 0
HOMEPAGE = https://www.dragonflybsd.org/
MAINTAINER = Brian Callahan <bcallah@openbsd.org>
@ -8,6 +9,7 @@ MAINTAINER = Brian Callahan <bcallah@openbsd.org>
# BSD
PERMIT_PACKAGE = Yes
# uses pledge()
WANTLIB += c
SITES = https://mirrors.nycbug.org/pub/distfiles/

View File

@ -0,0 +1,16 @@
Drop "cpath" under -c (no file creation)
Index: truncate.c
--- truncate.c.orig
+++ truncate.c
@@ -84,6 +84,10 @@ main(int argc, char **argv)
argv += optind;
argc -= optind;
+ if (no_create)
+ if (pledge("stdio rpath wpath", NULL) == -1)
+ err(1, "pledge");
+
/*
* Exactly one of do_refer or got_size must be specified. Since
* do_relative implies got_size, do_relative and do_refer are