1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
|
$NetBSD: patch-ad,v 1.3 2005/05/31 21:44:42 rillig Exp $
--- guicontrol.c.orig Sat Aug 23 13:30:51 1997
+++ guicontrol.c Tue May 31 23:42:01 2005
@@ -312,6 +312,14 @@ void gui_control(void)
if (quit_flag)
{
/* fprintf(stderr, "quit_flag is true\n"); */
+
+ if((flags = fcntl(STDOUT_FILENO, F_GETFL, 0)) < 0)
+ perror("fcntl");
+ flags &= ~O_NONBLOCK;
+
+ if(fcntl(STDOUT_FILENO, F_SETFL, flags) < 0)
+ perror("fcntl");
+
exit(0);
}
while(GUI_FD_TO_PLAY != -1)
@@ -334,7 +342,7 @@ void gui_control(void)
if((flags = fcntl(STDIN_FILENO, F_GETFL, 0)) < 0)
perror("fcntl");
- flags ^= O_NONBLOCK;
+ flags &= ~O_NONBLOCK;
if(fcntl(STDIN_FILENO, F_SETFL, flags) < 0)
perror("fcntl");
@@ -394,7 +402,7 @@ int decodeMPEG_2(int inFilefd)
/* Set stdin to blocking */
if((flags = fcntl(STDIN_FILENO, F_GETFL, 0)) < 0)
perror("fcntl");
- flags ^= O_NONBLOCK;
+ flags &= ~O_NONBLOCK;
if(fcntl(STDIN_FILENO, F_SETFL, flags) < 0)
perror("fcntl");
}
|