Line | Source | Count |
1 | | - |
2 | | - |
3 | | - |
4 | | - |
5 | | - |
6 | | - |
7 | | - |
8 | | - |
9 | | - |
10 | | - |
11 | | - |
12 | | - |
13 | | - |
14 | | - |
15 | | - |
16 | | - |
17 | | - |
18 | | - |
19 | | - |
20 | | - |
21 | | - |
22 | | - |
23 | extern void initialize_siglist (); | - |
24 | | - |
25 | | - |
26 | | - |
27 | | - |
28 | | - |
29 | | - |
30 | volatile sig_atomic_t interrupt_state = 0; | - |
31 | | - |
32 | | - |
33 | volatile sig_atomic_t sigwinch_received = 0; | - |
34 | | - |
35 | | - |
36 | volatile sig_atomic_t sigterm_received = 0; | - |
37 | | - |
38 | | - |
39 | volatile sig_atomic_t terminating_signal = 0; | - |
40 | | - |
41 | | - |
42 | | - |
43 | sigjmp_buf top_level; | - |
44 | | - |
45 | | - |
46 | | - |
47 | sigset_t top_level_mask; | - |
48 | | - |
49 | | - |
50 | | - |
51 | int interrupt_immediately = 0; | - |
52 | | - |
53 | | - |
54 | int terminate_immediately = 0; | - |
55 | | - |
56 | | - |
57 | static SigHandler *old_winch = (SigHandler *) | - |
58 | ((__sighandler_t) 0) | - |
59 | ; | - |
60 | | - |
61 | | - |
62 | static void initialize_shell_signals (void); | - |
63 | | - |
64 | void | - |
65 | initialize_signals (reinit) | - |
66 | int reinit; | - |
67 | { | - |
68 | initialize_shell_signals (); | - |
69 | initialize_job_signals (); | - |
70 | | - |
71 | | - |
72 | | - |
73 | | - |
74 | }executed 5448 times by 1 test: end of block | 5448 |
75 | | - |
76 | | - |
77 | | - |
78 | | - |
79 | struct termsig { | - |
80 | int signum; | - |
81 | SigHandler *orig_handler; | - |
82 | int orig_flags; | - |
83 | }; | - |
84 | | - |
85 | | - |
86 | | - |
87 | | - |
88 | | - |
89 | | - |
90 | static struct termsig terminating_signals[] = { | - |
91 | | - |
92 | { | - |
93 | 1 | - |
94 | , (SigHandler *) | - |
95 | ((__sighandler_t) 0) | - |
96 | , 0 }, | - |
97 | | - |
98 | | - |
99 | | - |
100 | { | - |
101 | 2 | - |
102 | , (SigHandler *) | - |
103 | ((__sighandler_t) 0) | - |
104 | , 0 }, | - |
105 | | - |
106 | | - |
107 | | - |
108 | { | - |
109 | 4 | - |
110 | , (SigHandler *) | - |
111 | ((__sighandler_t) 0) | - |
112 | , 0 }, | - |
113 | | - |
114 | | - |
115 | | - |
116 | { | - |
117 | 5 | - |
118 | , (SigHandler *) | - |
119 | ((__sighandler_t) 0) | - |
120 | , 0 }, | - |
121 | | - |
122 | | - |
123 | | - |
124 | { | - |
125 | 6 | - |
126 | , (SigHandler *) | - |
127 | ((__sighandler_t) 0) | - |
128 | , 0 }, | - |
129 | { | - |
130 | 8 | - |
131 | , (SigHandler *) | - |
132 | ((__sighandler_t) 0) | - |
133 | , 0 }, | - |
134 | | - |
135 | | - |
136 | | - |
137 | { | - |
138 | 7 | - |
139 | , (SigHandler *) | - |
140 | ((__sighandler_t) 0) | - |
141 | , 0 }, | - |
142 | | - |
143 | | - |
144 | | - |
145 | { | - |
146 | 11 | - |
147 | , (SigHandler *) | - |
148 | ((__sighandler_t) 0) | - |
149 | , 0 }, | - |
150 | | - |
151 | | - |
152 | | - |
153 | { | - |
154 | 31 | - |
155 | , (SigHandler *) | - |
156 | ((__sighandler_t) 0) | - |
157 | , 0 }, | - |
158 | | - |
159 | | - |
160 | | - |
161 | { | - |
162 | 13 | - |
163 | , (SigHandler *) | - |
164 | ((__sighandler_t) 0) | - |
165 | , 0 }, | - |
166 | | - |
167 | | - |
168 | | - |
169 | { | - |
170 | 14 | - |
171 | , (SigHandler *) | - |
172 | ((__sighandler_t) 0) | - |
173 | , 0 }, | - |
174 | | - |
175 | | - |
176 | | - |
177 | { | - |
178 | 15 | - |
179 | , (SigHandler *) | - |
180 | ((__sighandler_t) 0) | - |
181 | , 0 }, | - |
182 | | - |
183 | | - |
184 | | - |
185 | { | - |
186 | 24 | - |
187 | , (SigHandler *) | - |
188 | ((__sighandler_t) 0) | - |
189 | , 0 }, | - |
190 | | - |
191 | | - |
192 | | - |
193 | { | - |
194 | 25 | - |
195 | , (SigHandler *) | - |
196 | ((__sighandler_t) 0) | - |
197 | , 0 }, | - |
198 | | - |
199 | | - |
200 | | - |
201 | { | - |
202 | 26 | - |
203 | , (SigHandler *) | - |
204 | ((__sighandler_t) 0) | - |
205 | , 0 }, | - |
206 | { | - |
207 | 10 | - |
208 | , (SigHandler *) | - |
209 | ((__sighandler_t) 0) | - |
210 | , 0 }, | - |
211 | | - |
212 | | - |
213 | | - |
214 | { | - |
215 | 12 | - |
216 | , (SigHandler *) | - |
217 | ((__sighandler_t) 0) | - |
218 | , 0 }, | - |
219 | | - |
220 | }; | - |
221 | | - |
222 | | - |
223 | | - |
224 | | - |
225 | | - |
226 | | - |
227 | | - |
228 | static int termsigs_initialized = 0; | - |
229 | | - |
230 | | - |
231 | | - |
232 | | - |
233 | | - |
234 | void | - |
235 | initialize_terminating_signals () | - |
236 | { | - |
237 | register int i; | - |
238 | | - |
239 | struct sigaction act, oact; | - |
240 | | - |
241 | | - |
242 | if (termsigs_initializedTRUE | evaluated 39 times by 1 test | FALSE | evaluated 81 times by 1 test |
) | 39-81 |
243 | return;executed 39 times by 1 test: return; | 39 |
244 | | - |
245 | | - |
246 | | - |
247 | | - |
248 | | - |
249 | | - |
250 | act. | - |
251 | __sigaction_handler.sa_handler | - |
252 | = termsig_sighandler; | - |
253 | act.sa_flags = 0; | - |
254 | sigemptyset (&act.sa_mask); | - |
255 | sigemptyset (&oact.sa_mask); | - |
256 | for (i = 0; i < (sizeof (terminating_signals) / sizeof (struct termsig))TRUE | evaluated 1377 times by 1 test | FALSE | evaluated 81 times by 1 test |
; i++) | 81-1377 |
257 | sigaddset (&act.sa_mask, (terminating_signals[i].signum));executed 1377 times by 1 test: sigaddset (&act.sa_mask, (terminating_signals[i].signum)); | 1377 |
258 | for (i = 0; i < (sizeof (terminating_signals) / sizeof (struct termsig))TRUE | evaluated 1377 times by 1 test | FALSE | evaluated 81 times by 1 test |
; i++) | 81-1377 |
259 | { | - |
260 | | - |
261 | if (signal_is_trapped ((terminating_signals[i].signum))TRUE | evaluated 8 times by 1 test | FALSE | evaluated 1369 times by 1 test |
) | 8-1369 |
262 | continue;executed 8 times by 1 test: continue; | 8 |
263 | | - |
264 | sigaction ((terminating_signals[i].signum), &act, &oact); | - |
265 | (terminating_signals[i].orig_handler) = oact. | - |
266 | __sigaction_handler.sa_handler | - |
267 | ; | - |
268 | (terminating_signals[i].orig_flags) = oact.sa_flags; | - |
269 | | - |
270 | | - |
271 | | - |
272 | if (interactive_shell == 0TRUE | evaluated 1335 times by 1 test | FALSE | evaluated 34 times by 1 test |
&& (TRUE | evaluated 81 times by 1 test | FALSE | evaluated 1254 times by 1 test |
terminating_signals[i].orig_handler) == TRUE | evaluated 81 times by 1 test | FALSE | evaluated 1254 times by 1 test |
| 34-1335 |
273 | ((__sighandler_t) 1)TRUE | evaluated 81 times by 1 test | FALSE | evaluated 1254 times by 1 test |
| 81-1254 |
274 | ) | - |
275 | { | - |
276 | sigaction ((terminating_signals[i].signum), &oact, &act); | - |
277 | set_signal_hard_ignored ((terminating_signals[i].signum)); | - |
278 | }executed 81 times by 1 test: end of block | 81 |
279 | | - |
280 | if ((TRUE | never evaluated | FALSE | evaluated 1369 times by 1 test |
terminating_signals[i].signum) == TRUE | never evaluated | FALSE | evaluated 1369 times by 1 test |
| 0-1369 |
281 | 27TRUE | never evaluated | FALSE | evaluated 1369 times by 1 test |
| 0-1369 |
282 | && (TRUE | never evaluated | FALSE | never evaluated |
terminating_signals[i].orig_handler) != TRUE | never evaluated | FALSE | never evaluated |
| 0 |
283 | ((__sighandler_t) 0)TRUE | never evaluated | FALSE | never evaluated |
| 0 |
284 | && (TRUE | never evaluated | FALSE | never evaluated |
terminating_signals[i].orig_handler) != TRUE | never evaluated | FALSE | never evaluated |
| 0 |
285 | ((__sighandler_t) 1)TRUE | never evaluated | FALSE | never evaluated |
| 0 |
286 | ) | - |
287 | sigaction ((terminating_signals[i].signum), &oact, (struct sigaction *) never executed: sigaction ((terminating_signals[i].signum), &oact, (struct sigaction *) ((void *)0) ); | 0 |
288 | ((void *)0) never executed: sigaction ((terminating_signals[i].signum), &oact, (struct sigaction *) ((void *)0) ); | 0 |
289 | ); never executed: sigaction ((terminating_signals[i].signum), &oact, (struct sigaction *) ((void *)0) ); | 0 |
290 | | - |
291 | }executed 1369 times by 1 test: end of block | 1369 |
292 | termsigs_initialized = 1; | - |
293 | }executed 81 times by 1 test: end of block | 81 |
294 | | - |
295 | static void | - |
296 | initialize_shell_signals () | - |
297 | { | - |
298 | if (interactiveTRUE | evaluated 2 times by 1 test | FALSE | evaluated 5446 times by 1 test |
) | 2-5446 |
299 | initialize_terminating_signals ();executed 2 times by 1 test: initialize_terminating_signals (); | 2 |
300 | | - |
301 | | - |
302 | | - |
303 | | - |
304 | sigemptyset (&top_level_mask); | - |
305 | sigprocmask ( | - |
306 | 0 | - |
307 | , (sigset_t *) | - |
308 | ((void *)0) | - |
309 | , &top_level_mask); | - |
310 | | - |
311 | sigdelset (&top_level_mask, | - |
312 | 17 | - |
313 | ); | - |
314 | | - |
315 | | - |
316 | | - |
317 | | - |
318 | set_signal_handler ( | - |
319 | 3 | - |
320 | , | - |
321 | ((__sighandler_t) 1) | - |
322 | ); | - |
323 | | - |
324 | if (interactiveTRUE | evaluated 2 times by 1 test | FALSE | evaluated 5446 times by 1 test |
) | 2-5446 |
325 | { | - |
326 | set_signal_handler ( | - |
327 | 2 | - |
328 | , sigint_sighandler); | - |
329 | get_original_signal ( | - |
330 | 15 | - |
331 | ); | - |
332 | if (signal_is_hard_ignored (TRUE | evaluated 2 times by 1 test | FALSE | never evaluated |
| 0-2 |
333 | 15TRUE | evaluated 2 times by 1 test | FALSE | never evaluated |
| 0-2 |
334 | ) == 0TRUE | evaluated 2 times by 1 test | FALSE | never evaluated |
) | 0-2 |
335 | set_signal_handler (executed 2 times by 1 test: set_signal_handler ( 15 , sigterm_sighandler); | 2 |
336 | 15executed 2 times by 1 test: set_signal_handler ( 15 , sigterm_sighandler); | 2 |
337 | , sigterm_sighandler);executed 2 times by 1 test: set_signal_handler ( 15 , sigterm_sighandler); | 2 |
338 | set_sigwinch_handler (); | - |
339 | }executed 2 times by 1 test: end of block | 2 |
340 | }executed 5448 times by 1 test: end of block | 5448 |
341 | | - |
342 | void | - |
343 | reset_terminating_signals () | - |
344 | { | - |
345 | register int i; | - |
346 | | - |
347 | struct sigaction act; | - |
348 | | - |
349 | | - |
350 | if (termsigs_initialized == 0TRUE | evaluated 2531 times by 1 test | FALSE | evaluated 26 times by 1 test |
) | 26-2531 |
351 | return;executed 2531 times by 1 test: return; | 2531 |
352 | | - |
353 | | - |
354 | act.sa_flags = 0; | - |
355 | sigemptyset (&act.sa_mask); | - |
356 | for (i = 0; i < (sizeof (terminating_signals) / sizeof (struct termsig))TRUE | evaluated 442 times by 1 test | FALSE | evaluated 26 times by 1 test |
; i++) | 26-442 |
357 | { | - |
358 | | - |
359 | | - |
360 | if (signal_is_trapped ((terminating_signals[i].signum))TRUE | evaluated 29 times by 1 test | FALSE | evaluated 413 times by 1 test |
|| signal_is_special ((terminating_signals[i].signum))TRUE | evaluated 19 times by 1 test | FALSE | evaluated 394 times by 1 test |
) | 19-413 |
361 | continue;executed 48 times by 1 test: continue; | 48 |
362 | | - |
363 | act. | - |
364 | __sigaction_handler.sa_handler | - |
365 | = (terminating_signals[i].orig_handler); | - |
366 | act.sa_flags = (terminating_signals[i].orig_flags); | - |
367 | sigaction ((terminating_signals[i].signum), &act, (struct sigaction *) | - |
368 | ((void *)0) | - |
369 | ); | - |
370 | }executed 394 times by 1 test: end of block | 394 |
371 | termsigs_initialized = 0; | - |
372 | }executed 26 times by 1 test: end of block | 26 |
373 | | - |
374 | | - |
375 | | - |
376 | | - |
377 | | - |
378 | | - |
379 | void | - |
380 | top_level_cleanup () | - |
381 | { | - |
382 | | - |
383 | while (parse_and_execute_levelTRUE | never evaluated | FALSE | evaluated 388 times by 1 test |
) | 0-388 |
384 | parse_and_execute_cleanup (); never executed: parse_and_execute_cleanup (); | 0 |
385 | | - |
386 | | - |
387 | unlink_fifo_list (); | - |
388 | | - |
389 | | - |
390 | run_unwind_protects (); | - |
391 | loop_level = continuing = breaking = funcnest = 0; | - |
392 | executing_list = comsub_ignore_return = return_catch_flag = wait_intr_flag = 0; | - |
393 | }executed 388 times by 1 test: end of block | 388 |
394 | | - |
395 | | - |
396 | void | - |
397 | throw_to_top_level () | - |
398 | { | - |
399 | int print_newline = 0; | - |
400 | | - |
401 | if (interrupt_stateTRUE | never evaluated | FALSE | evaluated 1 time by 1 test |
) | 0-1 |
402 | { | - |
403 | if (last_command_exit_value < 128TRUE | never evaluated | FALSE | never evaluated |
) | 0 |
404 | last_command_exit_value = 128 + never executed: last_command_exit_value = 128 + 2 ; | 0 |
405 | 2 never executed: last_command_exit_value = 128 + 2 ; | 0 |
406 | ; never executed: last_command_exit_value = 128 + 2 ; | 0 |
407 | print_newline = 1; | - |
408 | interrupt_state--; | - |
409 | } never executed: end of block | 0 |
410 | | - |
411 | if (interrupt_stateTRUE | never evaluated | FALSE | evaluated 1 time by 1 test |
) | 0-1 |
412 | return; never executed: return; | 0 |
413 | | - |
414 | last_command_exit_signal = (TRUE | never evaluated | FALSE | evaluated 1 time by 1 test |
last_command_exit_value > 128)TRUE | never evaluated | FALSE | evaluated 1 time by 1 test |
? | 0-1 |
415 | (last_command_exit_value - 128) : 0; | - |
416 | last_command_exit_value |= 128; | - |
417 | | - |
418 | | - |
419 | if (signal_is_trapped (TRUE | never evaluated | FALSE | evaluated 1 time by 1 test |
| 0-1 |
420 | 2TRUE | never evaluated | FALSE | evaluated 1 time by 1 test |
| 0-1 |
421 | )TRUE | never evaluated | FALSE | evaluated 1 time by 1 test |
) | 0-1 |
422 | run_interrupt_trap (1); never executed: run_interrupt_trap (1); | 0 |
423 | | - |
424 | | - |
425 | while (parse_and_execute_levelTRUE | never evaluated | FALSE | evaluated 1 time by 1 test |
) | 0-1 |
426 | parse_and_execute_cleanup (); never executed: parse_and_execute_cleanup (); | 0 |
427 | | - |
428 | if (running_trap > 0TRUE | never evaluated | FALSE | evaluated 1 time by 1 test |
) | 0-1 |
429 | run_trap_cleanup (running_trap - 1); never executed: run_trap_cleanup (running_trap - 1); | 0 |
430 | | - |
431 | | - |
432 | give_terminal_to (shell_pgrp, 0); | - |
433 | | - |
434 | | - |
435 | | - |
436 | | - |
437 | | - |
438 | sigprocmask ( | - |
439 | 2 | - |
440 | , &top_level_mask, (sigset_t *) | - |
441 | ((void *)0) | - |
442 | ); | - |
443 | | - |
444 | | - |
445 | reset_parser (); | - |
446 | | - |
447 | | - |
448 | if (interactiveTRUE | never evaluated | FALSE | evaluated 1 time by 1 test |
) | 0-1 |
449 | bashline_reset (); never executed: bashline_reset (); | 0 |
450 | | - |
451 | | - |
452 | | - |
453 | unlink_fifo_list (); | - |
454 | | - |
455 | | - |
456 | run_unwind_protects (); | - |
457 | loop_level = continuing = breaking = funcnest = 0; | - |
458 | executing_list = comsub_ignore_return = return_catch_flag = wait_intr_flag = 0; | - |
459 | | - |
460 | if (interactiveTRUE | never evaluated | FALSE | evaluated 1 time by 1 test |
&& print_newlineTRUE | never evaluated | FALSE | never evaluated |
) | 0-1 |
461 | { | - |
462 | fflush ( | - |
463 | stdout | - |
464 | ); | - |
465 | fprintf ( | - |
466 | stderr | - |
467 | , "\n"); | - |
468 | fflush ( | - |
469 | stderr | - |
470 | ); | - |
471 | } never executed: end of block | 0 |
472 | | - |
473 | | - |
474 | if (interactiveTRUE | never evaluated | FALSE | evaluated 1 time by 1 test |
|| (interactive_shellTRUE | never evaluated | FALSE | evaluated 1 time by 1 test |
&& !shell_initializedTRUE | never evaluated | FALSE | never evaluated |
) || | 0-1 |
475 | (print_newlineTRUE | never evaluated | FALSE | evaluated 1 time by 1 test |
&& signal_is_trapped (TRUE | never evaluated | FALSE | never evaluated |
| 0-1 |
476 | 2TRUE | never evaluated | FALSE | never evaluated |
| 0 |
477 | )TRUE | never evaluated | FALSE | never evaluated |
)) | 0 |
478 | jump_to_top_level (2); never executed: jump_to_top_level (2); | 0 |
479 | else | - |
480 | jump_to_top_level (3);executed 1 time by 1 test: jump_to_top_level (3); | 1 |
481 | } | - |
482 | | - |
483 | | - |
484 | void | - |
485 | jump_to_top_level (value) | - |
486 | int value; | - |
487 | { | - |
488 | siglongjmp((top_level), (value)); | - |
489 | } never executed: end of block | 0 |
490 | | - |
491 | void | - |
492 | termsig_sighandler (sig) | - |
493 | int sig; | - |
494 | { | - |
495 | | - |
496 | | - |
497 | if ( | - |
498 | | - |
499 | sig != TRUE | never evaluated | FALSE | never evaluated |
| 0 |
500 | 1TRUE | never evaluated | FALSE | never evaluated |
| 0 |
501 | && | - |
502 | | - |
503 | | - |
504 | sig != TRUE | never evaluated | FALSE | never evaluated |
| 0 |
505 | 2TRUE | never evaluated | FALSE | never evaluated |
| 0 |
506 | && | - |
507 | | - |
508 | | - |
509 | | - |
510 | | - |
511 | | - |
512 | sig != TRUE | never evaluated | FALSE | never evaluated |
| 0 |
513 | 13TRUE | never evaluated | FALSE | never evaluated |
| 0 |
514 | && | - |
515 | | - |
516 | | - |
517 | sig != TRUE | never evaluated | FALSE | never evaluated |
| 0 |
518 | 14TRUE | never evaluated | FALSE | never evaluated |
| 0 |
519 | && | - |
520 | | - |
521 | | - |
522 | sig != TRUE | never evaluated | FALSE | never evaluated |
| 0 |
523 | 15TRUE | never evaluated | FALSE | never evaluated |
| 0 |
524 | && | - |
525 | | - |
526 | | - |
527 | sig != TRUE | never evaluated | FALSE | never evaluated |
| 0 |
528 | 24TRUE | never evaluated | FALSE | never evaluated |
| 0 |
529 | && | - |
530 | | - |
531 | | - |
532 | sig != TRUE | never evaluated | FALSE | never evaluated |
| 0 |
533 | 25TRUE | never evaluated | FALSE | never evaluated |
| 0 |
534 | && | - |
535 | | - |
536 | | - |
537 | sig != TRUE | never evaluated | FALSE | never evaluated |
| 0 |
538 | 26TRUE | never evaluated | FALSE | never evaluated |
| 0 |
539 | && | - |
540 | | - |
541 | | - |
542 | | - |
543 | | - |
544 | | - |
545 | sig != TRUE | never evaluated | FALSE | never evaluated |
| 0 |
546 | 10TRUE | never evaluated | FALSE | never evaluated |
| 0 |
547 | && | - |
548 | | - |
549 | | - |
550 | sig != TRUE | never evaluated | FALSE | never evaluated |
| 0 |
551 | 12TRUE | never evaluated | FALSE | never evaluated |
| 0 |
552 | && | - |
553 | | - |
554 | sig == terminating_signalTRUE | never evaluated | FALSE | never evaluated |
) | 0 |
555 | terminate_immediately = 1; never executed: terminate_immediately = 1; | 0 |
556 | | - |
557 | terminating_signal = sig; | - |
558 | | - |
559 | | - |
560 | if (terminate_immediatelyTRUE | never evaluated | FALSE | never evaluated |
) | 0 |
561 | { | - |
562 | | - |
563 | | - |
564 | | - |
565 | if (interactive_shell == 0TRUE | never evaluated | FALSE | never evaluated |
|| interactive == 0TRUE | never evaluated | FALSE | never evaluated |
|| (sig != TRUE | never evaluated | FALSE | never evaluated |
| 0 |
566 | 1TRUE | never evaluated | FALSE | never evaluated |
| 0 |
567 | && sig != TRUE | never evaluated | FALSE | never evaluated |
| 0 |
568 | 15TRUE | never evaluated | FALSE | never evaluated |
| 0 |
569 | ) || no_line_editingTRUE | never evaluated | FALSE | never evaluated |
|| ((TRUE | never evaluated | FALSE | never evaluated |
rl_readline_state & (0x0000008)) == 0)TRUE | never evaluated | FALSE | never evaluated |
) | 0 |
570 | | - |
571 | history_lines_this_session = 0; never executed: history_lines_this_session = 0; | 0 |
572 | | - |
573 | terminate_immediately = 0; | - |
574 | termsig_handler (sig); | - |
575 | } never executed: end of block | 0 |
576 | | - |
577 | | - |
578 | | - |
579 | | - |
580 | | - |
581 | | - |
582 | | - |
583 | if ((TRUE | never evaluated | FALSE | never evaluated |
rl_readline_state & (0x0008000))TRUE | never evaluated | FALSE | never evaluated |
|| (TRUE | never evaluated | FALSE | never evaluated |
rl_readline_state & (0x0000004))TRUE | never evaluated | FALSE | never evaluated |
) | 0 |
584 | bashline_set_event_hook (); never executed: bashline_set_event_hook (); | 0 |
585 | | - |
586 | | - |
587 | return; never executed: return; | 0 |
588 | } | - |
589 | | - |
590 | void | - |
591 | termsig_handler (sig) | - |
592 | int sig; | - |
593 | { | - |
594 | static int handling_termsig = 0; | - |
595 | | - |
596 | | - |
597 | | - |
598 | | - |
599 | if (handling_termsigTRUE | never evaluated | FALSE | never evaluated |
) | 0 |
600 | return; never executed: return; | 0 |
601 | handling_termsig = 1; | - |
602 | terminating_signal = 0; | - |
603 | | - |
604 | | - |
605 | if (sig == TRUE | never evaluated | FALSE | never evaluated |
| 0 |
606 | 2TRUE | never evaluated | FALSE | never evaluated |
| 0 |
607 | && signal_is_trapped (TRUE | never evaluated | FALSE | never evaluated |
| 0 |
608 | 2TRUE | never evaluated | FALSE | never evaluated |
| 0 |
609 | )TRUE | never evaluated | FALSE | never evaluated |
) | 0 |
610 | run_interrupt_trap (0); never executed: run_interrupt_trap (0); | 0 |
611 | | - |
612 | | - |
613 | | - |
614 | | - |
615 | | - |
616 | | - |
617 | if (interactive_shellTRUE | never evaluated | FALSE | never evaluated |
&& interactiveTRUE | never evaluated | FALSE | never evaluated |
&& (sig == TRUE | never evaluated | FALSE | never evaluated |
| 0 |
618 | 1TRUE | never evaluated | FALSE | never evaluated |
| 0 |
619 | || sig == TRUE | never evaluated | FALSE | never evaluated |
| 0 |
620 | 15TRUE | never evaluated | FALSE | never evaluated |
| 0 |
621 | ) && remember_on_historyTRUE | never evaluated | FALSE | never evaluated |
) | 0 |
622 | maybe_save_shell_history (); never executed: maybe_save_shell_history (); | 0 |
623 | | - |
624 | | - |
625 | if (this_shell_builtin == read_builtinTRUE | never evaluated | FALSE | never evaluated |
) | 0 |
626 | read_tty_cleanup (); never executed: read_tty_cleanup (); | 0 |
627 | | - |
628 | | - |
629 | if (sig == TRUE | never evaluated | FALSE | never evaluated |
| 0 |
630 | 1TRUE | never evaluated | FALSE | never evaluated |
| 0 |
631 | && (interactiveTRUE | never evaluated | FALSE | never evaluated |
|| (TRUE | never evaluated | FALSE | never evaluated |
subshell_environment & (0x04|0x20))TRUE | never evaluated | FALSE | never evaluated |
)) | 0 |
632 | hangup_all_jobs (); never executed: hangup_all_jobs (); | 0 |
633 | if ((TRUE | never evaluated | FALSE | never evaluated |
subshell_environment & (0x04|0x20)) == 0TRUE | never evaluated | FALSE | never evaluated |
) | 0 |
634 | end_job_control (); never executed: end_job_control (); | 0 |
635 | | - |
636 | | - |
637 | | - |
638 | unlink_fifo_list (); | - |
639 | | - |
640 | | - |
641 | | - |
642 | loop_level = continuing = breaking = funcnest = 0; | - |
643 | executing_list = comsub_ignore_return = return_catch_flag = wait_intr_flag = 0; | - |
644 | | - |
645 | run_exit_trap (); | - |
646 | set_signal_handler (sig, | - |
647 | ((__sighandler_t) 0) | - |
648 | ); | - |
649 | kill (getpid (), sig); | - |
650 | | - |
651 | exit (1); never executed: exit (1); | 0 |
652 | } | - |
653 | | - |
654 | | - |
655 | void | - |
656 | sigint_sighandler (sig) | - |
657 | int sig; | - |
658 | { | - |
659 | | - |
660 | | - |
661 | | - |
662 | | - |
663 | | - |
664 | | - |
665 | if (interrupt_state == 0TRUE | never evaluated | FALSE | never evaluated |
) | 0 |
666 | interrupt_state++; never executed: interrupt_state++; | 0 |
667 | | - |
668 | | - |
669 | | - |
670 | | - |
671 | if (wait_intr_flagTRUE | never evaluated | FALSE | never evaluated |
) | 0 |
672 | { | - |
673 | last_command_exit_value = 128 + sig; | - |
674 | wait_signal_received = sig; | - |
675 | return; never executed: return; | 0 |
676 | } | - |
677 | | - |
678 | if (interrupt_immediatelyTRUE | never evaluated | FALSE | never evaluated |
) | 0 |
679 | { | - |
680 | interrupt_immediately = 0; | - |
681 | last_command_exit_value = 128 + sig; | - |
682 | throw_to_top_level (); | - |
683 | } never executed: end of block | 0 |
684 | | - |
685 | | - |
686 | | - |
687 | | - |
688 | else if ((TRUE | never evaluated | FALSE | never evaluated |
rl_readline_state & (0x0008000))TRUE | never evaluated | FALSE | never evaluated |
) | 0 |
689 | bashline_set_event_hook (); never executed: bashline_set_event_hook (); | 0 |
690 | | - |
691 | | - |
692 | return; never executed: return; | 0 |
693 | } | - |
694 | | - |
695 | | - |
696 | void | - |
697 | sigwinch_sighandler (sig) | - |
698 | int sig; | - |
699 | { | - |
700 | | - |
701 | | - |
702 | | - |
703 | sigwinch_received = 1; | - |
704 | return; never executed: return; | 0 |
705 | } | - |
706 | | - |
707 | | - |
708 | void | - |
709 | set_sigwinch_handler () | - |
710 | { | - |
711 | | - |
712 | old_winch = set_signal_handler ( | - |
713 | 28 | - |
714 | , sigwinch_sighandler); | - |
715 | | - |
716 | }executed 2 times by 1 test: end of block | 2 |
717 | | - |
718 | void | - |
719 | unset_sigwinch_handler () | - |
720 | { | - |
721 | | - |
722 | set_signal_handler ( | - |
723 | 28 | - |
724 | , old_winch); | - |
725 | | - |
726 | } never executed: end of block | 0 |
727 | | - |
728 | void | - |
729 | sigterm_sighandler (sig) | - |
730 | int sig; | - |
731 | { | - |
732 | sigterm_received = 1; | - |
733 | return; never executed: return; | 0 |
734 | } | - |
735 | SigHandler * | - |
736 | set_signal_handler (sig, handler) | - |
737 | int sig; | - |
738 | SigHandler *handler; | - |
739 | { | - |
740 | struct sigaction act, oact; | - |
741 | | - |
742 | act. | - |
743 | __sigaction_handler.sa_handler | - |
744 | = handler; | - |
745 | act.sa_flags = 0; | - |
746 | | - |
747 | | - |
748 | | - |
749 | | - |
750 | | - |
751 | if (sig == TRUE | evaluated 3960800 times by 1 test | FALSE | evaluated 6696639 times by 1 test |
| 3960800-6696639 |
752 | 17TRUE | evaluated 3960800 times by 1 test | FALSE | evaluated 6696639 times by 1 test |
| 3960800-6696639 |
753 | ) | - |
754 | act.sa_flags |= executed 3960800 times by 1 test: act.sa_flags |= 0x10000000 ; | 3960800 |
755 | 0x10000000executed 3960800 times by 1 test: act.sa_flags |= 0x10000000 ; | 3960800 |
756 | ;executed 3960800 times by 1 test: act.sa_flags |= 0x10000000 ; | 3960800 |
757 | | - |
758 | | - |
759 | | - |
760 | | - |
761 | | - |
762 | if (sig == TRUE | evaluated 24 times by 1 test | FALSE | evaluated 10657415 times by 1 test |
| 24-10657415 |
763 | 28TRUE | evaluated 24 times by 1 test | FALSE | evaluated 10657415 times by 1 test |
| 24-10657415 |
764 | ) | - |
765 | act.sa_flags |= executed 24 times by 1 test: act.sa_flags |= 0x10000000 ; | 24 |
766 | 0x10000000executed 24 times by 1 test: act.sa_flags |= 0x10000000 ; | 24 |
767 | ;executed 24 times by 1 test: act.sa_flags |= 0x10000000 ; | 24 |
768 | | - |
769 | | - |
770 | | - |
771 | if (sig == TRUE | evaluated 67 times by 1 test | FALSE | evaluated 10657372 times by 1 test |
| 67-10657372 |
772 | 15TRUE | evaluated 67 times by 1 test | FALSE | evaluated 10657372 times by 1 test |
| 67-10657372 |
773 | && handler == sigterm_sighandlerTRUE | evaluated 2 times by 1 test | FALSE | evaluated 65 times by 1 test |
) | 2-65 |
774 | act.sa_flags |= executed 2 times by 1 test: act.sa_flags |= 0x10000000 ; | 2 |
775 | 0x10000000executed 2 times by 1 test: act.sa_flags |= 0x10000000 ; | 2 |
776 | ;executed 2 times by 1 test: act.sa_flags |= 0x10000000 ; | 2 |
777 | | - |
778 | sigemptyset (&act.sa_mask); | - |
779 | sigemptyset (&oact.sa_mask); | - |
780 | if (sigaction (sig, &act, &oact) == 0TRUE | evaluated 10657351 times by 1 test | FALSE | evaluated 88 times by 1 test |
) | 88-10657351 |
781 | returnexecuted 10657351 times by 1 test: return (oact. __sigaction_handler.sa_handler ); (oact.executed 10657351 times by 1 test: return (oact. __sigaction_handler.sa_handler ); | 10657351 |
782 | __sigaction_handler.sa_handlerexecuted 10657351 times by 1 test: return (oact. __sigaction_handler.sa_handler ); | 10657351 |
783 | );executed 10657351 times by 1 test: return (oact. __sigaction_handler.sa_handler ); | 10657351 |
784 | else | - |
785 | returnexecuted 88 times by 1 test: return ( ((__sighandler_t) 0) ); (executed 88 times by 1 test: return ( ((__sighandler_t) 0) ); | 88 |
786 | ((__sighandler_t) 0)executed 88 times by 1 test: return ( ((__sighandler_t) 0) ); | 88 |
787 | );executed 88 times by 1 test: return ( ((__sighandler_t) 0) ); | 88 |
788 | } | - |
| | |