{
int signo = -1;
int prino = DEFAULT_NICE;
- int num_found = 0;
int ch, i;
- const char *restrict argptr;
static const struct option longopts[] = {
{"command", required_argument, NULL, 'c'},
{
struct stat sbuf;
char path[32];
- if (!optarg)
- /* Huh? Maybe "skill -t ''". */
- skillsnice_usage(stderr);
snprintf(path, 32, "/dev/%s", optarg);
if (stat(path, &sbuf) >= 0
&& S_ISCHR(sbuf.st_mode)) {
- num_found++;
ENLIST(tty, sbuf.st_rdev);
- if (!NEXTARG)
- break;
- } else if (optarg && !(optarg[1])) {
- /* if only 1 character */
- switch (*optarg) {
- default:
- if (stat(optarg, &sbuf) < 0)
- /* the shell eats '?' */
- break;
- case '-':
- case '?':
- num_found++;
- ENLIST(tty, 0);
- if (!NEXTARG)
- break;
- }
}
}
break;
struct passwd *passwd_data;
passwd_data = getpwnam(optarg);
if (passwd_data) {
- num_found++;
ENLIST(uid, passwd_data->pw_uid);
- if (!NEXTARG)
- break;
}
}
break;