summaryrefslogtreecommitdiff
path: root/user/feh/stdout-buff.patch
blob: eaa251a3a7b6ac10659936f013b46a88126756c8 (plain) (blame)
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
On glibc, if output is redirected to a file, output will look like this:

touch test/ok/gif
touch test/ok/jpg
touch test/ok/png
touch test/ok/pnm
test/ok/gif
test/ok/jpg
test/ok/png
test/ok/pnm

On musl, if stdout is redirected to a file, output looks like this:

test/ok/gif
touch test/ok/gif
touch test/ok/jpg
touch test/ok/png
touch test/ok/pnm
test/ok/jpg
test/ok/png
test/ok/pnm

On glibc and musl, if stdout is interactive, it looks like this:

test/ok/gif
touch test/ok/gif
test/ok/jpg
touch test/ok/jpg
test/ok/png
touch test/ok/png
test/ok/pnm
touch test/ok/pnm

Adding two fflush calls makes all behavior look like the last example.

--- feh-2.22/src/list.c	2017-11-04 14:03:43.000000000 +0000
+++ feh-2.22/src/list.c	2018-01-03 02:59:08.840000000 +0000
@@ -92,6 +92,7 @@
 				if (opt.verbose)
 					feh_display_status('.');
 				puts(file->filename);
+				fflush(stdout);
 				feh_action_run(file, opt.actions[0], NULL);
 			}
 			else {
@@ -106,6 +107,7 @@
 				if (opt.verbose)
 					feh_display_status('.');
 				puts(file->filename);
+				fflush(stdout);
 				feh_action_run(file, opt.actions[0], NULL);
 			}
 			else {
--- feh-2.22/test/nx_action/loadable_action	2017-11-04 14:03:43.000000000 +0000
+++ feh-2.22/test/nx_action/loadable_action	2018-01-03 02:46:48.030000000 +0000
@@ -1,8 +1,8 @@
-touch test/ok/gif
-touch test/ok/jpg
-touch test/ok/png
-touch test/ok/pnm
 test/ok/gif
+touch test/ok/gif
 test/ok/jpg
+touch test/ok/jpg
 test/ok/png
+touch test/ok/png
 test/ok/pnm
+touch test/ok/pnm
--- feh-2.22/test/nx_action/loadable_naction	2017-11-04 14:03:43.000000000 +0000
+++ feh-2.22/test/nx_action/loadable_naction	2018-01-03 02:51:05.340000000 +0000
@@ -1,8 +1,8 @@
-touch test/ok/gif
-touch test/ok/jpg
-touch test/ok/png
-touch test/ok/pnm
 test/ok/gif
+touch test/ok/gif
 test/ok/jpg
+touch test/ok/jpg
 test/ok/png
+touch test/ok/png
 test/ok/pnm
+touch test/ok/pnm
--- feh-2.22/test/nx_action/unloadable_action	2017-11-04 14:03:43.000000000 +0000
+++ feh-2.22/test/nx_action/unloadable_action	2018-01-03 02:51:36.480000000 +0000
@@ -1,8 +1,8 @@
-rm test/fail/gif
-rm test/fail/jpg
-rm test/fail/png
-rm test/fail/pnm
 test/fail/gif
+rm test/fail/gif
 test/fail/jpg
+rm test/fail/jpg
 test/fail/png
+rm test/fail/png
 test/fail/pnm
+rm test/fail/pnm
--- feh-2.22/test/nx_action/unloadable_naction	2017-11-04 14:03:43.000000000 +0000
+++ feh-2.22/test/nx_action/unloadable_naction	2018-01-03 02:51:51.850000000 +0000
@@ -1,8 +1,8 @@
-rm test/fail/gif
-rm test/fail/jpg
-rm test/fail/png
-rm test/fail/pnm
 test/fail/gif
+rm test/fail/gif
 test/fail/jpg
+rm test/fail/jpg
 test/fail/png
+rm test/fail/png
 test/fail/pnm
+rm test/fail/pnm