pid=fork();
if (pid==-1) {
- perror ("Could not fork");
+ fprintf (shadow_logfd, "Could not fork: %s\n", strerror(errno));
return 1;
}
if (pid==0) {
setenv ("ACTION",action,1);
setenv ("SUBJECT",name,1);
execv (script_path,args);
- perror ("execv");
+ fprintf (shadow_logfd, "execv: %s\n", strerror(errno));
exit(1);
}
return (wait_status);
}
- perror ("waitpid");
+ fprintf (shadow_logfd, "waitpid: %s\n", strerror(errno));
return (1);
}
struct stat sb;
if (asprintf(&s, "%s/%s", directory, namelist[n]->d_name) == -1) {
- fprintf(stderr, "could not allocate memory\n");
+ fprintf (shadow_logfd, "could not allocate memory\n");
for (; n<scanlist; n++) {
free(namelist[n]);
}
execute_result = 0;
if (stat (s, &sb) == -1) {
- perror ("stat");
+ fprintf (shadow_logfd, "stat: %s\n", strerror(errno));
free(s);
for (; n<scanlist; n++) {
free (namelist[n]);