Absolute File Name: | /home/opencoverage/opencoverage/guest-scripts/coreutils/src/src/sync.c |
Switch to Source code | Preprocessed file |
Line | Source | Count | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | - | |||||||||||||
2 | enum sync_mode | - | ||||||||||||
3 | { | - | ||||||||||||
4 | MODE_FILE, | - | ||||||||||||
5 | MODE_DATA, | - | ||||||||||||
6 | MODE_FILE_SYSTEM, | - | ||||||||||||
7 | MODE_SYNC | - | ||||||||||||
8 | }; | - | ||||||||||||
9 | - | |||||||||||||
10 | static struct option const long_options[] = | - | ||||||||||||
11 | { | - | ||||||||||||
12 | {"data", | - | ||||||||||||
13 | 0 | - | ||||||||||||
14 | , | - | ||||||||||||
15 | ((void *)0) | - | ||||||||||||
16 | , 'd'}, | - | ||||||||||||
17 | {"file-system", | - | ||||||||||||
18 | 0 | - | ||||||||||||
19 | , | - | ||||||||||||
20 | ((void *)0) | - | ||||||||||||
21 | , 'f'}, | - | ||||||||||||
22 | {"help", | - | ||||||||||||
23 | 0 | - | ||||||||||||
24 | , | - | ||||||||||||
25 | ((void *)0) | - | ||||||||||||
26 | , GETOPT_HELP_CHAR}, | - | ||||||||||||
27 | {"version", | - | ||||||||||||
28 | 0 | - | ||||||||||||
29 | , | - | ||||||||||||
30 | ((void *)0) | - | ||||||||||||
31 | , GETOPT_VERSION_CHAR}, | - | ||||||||||||
32 | { | - | ||||||||||||
33 | ((void *)0) | - | ||||||||||||
34 | , 0, | - | ||||||||||||
35 | ((void *)0) | - | ||||||||||||
36 | , 0} | - | ||||||||||||
37 | }; | - | ||||||||||||
38 | - | |||||||||||||
39 | void | - | ||||||||||||
40 | usage (int status) | - | ||||||||||||
41 | { | - | ||||||||||||
42 | if (status !=
| 3-7 | ||||||||||||
43 | 0
| 3-7 | ||||||||||||
44 | ) | - | ||||||||||||
45 | do { fprintf ( | - | ||||||||||||
46 | stderr | - | ||||||||||||
47 | , | - | ||||||||||||
48 | dcgettext (((void *)0), | - | ||||||||||||
49 | "Try '%s --help' for more information.\n" | - | ||||||||||||
50 | , 5) | - | ||||||||||||
51 | , program_name); } executed 3 times by 1 test: while (0);end of block Executed by:
| 3 | ||||||||||||
52 | else | - | ||||||||||||
53 | { | - | ||||||||||||
54 | printf ( | - | ||||||||||||
55 | dcgettext (((void *)0), | - | ||||||||||||
56 | "Usage: %s [OPTION] [FILE]...\n" | - | ||||||||||||
57 | , 5) | - | ||||||||||||
58 | , program_name); | - | ||||||||||||
59 | fputs_unlocked ( | - | ||||||||||||
60 | dcgettext (((void *)0), | - | ||||||||||||
61 | "Synchronize cached writes to persistent storage\n\nIf one or more files are specified, sync only them,\nor their containing file systems.\n\n" | - | ||||||||||||
62 | , 5) | - | ||||||||||||
63 | , | - | ||||||||||||
64 | stdout | - | ||||||||||||
65 | ) | - | ||||||||||||
66 | - | |||||||||||||
67 | - | |||||||||||||
68 | - | |||||||||||||
69 | - | |||||||||||||
70 | - | |||||||||||||
71 | ; | - | ||||||||||||
72 | - | |||||||||||||
73 | fputs_unlocked ( | - | ||||||||||||
74 | dcgettext (((void *)0), | - | ||||||||||||
75 | " -d, --data sync only file data, no unneeded metadata\n" | - | ||||||||||||
76 | , 5) | - | ||||||||||||
77 | , | - | ||||||||||||
78 | stdout | - | ||||||||||||
79 | ) | - | ||||||||||||
80 | - | |||||||||||||
81 | ; | - | ||||||||||||
82 | fputs_unlocked ( | - | ||||||||||||
83 | dcgettext (((void *)0), | - | ||||||||||||
84 | " -f, --file-system sync the file systems that contain the files\n" | - | ||||||||||||
85 | , 5) | - | ||||||||||||
86 | , | - | ||||||||||||
87 | stdout | - | ||||||||||||
88 | ) | - | ||||||||||||
89 | - | |||||||||||||
90 | ; | - | ||||||||||||
91 | - | |||||||||||||
92 | fputs_unlocked ( | - | ||||||||||||
93 | dcgettext (((void *)0), | - | ||||||||||||
94 | " --help display this help and exit\n" | - | ||||||||||||
95 | , 5) | - | ||||||||||||
96 | , | - | ||||||||||||
97 | stdout | - | ||||||||||||
98 | ); | - | ||||||||||||
99 | fputs_unlocked ( | - | ||||||||||||
100 | dcgettext (((void *)0), | - | ||||||||||||
101 | " --version output version information and exit\n" | - | ||||||||||||
102 | , 5) | - | ||||||||||||
103 | , | - | ||||||||||||
104 | stdout | - | ||||||||||||
105 | ); | - | ||||||||||||
106 | emit_ancillary_info ("sync"); | - | ||||||||||||
107 | } executed 7 times by 1 test: end of block Executed by:
| 7 | ||||||||||||
108 | exit (status); executed 10 times by 1 test: exit (status); Executed by:
| 10 | ||||||||||||
109 | } | - | ||||||||||||
110 | - | |||||||||||||
111 | - | |||||||||||||
112 | - | |||||||||||||
113 | - | |||||||||||||
114 | static | - | ||||||||||||
115 | _Bool | - | ||||||||||||
116 | - | |||||||||||||
117 | sync_arg (enum sync_mode mode, char const *file) | - | ||||||||||||
118 | { | - | ||||||||||||
119 | - | |||||||||||||
120 | _Bool | - | ||||||||||||
121 | ret = | - | ||||||||||||
122 | 1 | - | ||||||||||||
123 | ; | - | ||||||||||||
124 | int open_flags = | - | ||||||||||||
125 | 00 | - | ||||||||||||
126 | | | - | ||||||||||||
127 | 04000 | - | ||||||||||||
128 | ; | - | ||||||||||||
129 | int fd; | - | ||||||||||||
130 | fd = open (file, open_flags); | - | ||||||||||||
131 | if (fd < 0
| 2-4 | ||||||||||||
132 | { | - | ||||||||||||
133 | - | |||||||||||||
134 | - | |||||||||||||
135 | int rd_errno = | - | ||||||||||||
136 | (*__errno_location ()) | - | ||||||||||||
137 | ; | - | ||||||||||||
138 | if (open_flags != (
| 0-2 | ||||||||||||
139 | 01
| 0-2 | ||||||||||||
140 | |
| 0-2 | ||||||||||||
141 | 04000
| 0-2 | ||||||||||||
142 | )
| 0-2 | ||||||||||||
143 | fd = open (file, executed 2 times by 1 test: fd = open (file, 01 | 04000 ); Executed by:
| 2 | ||||||||||||
144 | 01 executed 2 times by 1 test: fd = open (file, 01 | 04000 ); Executed by:
| 2 | ||||||||||||
145 | | executed 2 times by 1 test: fd = open (file, 01 | 04000 ); Executed by:
| 2 | ||||||||||||
146 | 04000 executed 2 times by 1 test: fd = open (file, 01 | 04000 ); Executed by:
| 2 | ||||||||||||
147 | ); executed 2 times by 1 test: fd = open (file, 01 | 04000 ); Executed by:
| 2 | ||||||||||||
148 | if (fd < 0
| 0-2 | ||||||||||||
149 | error (0, rd_errno, executed 2 times by 1 test: error (0, rd_errno, dcgettext (((void *)0), "error opening %s" , 5) , quotearg_style (shell_escape_always_quoting_style, file)); Executed by:
| 2 | ||||||||||||
150 | dcgettext (((void *)0), executed 2 times by 1 test: error (0, rd_errno, dcgettext (((void *)0), "error opening %s" , 5) , quotearg_style (shell_escape_always_quoting_style, file)); Executed by:
| 2 | ||||||||||||
151 | "error opening %s" executed 2 times by 1 test: error (0, rd_errno, dcgettext (((void *)0), "error opening %s" , 5) , quotearg_style (shell_escape_always_quoting_style, file)); Executed by:
| 2 | ||||||||||||
152 | , 5) executed 2 times by 1 test: error (0, rd_errno, dcgettext (((void *)0), "error opening %s" , 5) , quotearg_style (shell_escape_always_quoting_style, file)); Executed by:
| 2 | ||||||||||||
153 | , quotearg_style (shell_escape_always_quoting_style, file)); executed 2 times by 1 test: error (0, rd_errno, dcgettext (((void *)0), "error opening %s" , 5) , quotearg_style (shell_escape_always_quoting_style, file)); Executed by:
| 2 | ||||||||||||
154 | return executed 2 times by 1 test: return 0 ; Executed by:
executed 2 times by 1 test: return 0 ; Executed by:
| 2 | ||||||||||||
155 | 0 executed 2 times by 1 test: return 0 ; Executed by:
| 2 | ||||||||||||
156 | ; executed 2 times by 1 test: return 0 ; Executed by:
| 2 | ||||||||||||
157 | } | - | ||||||||||||
158 | - | |||||||||||||
159 | - | |||||||||||||
160 | - | |||||||||||||
161 | int fdflags = | - | ||||||||||||
162 | rpl_fcntl | - | ||||||||||||
163 | (fd, | - | ||||||||||||
164 | 3 | - | ||||||||||||
165 | ); | - | ||||||||||||
166 | if (fdflags == -1
| 0-4 | ||||||||||||
167 | || | - | ||||||||||||
168 | rpl_fcntl
| 0-4 | ||||||||||||
169 | (fd,
| 0-4 | ||||||||||||
170 | 4
| 0-4 | ||||||||||||
171 | , fdflags & ~
| 0-4 | ||||||||||||
172 | 04000
| 0-4 | ||||||||||||
173 | ) < 0
| 0-4 | ||||||||||||
174 | { | - | ||||||||||||
175 | error (0, | - | ||||||||||||
176 | (*__errno_location ()) | - | ||||||||||||
177 | , | - | ||||||||||||
178 | dcgettext (((void *)0), | - | ||||||||||||
179 | "couldn't reset non-blocking mode %s" | - | ||||||||||||
180 | , 5) | - | ||||||||||||
181 | , | - | ||||||||||||
182 | quotearg_style (shell_escape_always_quoting_style, file)); | - | ||||||||||||
183 | ret = | - | ||||||||||||
184 | 0 | - | ||||||||||||
185 | ; | - | ||||||||||||
186 | } never executed: end of block | 0 | ||||||||||||
187 | - | |||||||||||||
188 | if (ret ==
| 0-4 | ||||||||||||
189 | 1
| 0-4 | ||||||||||||
190 | ) | - | ||||||||||||
191 | { | - | ||||||||||||
192 | int sync_status = -1; | - | ||||||||||||
193 | - | |||||||||||||
194 | switch (mode) | - | ||||||||||||
195 | { | - | ||||||||||||
196 | case never executed: MODE_DATA:case MODE_DATA: never executed: case MODE_DATA: | 0 | ||||||||||||
197 | sync_status = fdatasync (fd); | - | ||||||||||||
198 | break; never executed: break; | 0 | ||||||||||||
199 | - | |||||||||||||
200 | case executed 4 times by 1 test: MODE_FILE:case MODE_FILE: Executed by:
executed 4 times by 1 test: case MODE_FILE: Executed by:
| 4 | ||||||||||||
201 | sync_status = fsync (fd); | - | ||||||||||||
202 | break; executed 4 times by 1 test: break; Executed by:
| 4 | ||||||||||||
203 | - | |||||||||||||
204 | - | |||||||||||||
205 | case never executed: MODE_FILE_SYSTEM:case MODE_FILE_SYSTEM: never executed: case MODE_FILE_SYSTEM: | 0 | ||||||||||||
206 | sync_status = syncfs (fd); | - | ||||||||||||
207 | break; never executed: break; | 0 | ||||||||||||
208 | - | |||||||||||||
209 | - | |||||||||||||
210 | default never executed: :default: never executed: default: | 0 | ||||||||||||
211 | - | |||||||||||||
212 | (( | - | ||||||||||||
213 | "invalid sync_mode" | - | ||||||||||||
214 | ) ? (void) (0) : __assert_fail ( | - | ||||||||||||
215 | "\"invalid sync_mode\"" | - | ||||||||||||
216 | , "src/sync.c", 150, __PRETTY_FUNCTION__)) | - | ||||||||||||
217 | ; | - | ||||||||||||
218 | } never executed: end of block | 0 | ||||||||||||
219 | - | |||||||||||||
220 | if (sync_status < 0
| 1-3 | ||||||||||||
221 | { | - | ||||||||||||
222 | error (0, | - | ||||||||||||
223 | (*__errno_location ()) | - | ||||||||||||
224 | , | - | ||||||||||||
225 | dcgettext (((void *)0), | - | ||||||||||||
226 | "error syncing %s" | - | ||||||||||||
227 | , 5) | - | ||||||||||||
228 | , quotearg_style (shell_escape_always_quoting_style, file)); | - | ||||||||||||
229 | ret = | - | ||||||||||||
230 | 0 | - | ||||||||||||
231 | ; | - | ||||||||||||
232 | } executed 1 time by 1 test: end of block Executed by:
| 1 | ||||||||||||
233 | } executed 4 times by 1 test: end of block Executed by:
| 4 | ||||||||||||
234 | - | |||||||||||||
235 | if (close (fd) < 0
| 0-4 | ||||||||||||
236 | { | - | ||||||||||||
237 | error (0, | - | ||||||||||||
238 | (*__errno_location ()) | - | ||||||||||||
239 | , | - | ||||||||||||
240 | dcgettext (((void *)0), | - | ||||||||||||
241 | "failed to close %s" | - | ||||||||||||
242 | , 5) | - | ||||||||||||
243 | , quotearg_style (shell_escape_always_quoting_style, file)); | - | ||||||||||||
244 | ret = | - | ||||||||||||
245 | 0 | - | ||||||||||||
246 | ; | - | ||||||||||||
247 | } never executed: end of block | 0 | ||||||||||||
248 | - | |||||||||||||
249 | return executed 4 times by 1 test: ret;return ret; Executed by:
executed 4 times by 1 test: return ret; Executed by:
| 4 | ||||||||||||
250 | } | - | ||||||||||||
251 | - | |||||||||||||
252 | int | - | ||||||||||||
253 | main (int argc, char **argv) | - | ||||||||||||
254 | { | - | ||||||||||||
255 | int c; | - | ||||||||||||
256 | - | |||||||||||||
257 | _Bool | - | ||||||||||||
258 | args_specified; | - | ||||||||||||
259 | - | |||||||||||||
260 | _Bool | - | ||||||||||||
261 | arg_data = | - | ||||||||||||
262 | 0 | - | ||||||||||||
263 | , arg_file_system = | - | ||||||||||||
264 | 0 | - | ||||||||||||
265 | ; | - | ||||||||||||
266 | enum sync_mode mode; | - | ||||||||||||
267 | - | |||||||||||||
268 | _Bool | - | ||||||||||||
269 | ok = | - | ||||||||||||
270 | 1 | - | ||||||||||||
271 | ; | - | ||||||||||||
272 | - | |||||||||||||
273 | ; | - | ||||||||||||
274 | set_program_name (argv[0]); | - | ||||||||||||
275 | setlocale ( | - | ||||||||||||
276 | 6 | - | ||||||||||||
277 | , ""); | - | ||||||||||||
278 | bindtextdomain ("coreutils", "/usr/local/share/locale"); | - | ||||||||||||
279 | textdomain ("coreutils"); | - | ||||||||||||
280 | - | |||||||||||||
281 | atexit (close_stdout); | - | ||||||||||||
282 | - | |||||||||||||
283 | while ((
| 7-22 | ||||||||||||
284 | ((void *)0)
| 7-22 | ||||||||||||
285 | ))
| 7-22 | ||||||||||||
286 | != -1
| 7-22 | ||||||||||||
287 | { | - | ||||||||||||
288 | switch (c) | - | ||||||||||||
289 | { | - | ||||||||||||
290 | case executed 4 times by 1 test: 'd':case 'd': Executed by:
executed 4 times by 1 test: case 'd': Executed by:
| 4 | ||||||||||||
291 | arg_data = | - | ||||||||||||
292 | 1 | - | ||||||||||||
293 | ; | - | ||||||||||||
294 | break; executed 4 times by 1 test: break; Executed by:
| 4 | ||||||||||||
295 | - | |||||||||||||
296 | case executed 3 times by 1 test: 'f':case 'f': Executed by:
executed 3 times by 1 test: case 'f': Executed by:
| 3 | ||||||||||||
297 | arg_file_system = | - | ||||||||||||
298 | 1 | - | ||||||||||||
299 | ; | - | ||||||||||||
300 | break; executed 3 times by 1 test: break; Executed by:
| 3 | ||||||||||||
301 | - | |||||||||||||
302 | case executed 7 times by 1 test: GETOPT_HELP_CHAR:case GETOPT_HELP_CHAR: Executed by:
executed 7 times by 1 test: usage (case GETOPT_HELP_CHAR: Executed by:
| 7 | ||||||||||||
303 | 0 | - | ||||||||||||
304 | ); break; never executed: ;break; | 0 | ||||||||||||
305 | - | |||||||||||||
306 | case executed 5 times by 1 test: GETOPT_VERSION_CHAR:case GETOPT_VERSION_CHAR: Executed by:
executed 5 times by 1 test: version_etc (case GETOPT_VERSION_CHAR: Executed by:
| 5 | ||||||||||||
307 | stdout | - | ||||||||||||
308 | , "sync", "GNU coreutils", Version, ("Jim Meyering"), ("Giuseppe Scrivano"), (char *) | - | ||||||||||||
309 | ((void *)0) | - | ||||||||||||
310 | ); exit ( executed 5 times by 1 test: exit ( 0 ); Executed by:
| 5 | ||||||||||||
311 | 0 executed 5 times by 1 test: exit ( 0 ); Executed by:
| 5 | ||||||||||||
312 | ); executed 5 times by 1 test: break;exit ( 0 ); Executed by:
never executed: ;break; | 0-5 | ||||||||||||
313 | - | |||||||||||||
314 | default executed 3 times by 1 test: :default: Executed by:
executed 3 times by 1 test: default: Executed by:
| 3 | ||||||||||||
315 | usage ( | - | ||||||||||||
316 | 1 | - | ||||||||||||
317 | ); | - | ||||||||||||
318 | } never executed: end of block | 0 | ||||||||||||
319 | } | - | ||||||||||||
320 | - | |||||||||||||
321 | args_specified = optind < argc; | - | ||||||||||||
322 | - | |||||||||||||
323 | if (arg_data
| 1-5 | ||||||||||||
324 | { | - | ||||||||||||
325 | ((!!sizeof (struct { _Static_assert ( | - | ||||||||||||
326 | 1 | - | ||||||||||||
327 | , "verify_expr (" "1" ", " "(error (1, 0, dcgettext (((void *)0), \"cannot specify both --data and --file-system\", 5)), assume (false))" ")"); int _gl_dummy; })) ? ((error ( | - | ||||||||||||
328 | 1 | - | ||||||||||||
329 | , 0, | - | ||||||||||||
330 | dcgettext (((void *)0), | - | ||||||||||||
331 | "cannot specify both --data and --file-system" | - | ||||||||||||
332 | , 5) | - | ||||||||||||
333 | ), (( | - | ||||||||||||
334 | 0 | - | ||||||||||||
335 | ) ? (void) 0 : __builtin_unreachable ()))) : ((error ( | - | ||||||||||||
336 | 1 | - | ||||||||||||
337 | , 0, | - | ||||||||||||
338 | dcgettext (((void *)0), | - | ||||||||||||
339 | "cannot specify both --data and --file-system" | - | ||||||||||||
340 | , 5) | - | ||||||||||||
341 | ), (( | - | ||||||||||||
342 | 0 | - | ||||||||||||
343 | ) ? (void) 0 : __builtin_unreachable ())))) | - | ||||||||||||
344 | ; | - | ||||||||||||
345 | } never executed: end of block | 0 | ||||||||||||
346 | - | |||||||||||||
347 | if (!args_specified
| 0-5 | ||||||||||||
348 | (( executed 1 time by 1 test: !!sizeof (struct { _Static_assert (((!!sizeof (struct { _Static_assert ( 1 , "verify_expr (" "1" ", " "(error (1, 0, dcgettext (((void *)0), \"--data needs at least one argument\", 5)), assume (false))" ")"); int _gl_dummy; })) ? ((error ( 1 , 0, dcgettext (((void *)0), "--data needs at least one argument" , 5) ), (( 0 ) ? (void) 0 : __builtin_unreachable ()))) : ((error ( 1 , 0, dcgettext (((void *)0), "--data needs at least one argument" , 5) ), (( 0 ) ? (void) 0 : __builtin_unreachable ())))); Executed by:
executed 1 time by 1 test: ((!!sizeof (struct { _Static_assert ( 1 , "verify_expr (" "1" ", " "(error (1, 0, dcgettext (((void *)0), \"--data needs at least one argument\", 5)), assume (false))" ")"); int _gl_dummy; })) ? ((error ( 1 , 0, dcgettext (((void *)0), "--data needs at least one argument" , 5) ), (( 0 ) ? (void) 0 : __builtin_unreachable ()))) : ((error ( 1 , 0, dcgettext (((void *)0), "--data needs at least one argument" , 5) ), (( 0 ) ? (void) 0 : __builtin_unreachable ())))); Executed by:
| 1 | ||||||||||||
349 | 1 executed 1 time by 1 test: ((!!sizeof (struct { _Static_assert ( 1 , "verify_expr (" "1" ", " "(error (1, 0, dcgettext (((void *)0), \"--data needs at least one argument\", 5)), assume (false))" ")"); int _gl_dummy; })) ? ((error ( 1 , 0, dcgettext (((void *)0), "--data needs at least one argument" , 5) ), (( 0 ) ? (void) 0 : __builtin_unreachable ()))) : ((error ( 1 , 0, dcgettext (((void *)0), "--data needs at least one argument" , 5) ), (( 0 ) ? (void) 0 : __builtin_unreachable ())))); Executed by:
| 1 | ||||||||||||
350 | , "verify_expr (" "1" ", " "(error (1, 0, dcgettext (((void *)0), \"--data needs at least one argument\", 5)), assume (false))" ")"); int _gl_dummy; })) ? ((error ( executed 1 time by 1 test: ((!!sizeof (struct { _Static_assert ( 1 , "verify_expr (" "1" ", " "(error (1, 0, dcgettext (((void *)0), \"--data needs at least one argument\", 5)), assume (false))" ")"); int _gl_dummy; })) ? ((error ( 1 , 0, dcgettext (((void *)0), "--data needs at least one argument" , 5) ), (( 0 ) ? (void) 0 : __builtin_unreachable ()))) : ((error ( 1 , 0, dcgettext (((void *)0), "--data needs at least one argument" , 5) ), (( 0 ) ? (void) 0 : __builtin_unreachable ())))); Executed by:
| 1 | ||||||||||||
351 | 1 executed 1 time by 1 test: ((!!sizeof (struct { _Static_assert ( 1 , "verify_expr (" "1" ", " "(error (1, 0, dcgettext (((void *)0), \"--data needs at least one argument\", 5)), assume (false))" ")"); int _gl_dummy; })) ? ((error ( 1 , 0, dcgettext (((void *)0), "--data needs at least one argument" , 5) ), (( 0 ) ? (void) 0 : __builtin_unreachable ()))) : ((error ( 1 , 0, dcgettext (((void *)0), "--data needs at least one argument" , 5) ), (( 0 ) ? (void) 0 : __builtin_unreachable ())))); Executed by:
| 1 | ||||||||||||
352 | , 0, executed 1 time by 1 test: ((!!sizeof (struct { _Static_assert ( 1 , "verify_expr (" "1" ", " "(error (1, 0, dcgettext (((void *)0), \"--data needs at least one argument\", 5)), assume (false))" ")"); int _gl_dummy; })) ? ((error ( 1 , 0, dcgettext (((void *)0), "--data needs at least one argument" , 5) ), (( 0 ) ? (void) 0 : __builtin_unreachable ()))) : ((error ( 1 , 0, dcgettext (((void *)0), "--data needs at least one argument" , 5) ), (( 0 ) ? (void) 0 : __builtin_unreachable ())))); Executed by:
| 1 | ||||||||||||
353 | dcgettext (((void *)0), executed 1 time by 1 test: ((!!sizeof (struct { _Static_assert ( 1 , "verify_expr (" "1" ", " "(error (1, 0, dcgettext (((void *)0), \"--data needs at least one argument\", 5)), assume (false))" ")"); int _gl_dummy; })) ? ((error ( 1 , 0, dcgettext (((void *)0), "--data needs at least one argument" , 5) ), (( 0 ) ? (void) 0 : __builtin_unreachable ()))) : ((error ( 1 , 0, dcgettext (((void *)0), "--data needs at least one argument" , 5) ), (( 0 ) ? (void) 0 : __builtin_unreachable ())))); Executed by:
| 1 | ||||||||||||
354 | "--data needs at least one argument" executed 1 time by 1 test: ((!!sizeof (struct { _Static_assert ( 1 , "verify_expr (" "1" ", " "(error (1, 0, dcgettext (((void *)0), \"--data needs at least one argument\", 5)), assume (false))" ")"); int _gl_dummy; })) ? ((error ( 1 , 0, dcgettext (((void *)0), "--data needs at least one argument" , 5) ), (( 0 ) ? (void) 0 : __builtin_unreachable ()))) : ((error ( 1 , 0, dcgettext (((void *)0), "--data needs at least one argument" , 5) ), (( 0 ) ? (void) 0 : __builtin_unreachable ())))); Executed by:
| 1 | ||||||||||||
355 | , 5) executed 1 time by 1 test: ((!!sizeof (struct { _Static_assert ( 1 , "verify_expr (" "1" ", " "(error (1, 0, dcgettext (((void *)0), \"--data needs at least one argument\", 5)), assume (false))" ")"); int _gl_dummy; })) ? ((error ( 1 , 0, dcgettext (((void *)0), "--data needs at least one argument" , 5) ), (( 0 ) ? (void) 0 : __builtin_unreachable ()))) : ((error ( 1 , 0, dcgettext (((void *)0), "--data needs at least one argument" , 5) ), (( 0 ) ? (void) 0 : __builtin_unreachable ())))); Executed by:
| 1 | ||||||||||||
356 | ), (( executed 1 time by 1 test: ((!!sizeof (struct { _Static_assert ( 1 , "verify_expr (" "1" ", " "(error (1, 0, dcgettext (((void *)0), \"--data needs at least one argument\", 5)), assume (false))" ")"); int _gl_dummy; })) ? ((error ( 1 , 0, dcgettext (((void *)0), "--data needs at least one argument" , 5) ), (( 0 ) ? (void) 0 : __builtin_unreachable ()))) : ((error ( 1 , 0, dcgettext (((void *)0), "--data needs at least one argument" , 5) ), (( 0 ) ? (void) 0 : __builtin_unreachable ())))); Executed by:
| 1 | ||||||||||||
357 | 0 executed 1 time by 1 test: ((!!sizeof (struct { _Static_assert ( 1 , "verify_expr (" "1" ", " "(error (1, 0, dcgettext (((void *)0), \"--data needs at least one argument\", 5)), assume (false))" ")"); int _gl_dummy; })) ? ((error ( 1 , 0, dcgettext (((void *)0), "--data needs at least one argument" , 5) ), (( 0 ) ? (void) 0 : __builtin_unreachable ()))) : ((error ( 1 , 0, dcgettext (((void *)0), "--data needs at least one argument" , 5) ), (( 0 ) ? (void) 0 : __builtin_unreachable ())))); Executed by:
| 1 | ||||||||||||
358 | ) ? (void) 0 : __builtin_unreachable ()))) : ((error ( executed 1 time by 1 test: ((!!sizeof (struct { _Static_assert ( 1 , "verify_expr (" "1" ", " "(error (1, 0, dcgettext (((void *)0), \"--data needs at least one argument\", 5)), assume (false))" ")"); int _gl_dummy; })) ? ((error ( 1 , 0, dcgettext (((void *)0), "--data needs at least one argument" , 5) ), (( 0 ) ? (void) 0 : __builtin_unreachable ()))) : ((error ( 1 , 0, dcgettext (((void *)0), "--data needs at least one argument" , 5) ), (( 0 ) ? (void) 0 : __builtin_unreachable ())))); Executed by:
| 1 | ||||||||||||
359 | 1 executed 1 time by 1 test: ((!!sizeof (struct { _Static_assert ( 1 , "verify_expr (" "1" ", " "(error (1, 0, dcgettext (((void *)0), \"--data needs at least one argument\", 5)), assume (false))" ")"); int _gl_dummy; })) ? ((error ( 1 , 0, dcgettext (((void *)0), "--data needs at least one argument" , 5) ), (( 0 ) ? (void) 0 : __builtin_unreachable ()))) : ((error ( 1 , 0, dcgettext (((void *)0), "--data needs at least one argument" , 5) ), (( 0 ) ? (void) 0 : __builtin_unreachable ())))); Executed by:
| 1 | ||||||||||||
360 | , 0, executed 1 time by 1 test: ((!!sizeof (struct { _Static_assert ( 1 , "verify_expr (" "1" ", " "(error (1, 0, dcgettext (((void *)0), \"--data needs at least one argument\", 5)), assume (false))" ")"); int _gl_dummy; })) ? ((error ( 1 , 0, dcgettext (((void *)0), "--data needs at least one argument" , 5) ), (( 0 ) ? (void) 0 : __builtin_unreachable ()))) : ((error ( 1 , 0, dcgettext (((void *)0), "--data needs at least one argument" , 5) ), (( 0 ) ? (void) 0 : __builtin_unreachable ())))); Executed by:
| 1 | ||||||||||||
361 | dcgettext (((void *)0), executed 1 time by 1 test: ((!!sizeof (struct { _Static_assert ( 1 , "verify_expr (" "1" ", " "(error (1, 0, dcgettext (((void *)0), \"--data needs at least one argument\", 5)), assume (false))" ")"); int _gl_dummy; })) ? ((error ( 1 , 0, dcgettext (((void *)0), "--data needs at least one argument" , 5) ), (( 0 ) ? (void) 0 : __builtin_unreachable ()))) : ((error ( 1 , 0, dcgettext (((void *)0), "--data needs at least one argument" , 5) ), (( 0 ) ? (void) 0 : __builtin_unreachable ())))); Executed by:
| 1 | ||||||||||||
362 | "--data needs at least one argument" executed 1 time by 1 test: ((!!sizeof (struct { _Static_assert ( 1 , "verify_expr (" "1" ", " "(error (1, 0, dcgettext (((void *)0), \"--data needs at least one argument\", 5)), assume (false))" ")"); int _gl_dummy; })) ? ((error ( 1 , 0, dcgettext (((void *)0), "--data needs at least one argument" , 5) ), (( 0 ) ? (void) 0 : __builtin_unreachable ()))) : ((error ( 1 , 0, dcgettext (((void *)0), "--data needs at least one argument" , 5) ), (( 0 ) ? (void) 0 : __builtin_unreachable ())))); Executed by:
| 1 | ||||||||||||
363 | , 5) executed 1 time by 1 test: ((!!sizeof (struct { _Static_assert ( 1 , "verify_expr (" "1" ", " "(error (1, 0, dcgettext (((void *)0), \"--data needs at least one argument\", 5)), assume (false))" ")"); int _gl_dummy; })) ? ((error ( 1 , 0, dcgettext (((void *)0), "--data needs at least one argument" , 5) ), (( 0 ) ? (void) 0 : __builtin_unreachable ()))) : ((error ( 1 , 0, dcgettext (((void *)0), "--data needs at least one argument" , 5) ), (( 0 ) ? (void) 0 : __builtin_unreachable ())))); Executed by:
| 1 | ||||||||||||
364 | ), (( executed 1 time by 1 test: ((!!sizeof (struct { _Static_assert ( 1 , "verify_expr (" "1" ", " "(error (1, 0, dcgettext (((void *)0), \"--data needs at least one argument\", 5)), assume (false))" ")"); int _gl_dummy; })) ? ((error ( 1 , 0, dcgettext (((void *)0), "--data needs at least one argument" , 5) ), (( 0 ) ? (void) 0 : __builtin_unreachable ()))) : ((error ( 1 , 0, dcgettext (((void *)0), "--data needs at least one argument" , 5) ), (( 0 ) ? (void) 0 : __builtin_unreachable ())))); Executed by:
| 1 | ||||||||||||
365 | 0 executed 1 time by 1 test: ((!!sizeof (struct { _Static_assert ( 1 , "verify_expr (" "1" ", " "(error (1, 0, dcgettext (((void *)0), \"--data needs at least one argument\", 5)), assume (false))" ")"); int _gl_dummy; })) ? ((error ( 1 , 0, dcgettext (((void *)0), "--data needs at least one argument" , 5) ), (( 0 ) ? (void) 0 : __builtin_unreachable ()))) : ((error ( 1 , 0, dcgettext (((void *)0), "--data needs at least one argument" , 5) ), (( 0 ) ? (void) 0 : __builtin_unreachable ())))); Executed by:
| 1 | ||||||||||||
366 | ) ? (void) 0 : __builtin_unreachable ())))); executed 1 time by 1 test: ((!!sizeof (struct { _Static_assert ( 1 , "verify_expr (" "1" ", " "(error (1, 0, dcgettext (((void *)0), \"--data needs at least one argument\", 5)), assume (false))" ")"); int _gl_dummy; })) ? ((error ( 1 , 0, dcgettext (((void *)0), "--data needs at least one argument" , 5) ), (( 0 ) ? (void) 0 : __builtin_unreachable ()))) : ((error ( 1 , 0, dcgettext (((void *)0), "--data needs at least one argument" , 5) ), (( 0 ) ? (void) 0 : __builtin_unreachable ())))); Executed by:
| 1 | ||||||||||||
367 | - | |||||||||||||
368 | if (! args_specified
| 0-5 | ||||||||||||
369 | mode = MODE_SYNC; never executed: mode = MODE_SYNC; | 0 | ||||||||||||
370 | else if (arg_file_system
| 0-5 | ||||||||||||
371 | mode = MODE_FILE_SYSTEM; never executed: mode = MODE_FILE_SYSTEM; | 0 | ||||||||||||
372 | else if (! arg_data
| 0-5 | ||||||||||||
373 | mode = MODE_FILE; executed 5 times by 1 test: mode = MODE_FILE; Executed by:
| 5 | ||||||||||||
374 | else | - | ||||||||||||
375 | mode = MODE_DATA; never executed: mode = MODE_DATA; | 0 | ||||||||||||
376 | - | |||||||||||||
377 | if (mode == MODE_SYNC
| 0-5 | ||||||||||||
378 | sync (); never executed: sync (); | 0 | ||||||||||||
379 | else | - | ||||||||||||
380 | { | - | ||||||||||||
381 | for (; optind < argc
| 5-6 | ||||||||||||
382 | ok &= sync_arg (mode, argv[optind]); executed 6 times by 1 test: ok &= sync_arg (mode, argv[optind]); Executed by:
| 6 | ||||||||||||
383 | } executed 5 times by 1 test: end of block Executed by:
| 5 | ||||||||||||
384 | - | |||||||||||||
385 | return executed 5 times by 1 test: ok ? return ok ? 0 : 1 ; Executed by:
executed 5 times by 1 test: return ok ? 0 : 1 ; Executed by:
| 5 | ||||||||||||
386 | 0 executed 5 times by 1 test: return ok ? 0 : 1 ; Executed by:
| 5 | ||||||||||||
387 | : executed 5 times by 1 test: return ok ? 0 : 1 ; Executed by:
| 5 | ||||||||||||
388 | 1 executed 5 times by 1 test: return ok ? 0 : 1 ; Executed by:
| 5 | ||||||||||||
389 | ; executed 5 times by 1 test: return ok ? 0 : 1 ; Executed by:
| 5 | ||||||||||||
390 | } | - | ||||||||||||
Switch to Source code | Preprocessed file |