| 59 | |
| 60 | |
| 61 | int main(int argc, char *argv[]) |
| 62 | { |
| 63 | int pid= 0, t= 0, sig= 0; |
| 64 | |
| 65 | progname= argv[0]; |
| 66 | |
| 67 | fprintf(stderr, |
| 68 | "Warning: %s is deprecated and will be removed in a future version.\n", |
| 69 | progname); |
| 70 | |
| 71 | if (handle_options(&argc, &argv, my_long_options, get_one_option)) |
| 72 | exit(-1); |
| 73 | if (!argv[0] || !argv[1] || (pid= atoi(argv[0])) <= 0 || |
| 74 | (t= atoi(argv[1])) <= 0) |
| 75 | usage(); |
| 76 | for (; t > 0; t--) |
| 77 | { |
| 78 | if (kill((pid_t) pid, sig)) |
| 79 | { |
| 80 | if (errno == EINVAL) |
| 81 | { |
| 82 | if (verbose) |
| 83 | printf("WARNING: kill couldn't handle signal 0, using signal 1.\n"); |
| 84 | sig= 1; |
| 85 | t++; |
| 86 | continue; |
| 87 | } |
| 88 | return 0; |
| 89 | } |
| 90 | sleep(1); |
| 91 | } |
| 92 | return 1; |
| 93 | } |
| 94 | |
| 95 | void usage(void) |
| 96 | { |
nothing calls this directly
no test coverage detected