-/* $OpenBSD: radiusd.c,v 1.41 2024/07/01 05:18:16 yasuoka Exp $ */
+/* $OpenBSD: radiusd.c,v 1.42 2024/07/01 05:20:01 yasuoka Exp $ */
/*
* Copyright (c) 2013, 2023 Internet Initiative Japan Inc.
if (event_loop(0) < 0)
radiusd_stop(radiusd);
+ if (radiusd->error != 0)
+ log_warnx("exiting on error");
+
radiusd_free(radiusd);
event_base_free(NULL);
- exit(EXIT_SUCCESS);
+ if (radiusd->error != 0)
+ exit(EXIT_FAILURE);
+ else
+ exit(EXIT_SUCCESS);
}
static int
return (0);
on_error:
+ radiusd->error++;
radiusd_stop(radiusd);
return (-1);
struct radiusd *radiusd = ctx;
struct radiusd_module *module;
pid_t pid;
- int status;
+ int status, ndeath = 0;
log_debug("Received SIGCHLD");
while ((pid = wait3(&status, WNOHANG, NULL)) != 0) {
log_warnx("module `%s'(pid=%d) exited "
"by signal %d", module->name,
(int)pid, WTERMSIG(status));
+ ndeath++;
break;
}
}
WTERMSIG(status));
}
}
+ if (ndeath > 0) {
+ radiusd->error++;
+ event_loopbreak();
+ }
}
static const char *
-/* $OpenBSD: radiusd_local.h,v 1.9 2024/07/01 03:32:09 yasuoka Exp $ */
+/* $OpenBSD: radiusd_local.h,v 1.10 2024/07/01 05:20:01 yasuoka Exp $ */
/*
* Copyright (c) 2013 Internet Initiative Japan Inc.
TAILQ_HEAD(,radiusd_authentication) authen;
TAILQ_HEAD(,radiusd_client) client;
TAILQ_HEAD(,radius_query) query;
+ int error;
};
struct radius_query {