mirror of
https://github.com/NikitaIvanovV/ctpv.git
synced 2024-11-24 05:43:08 +01:00
Minor
This commit is contained in:
parent
d09539f627
commit
7919d67e21
@ -5,16 +5,14 @@
|
|||||||
#include <signal.h>
|
#include <signal.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
|
||||||
int main (int argc, char *argv[])
|
int main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
if (argc <= 1) {
|
if (argc <= 1) {
|
||||||
fprintf(stderr, "id not given\n");
|
fprintf(stderr, "id not given\n");
|
||||||
return EXIT_FAILURE;
|
return EXIT_FAILURE;
|
||||||
}
|
}
|
||||||
|
|
||||||
char *pid_s = argv[1];
|
char *endptr, *pid_s = argv[1];
|
||||||
|
|
||||||
char *endptr;
|
|
||||||
|
|
||||||
errno = 0;
|
errno = 0;
|
||||||
long pid = strtol(pid_s, &endptr, 10);
|
long pid = strtol(pid_s, &endptr, 10);
|
||||||
@ -30,7 +28,7 @@ int main (int argc, char *argv[])
|
|||||||
}
|
}
|
||||||
|
|
||||||
while (1) {
|
while (1) {
|
||||||
sleep(5);
|
sleep(1);
|
||||||
|
|
||||||
if (kill(pid, 0) == -1) {
|
if (kill(pid, 0) == -1) {
|
||||||
if (errno != ESRCH) {
|
if (errno != ESRCH) {
|
||||||
|
Loading…
Reference in New Issue
Block a user