diff --git a/sysutils/ttyplot/Makefile b/sysutils/ttyplot/Makefile index d17bc268091..c00ca7004f2 100644 --- a/sysutils/ttyplot/Makefile +++ b/sysutils/ttyplot/Makefile @@ -3,12 +3,14 @@ COMMENT = realtime plotting utility for terminals GH_ACCOUNT = tenox7 GH_PROJECT = ttyplot GH_TAGNAME = 1.7.4 +REVISION = 0 CATEGORIES = sysutils # Apache 2.0 PERMIT_PACKAGE = Yes +# uses pledge() WANTLIB += c curses m MAKE_FLAGS = CC="${CC}" CFLAGS="${CFLAGS}" diff --git a/sysutils/ttyplot/patches/patch-ttyplot_c b/sysutils/ttyplot/patches/patch-ttyplot_c index 6436bf37a16..498f4d313d6 100644 --- a/sysutils/ttyplot/patches/patch-ttyplot_c +++ b/sysutils/ttyplot/patches/patch-ttyplot_c @@ -12,3 +12,26 @@ Index: ttyplot.c #define _XOPEN_SOURCE_EXTENDED #else // This is needed for musl libc +@@ -923,10 +923,6 @@ int main(int argc, char *argv[]) { + exit(1); + } + +-#ifdef __OpenBSD__ +- if (pledge("stdio tty", NULL) == -1) +- err(1, "pledge"); +-#endif + + // Check if any colors are defined + bool has_colors = false; +@@ -986,6 +982,11 @@ int main(int argc, char *argv[]) { + + signal(SIGWINCH, signal_handler); + signal(SIGINT, signal_handler); ++ ++#ifdef __OpenBSD__ ++ if (pledge("stdio tty", NULL) == -1) ++ err(1, "pledge"); ++#endif + + while (1) { + struct timeval timeout = calculate_clock_refresh_timeout_from(now.tv_usec);