skill: use symbolic exit values
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
This commit is contained in:
parent
8b8149ba60
commit
89e1a83c07
12
skill.c
12
skill.c
@ -87,7 +87,7 @@ static void hurt_proc(int tty, int uid, int pid, const char *restrict const cmd,
|
|||||||
(char *)dn_buf, user_from_uid(uid), pid, cmd);
|
(char *)dn_buf, user_from_uid(uid), pid, cmd);
|
||||||
if (!fgets(buf, 7, stdin)) {
|
if (!fgets(buf, 7, stdin)) {
|
||||||
printf("\n");
|
printf("\n");
|
||||||
exit(0);
|
exit(EXIT_FAILURE);
|
||||||
}
|
}
|
||||||
if (*buf != 'y' && *buf != 'Y')
|
if (*buf != 'y' && *buf != 'Y')
|
||||||
return;
|
return;
|
||||||
@ -246,10 +246,8 @@ static void iterate(struct run_time_conf_t *run_time)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
d = opendir("/proc");
|
d = opendir("/proc");
|
||||||
if (!d) {
|
if (!d)
|
||||||
perror("/proc");
|
err(EXIT_FAILURE, "/proc");
|
||||||
exit(1);
|
|
||||||
}
|
|
||||||
while ((de = readdir(d))) {
|
while ((de = readdir(d))) {
|
||||||
if (de->d_name[0] > '9')
|
if (de->d_name[0] > '9')
|
||||||
continue;
|
continue;
|
||||||
@ -657,7 +655,7 @@ int main(int argc, char ** argv)
|
|||||||
fprintf(stderr, _("skill: \"%s\" is not support\n"),
|
fprintf(stderr, _("skill: \"%s\" is not support\n"),
|
||||||
program_invocation_short_name);
|
program_invocation_short_name);
|
||||||
fprintf(stderr, USAGE_MAN_TAIL("skill(1)"));
|
fprintf(stderr, USAGE_MAN_TAIL("skill(1)"));
|
||||||
return 1;
|
return EXIT_FAILURE;
|
||||||
}
|
}
|
||||||
return 0;
|
return EXIT_SUCCESS;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user