chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
util: consider both fuse.glusterfs and glusterfs network file systems
[elogind.git]
/
src
/
udev
/
udevadm-settle.c
diff --git
a/src/udev/udevadm-settle.c
b/src/udev/udevadm-settle.c
index 362c3b2f98bd2749ae64178f0bfddad1e958173e..927ea2a7f2e37ba5dc6e8b841c4429f68d1b2c6d 100644
(file)
--- a/
src/udev/udevadm-settle.c
+++ b/
src/udev/udevadm-settle.c
@@
-35,6
+35,7
@@
#include <sys/types.h>
#include "udev.h"
#include <sys/types.h>
#include "udev.h"
+#include "udev-util.h"
#include "util.h"
static void help(void) {
#include "util.h"
static void help(void) {
@@
-65,7
+66,7
@@
static int adm_settle(struct udev *udev, int argc, char *argv[])
const char *exists = NULL;
unsigned int timeout = 120;
struct pollfd pfd[1] = { {.fd = -1}, };
const char *exists = NULL;
unsigned int timeout = 120;
struct pollfd pfd[1] = { {.fd = -1}, };
- struct udev_queue *udev_queue = NULL;
+
_cleanup_udev_queue_unref_
struct udev_queue *udev_queue = NULL;
int rc = EXIT_FAILURE, c;
while ((c = getopt_long(argc, argv, "s:e:t:E:qh", options, NULL)) >= 0)
int rc = EXIT_FAILURE, c;
while ((c = getopt_long(argc, argv, "s:e:t:E:qh", options, NULL)) >= 0)
@@
-99,7
+100,7
@@
static int adm_settle(struct udev *udev, int argc, char *argv[])
case '?':
exit(EXIT_FAILURE);
default:
case '?':
exit(EXIT_FAILURE);
default:
- assert_not_reached("Unkown argument");
+ assert_not_reached("Unk
n
own argument");
}
if (optind < argc) {
}
if (optind < argc) {
@@
-121,20
+122,20
@@
static int adm_settle(struct udev *udev, int argc, char *argv[])
end = udev_queue_get_kernel_seqnum(udev_queue);
if (start > end) {
end = udev_queue_get_kernel_seqnum(udev_queue);
if (start > end) {
- log_error("seq-start larger than seq-end, ignoring
\n
");
+ log_error("seq-start larger than seq-end, ignoring");
start = 0;
end = 0;
}
if (start > kernel_seq || end > kernel_seq) {
start = 0;
end = 0;
}
if (start > kernel_seq || end > kernel_seq) {
- log_error("seq-start or seq-end larger than current kernel value, ignoring
\n
");
+ log_error("seq-start or seq-end larger than current kernel value, ignoring");
start = 0;
end = 0;
}
start = 0;
end = 0;
}
- log_debug("start=%llu end=%llu current=%llu
\n
", (unsigned long long)start, (unsigned long long)end, kernel_seq);
+ log_debug("start=%llu end=%llu current=%llu", (unsigned long long)start, (unsigned long long)end, kernel_seq);
} else {
if (end > 0) {
} else {
if (end > 0) {
- log_error("seq-end needs seq-start parameter, ignoring
\n
");
+ log_error("seq-end needs seq-start parameter, ignoring");
end = 0;
}
}
end = 0;
}
}
@@
-146,7
+147,7
@@
static int adm_settle(struct udev *udev, int argc, char *argv[])
uctrl = udev_ctrl_new(udev);
if (uctrl != NULL) {
if (udev_ctrl_send_ping(uctrl, timeout) < 0) {
uctrl = udev_ctrl_new(udev);
if (uctrl != NULL) {
if (udev_ctrl_send_ping(uctrl, timeout) < 0) {
- log_debug("no connection to daemon
\n
");
+ log_debug("no connection to daemon");
udev_ctrl_unref(uctrl);
rc = EXIT_SUCCESS;
goto out;
udev_ctrl_unref(uctrl);
rc = EXIT_SUCCESS;
goto out;
@@
-158,10
+159,10
@@
static int adm_settle(struct udev *udev, int argc, char *argv[])
pfd[0].events = POLLIN;
pfd[0].fd = inotify_init1(IN_CLOEXEC);
if (pfd[0].fd < 0) {
pfd[0].events = POLLIN;
pfd[0].fd = inotify_init1(IN_CLOEXEC);
if (pfd[0].fd < 0) {
- log_error("inotify_init failed: %m
\n
");
+ log_error("inotify_init failed: %m");
} else {
if (inotify_add_watch(pfd[0].fd, "/run/udev" , IN_MOVED_TO) < 0) {
} else {
if (inotify_add_watch(pfd[0].fd, "/run/udev" , IN_MOVED_TO) < 0) {
- log_error("watching /run/udev failed
\n
");
+ log_error("watching /run/udev failed");
close(pfd[0].fd);
pfd[0].fd = -1;
}
close(pfd[0].fd);
pfd[0].fd = -1;
}
@@
-214,7
+215,7
@@
static int adm_settle(struct udev *udev, int argc, char *argv[])
struct udev_list_entry *list_entry;
if (!quiet && udev_queue_get_queued_list_entry(udev_queue) != NULL) {
struct udev_list_entry *list_entry;
if (!quiet && udev_queue_get_queued_list_entry(udev_queue) != NULL) {
- log_debug("timeout waiting for udev queue
\n
");
+ log_debug("timeout waiting for udev queue");
printf("\nudevadm settle - timeout of %i seconds reached, the event queue contains:\n", timeout);
udev_list_entry_foreach(list_entry, udev_queue_get_queued_list_entry(udev_queue))
printf(" %s (%s)\n",
printf("\nudevadm settle - timeout of %i seconds reached, the event queue contains:\n", timeout);
udev_list_entry_foreach(list_entry, udev_queue_get_queued_list_entry(udev_queue))
printf(" %s (%s)\n",
@@
-229,7
+230,6
@@
static int adm_settle(struct udev *udev, int argc, char *argv[])
out:
if (pfd[0].fd >= 0)
close(pfd[0].fd);
out:
if (pfd[0].fd >= 0)
close(pfd[0].fd);
- udev_queue_unref(udev_queue);
return rc;
}
return rc;
}