chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
udevd: control - no not delete socket file when --daemon is used
[elogind.git]
/
udev
/
udevadm-settle.c
diff --git
a/udev/udevadm-settle.c
b/udev/udevadm-settle.c
index 053a3bba333f048017074e2f2ac515484484f317..a59d7c39e5b283e71288ff68ed8c6b3f38d0630e 100644
(file)
--- a/
udev/udevadm-settle.c
+++ b/
udev/udevadm-settle.c
@@
-36,7
+36,7
@@
#include "udev.h"
#include "udev.h"
-
int udev
adm_settle(struct udev *udev, int argc, char *argv[])
+
static int
adm_settle(struct udev *udev, int argc, char *argv[])
{
static const struct option options[] = {
{ "seq-start", required_argument, NULL, 's' },
{
static const struct option options[] = {
{ "seq-start", required_argument, NULL, 's' },
@@
-96,7
+96,9
@@
int udevadm_settle(struct udev *udev, int argc, char *argv[])
" --exit-if-exists=<file> stop waiting if file exists\n"
" --quiet do not print list after timeout\n"
" --help\n\n");
" --exit-if-exists=<file> stop waiting if file exists\n"
" --quiet do not print list after timeout\n"
" --help\n\n");
- exit(0);
+ exit(EXIT_SUCCESS);
+ default:
+ exit(EXIT_FAILURE);
}
}
}
}
@@
-136,7
+138,7
@@
int udevadm_settle(struct udev *udev, int argc, char *argv[])
if (getuid() == 0) {
struct udev_ctrl *uctrl;
if (getuid() == 0) {
struct udev_ctrl *uctrl;
- uctrl = udev_ctrl_new
_from_socket(udev, UDEV_CTRL_SOCK_PATH
);
+ uctrl = udev_ctrl_new
(udev
);
if (uctrl != NULL) {
if (udev_ctrl_send_ping(uctrl, timeout) < 0) {
info(udev, "no connection to daemon\n");
if (uctrl != NULL) {
if (udev_ctrl_send_ping(uctrl, timeout) < 0) {
info(udev, "no connection to daemon\n");
@@
-185,12
+187,11
@@
int udevadm_settle(struct udev *udev, int argc, char *argv[])
if (pfd[0].fd >= 0) {
int delay;
if (pfd[0].fd >= 0) {
int delay;
- /* wake up after delay, or immediately after the queue is rebuilt */
-
if (exists != NULL || start > 0)
delay = 100;
else
delay = 1000;
if (exists != NULL || start > 0)
delay = 100;
else
delay = 1000;
+ /* wake up after delay, or immediately after the queue is rebuilt */
if (poll(pfd, 1, delay) > 0 && pfd[0].revents & POLLIN) {
char buf[sizeof(struct inotify_event) + PATH_MAX];
if (poll(pfd, 1, delay) > 0 && pfd[0].revents & POLLIN) {
char buf[sizeof(struct inotify_event) + PATH_MAX];
@@
-226,3
+227,9
@@
out:
udev_queue_unref(udev_queue);
return rc;
}
udev_queue_unref(udev_queue);
return rc;
}
+
+const struct udevadm_cmd udevadm_settle = {
+ .name = "settle",
+ .cmd = adm_settle,
+ .help = "wait for the event queue to finish",
+};