From ecd10c1195d7c68d97eb7d679f932aa85ba050a6 Mon Sep 17 00:00:00 2001 From: Ricardo Mestre Date: Sat, 23 Oct 2021 11:22:50 +0000 Subject: if both stdout and stderr are redirected to a non-tty, pledge(2) will kill ncurses applications, e.g.: /usr/games/worms 2>&1 | cat solve this by only calling pledge(2) after initscr(3) is set and done, or whatever function that calls it. since pledge(2) is called later now the promises might be reduced, but this a diff for another day. found by naddy@ almost a year ago, discussed with him deraadt@ and tb@ ok tb@ --- games/rain/rain.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'games/rain') diff --git a/games/rain/rain.c b/games/rain/rain.c index 6a10c49d251..1873fa2b917 100644 --- a/games/rain/rain.c +++ b/games/rain/rain.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rain.c,v 1.21 2016/01/07 16:00:33 tb Exp $ */ +/* $OpenBSD: rain.c,v 1.22 2021/10/23 11:22:49 mestre Exp $ */ /* * Copyright (c) 1980, 1993 @@ -59,9 +59,6 @@ main(int argc, char *argv[]) int ch; int xpos[5], ypos[5]; - if (pledge("stdio rpath tty", NULL) == -1) - err(1, "pledge"); - /* set default delay based on terminal baud rate */ if (tcgetattr(STDOUT_FILENO, &term) == 0 && (speed = cfgetospeed(&term)) > B9600) -- cgit v1.2.3