diff options
author | Ricardo Mestre <mestre@cvs.openbsd.org> | 2021-10-23 11:22:50 +0000 |
---|---|---|
committer | Ricardo Mestre <mestre@cvs.openbsd.org> | 2021-10-23 11:22:50 +0000 |
commit | ecd10c1195d7c68d97eb7d679f932aa85ba050a6 (patch) | |
tree | 208ed86a4aec6394b30e888b051761c4aa0e22b5 /games/worms | |
parent | d44be2f813bdce978e91422aa39bbc7e6f7466f1 (diff) |
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@
Diffstat (limited to 'games/worms')
-rw-r--r-- | games/worms/worms.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/games/worms/worms.c b/games/worms/worms.c index 869e9311a30..1942cf6a448 100644 --- a/games/worms/worms.c +++ b/games/worms/worms.c @@ -1,4 +1,4 @@ -/* $OpenBSD: worms.c,v 1.29 2018/08/06 06:27:32 mestre Exp $ */ +/* $OpenBSD: worms.c,v 1.30 2021/10/23 11:22:49 mestre Exp $ */ /* * Copyright (c) 1980, 1993 @@ -180,9 +180,6 @@ main(int argc, char *argv[]) speed_t speed; time_t delay = 0; - 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) |