#include <pwd.h>
#include <grp.h>
#include <sys/wait.h>
+#include <sys/param.h>
#include "libudev.h"
#include "libudev-private.h"
int i;
int err = 0;
+ info(udev, "'%s' started\n", command);
+
/* build argv from command */
util_strscpy(arg, sizeof(arg), command);
i = 0;
argv[0] = arg;
argv[1] = NULL;
}
- info(udev, "'%s'\n", command);
/* prepare pipes from child to parent */
if (result != NULL || udev_get_log_priority(udev) >= LOG_INFO) {
FD_SET(outpipe[READ_END], &readfds);
if (errpipe[READ_END] > 0)
FD_SET(errpipe[READ_END], &readfds);
- fdcount = select(UDEV_MAX(outpipe[READ_END], errpipe[READ_END])+1, &readfds, NULL, NULL, NULL);
+ fdcount = select(MAX(outpipe[READ_END], errpipe[READ_END])+1, &readfds, NULL, NULL, NULL);
if (fdcount < 0) {
if (errno == EINTR)
continue;
}
waitpid(pid, &status, 0);
if (WIFEXITED(status)) {
- info(udev, "'%s' returned with status %i\n", argv[0], WEXITSTATUS(status));
+ info(udev, "'%s' returned with exitcode %i\n", command, WEXITSTATUS(status));
if (WEXITSTATUS(status) != 0)
err = -1;
} else {
- err(udev, "'%s' abnormal exit\n", command);
+ err(udev, "'%s' unexpected exit with status 0x%04x\n", command, status);
err = -1;
}
}