summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTom Gundersen <teg@jklm.no>2015-04-26 01:40:12 +0200
committerTom Gundersen <teg@jklm.no>2015-05-06 18:35:55 +0200
commit4914cb2ddc0aa2f71bddb5bb9a4bed7e6948d561 (patch)
tree269ee1797a013e895ad49d06da478ce3bcc4b47d /src
parenta44816e94ed32b9b23c4f38b78c9d1ca97992ff8 (diff)
udevd: don't track worker exitcode
We used to use this to track failed events so they could be retriggered, but that is no longer done, so the code can be dropped.
Diffstat (limited to 'src')
-rw-r--r--src/udev/udevd.c12
1 files changed, 2 insertions, 10 deletions
diff --git a/src/udev/udevd.c b/src/udev/udevd.c
index 365bb00a7f..13f5bf1dea 100644
--- a/src/udev/udevd.c
+++ b/src/udev/udevd.c
@@ -86,7 +86,6 @@ struct event {
struct udev_device *dev;
struct udev_device *dev_kernel;
enum event_state state;
- int exitcode;
unsigned long long int delaying_seqnum;
unsigned long long int seqnum;
const char *devpath;
@@ -124,7 +123,6 @@ struct worker {
/* passed from worker to main process */
struct worker_message {
- int exitcode;
};
static inline struct worker *node_to_worker(struct udev_list_node *node) {
@@ -254,8 +252,7 @@ static void worker_new(struct event *event) {
for (;;) {
struct udev_event *udev_event;
struct worker_message msg;
- int fd_lock = -1;
- int err = 0, r;
+ int fd_lock = -1, r;
log_debug("seq %llu running", udev_device_get_seqnum(dev));
udev_event = udev_event_new(dev);
@@ -291,7 +288,6 @@ static void worker_new(struct event *event) {
fd_lock = open(udev_device_get_devnode(d), O_RDONLY|O_CLOEXEC|O_NOFOLLOW|O_NONBLOCK);
if (fd_lock >= 0 && flock(fd_lock, LOCK_SH|LOCK_NB) < 0) {
log_debug_errno(errno, "Unable to flock(%s), skipping event handling: %m", udev_device_get_devnode(d));
- err = -EAGAIN;
fd_lock = safe_close(fd_lock);
goto skip;
}
@@ -328,11 +324,10 @@ static void worker_new(struct event *event) {
udev_monitor_send_device(worker_monitor, NULL, dev);
skip:
- log_debug("seq %llu processed with %i", udev_device_get_seqnum(dev), err);
+ log_debug("seq %llu processed", udev_device_get_seqnum(dev));
/* send udevd the result of the event execution */
memzero(&msg, sizeof(struct worker_message));
- msg.exitcode = err;
r = send(worker_watch[WRITE_END], &msg, sizeof(struct worker_message), 0);
if (r < 0)
log_error_errno(errno, "failed to send result of seq %llu to main daemon: %m",
@@ -655,7 +650,6 @@ static void worker_returned(int fd_worker) {
/* worker returned */
if (worker->event) {
- worker->event->exitcode = msg.exitcode;
event_queue_delete(worker->event);
worker->event = NULL;
}
@@ -938,7 +932,6 @@ static void handle_signal(struct udev *udev, int signo) {
if (worker->event) {
log_error("worker ["PID_FMT"] failed while handling '%s'",
pid, worker->event->devpath);
- worker->event->exitcode = -32;
/* delete state from disk */
udev_device_delete_db(worker->event->dev);
udev_device_tag_index(worker->event->dev, NULL, false);
@@ -1480,7 +1473,6 @@ int main(int argc, char *argv[]) {
worker->state = WORKER_KILLED;
log_error("seq %llu '%s' killed", udev_device_get_seqnum(worker->event->dev), worker->event->devpath);
- worker->event->exitcode = -64;
} else if (!worker->event_warned) {
log_warning("worker ["PID_FMT"] %s is taking a long time", worker->pid, worker->event->devpath);
worker->event_warned = true;