tcsetpgrp(STDIN_FILENO, p);
execvp(a->argv[0], a->argv);
- ERROR("Failed to execute %s\n", a->argv[0]);
+ ERROR("Failed to execute %s: %m\n", a->argv[0]);
exit(-1);
}
char *line;
if (!fp) {
- ERROR("Failed to open %s\n", tab);
+ ERROR("Failed to open %s: %m\n", tab);
return;
}
regcomp(&pat_inittab, "([a-zA-Z0-9]*):([a-zA-Z0-9]*):([a-zA-Z0-9]*):(.*)", REG_EXTENDED);
line = malloc(LINE_LEN);
- a = malloc(sizeof(struct init_action));
- memset(a, 0, sizeof(struct init_action));
+ a = calloc(1, sizeof(struct init_action));
while (fgets(line, LINE_LEN, fp)) {
char *tags[TAG_PROCESS + 1];
if (add_action(a, tags[TAG_ACTION]))
continue;
line = malloc(LINE_LEN);
- a = malloc(sizeof(struct init_action));
- memset(a, 0, sizeof(struct init_action));
+ a = calloc(1, sizeof(struct init_action));
}
fclose(fp);