| 756 | } |
| 757 | |
| 758 | static char *opt_set_crash_timeout(const char *arg, struct lightningd *ld) |
| 759 | { |
| 760 | struct sigaction act; |
| 761 | u32 time; |
| 762 | char *errstr = opt_set_u32(arg, &time); |
| 763 | if (errstr) |
| 764 | return errstr; |
| 765 | |
| 766 | /* In case we're *REALLY* stuck, use alarm() */ |
| 767 | memset(&act, 0, sizeof(act)); |
| 768 | act.sa_handler = handle_alarm; |
| 769 | act.sa_flags = 0; |
| 770 | |
| 771 | if (sigaction(SIGALRM, &act, NULL) != 0) |
| 772 | err(1, "Setting up SIGARLM handler"); |
| 773 | |
| 774 | alarm(time); |
| 775 | return NULL; |
| 776 | } |
| 777 | |
| 778 | static void dev_register_opts(struct lightningd *ld) |
| 779 | { |
nothing calls this directly
no test coverage detected