MCPcopy Create free account
hub / github.com/coreutils/coreutils / main

Function main

src/timeout.c:507–691  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

505}
506
507int
508main (int argc, char **argv)
509{
510 double timeout;
511 int c;
512
513 initialize_main (&argc, &argv);
514 set_program_name (argv[0]);
515 setlocale (LC_ALL, "");
516 bindtextdomain (PACKAGE, LOCALEDIR);
517 textdomain (PACKAGE);
518
519 initialize_exit_failure (EXIT_CANCELED);
520 atexit (close_stdout);
521
522 while ((c = getopt_long (argc, argv, "+fk:ps:v", long_options, NULL))
523 != -1)
524 {
525 switch (c)
526 {
527 case 'f':
528 foreground = true;
529 break;
530
531 case 'k':
532 kill_after = parse_duration (optarg);
533 break;
534
535 case 'p':
536 preserve_status = true;
537 break;
538
539 case 's':
540 term_signal = operand2sig (optarg);
541 if (term_signal == -1)
542 usage (EXIT_CANCELED);
543 break;
544
545 case 'v':
546 verbose = true;
547 break;
548
549 case_GETOPT_HELP_CHAR;
550
551 case_GETOPT_VERSION_CHAR (PROGRAM_NAME, AUTHORS);
552
553 default:
554 usage (EXIT_CANCELED);
555 break;
556 }
557 }
558
559 if (argc - optind < 2)
560 usage (EXIT_CANCELED);
561
562 timeout = parse_duration (argv[optind++]);
563
564 argv += optind;

Callers

nothing calls this directly

Calls 10

initialize_exit_failureFunction · 0.85
parse_durationFunction · 0.85
operand2sigFunction · 0.85
install_cleanupFunction · 0.85
install_sigchldFunction · 0.85
unblock_signalFunction · 0.85
block_cleanup_and_chldFunction · 0.85
settimeoutFunction · 0.85
disable_core_dumpsFunction · 0.85
usageFunction · 0.70

Tested by

no test coverage detected