summaryrefslogtreecommitdiff
path: root/src/libudev
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2017-11-20 15:29:53 +0100
committerLennart Poettering <lennart@poettering.net>2017-11-21 11:37:12 +0100
commitcbfb8679dd5812a43252b9665f472a6cfeb3768f (patch)
tree83451fd8bf3eeb0766c76ad730ca074a8e6695c5 /src/libudev
parent172378e01bff23d27a1373f96913badbb30a61d8 (diff)
downloadsystemd-cbfb8679dd5812a43252b9665f472a6cfeb3768f.tar.gz
mount-util: add name_to_handle_at_loop() wrapper around name_to_handle_at()
As it turns out MAX_HANDLE_SZ is a lie, the handle buffer we pass into name_to_handle_at() might need to be larger than MAX_HANDLE_SZ, and we thus need to invoke name_to_handle_at() in a loop, growing the buffer as needed. This adds a new wrapper name_to_handle_at_loop() around name_to_handle_at() that does the necessary looping, and ports over all users. Fixes: #7082
Diffstat (limited to 'src/libudev')
-rw-r--r--src/libudev/libudev-monitor.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/libudev/libudev-monitor.c b/src/libudev/libudev-monitor.c
index e43d712195..68fd174a3a 100644
--- a/src/libudev/libudev-monitor.c
+++ b/src/libudev/libudev-monitor.c
@@ -115,13 +115,12 @@ static struct udev_monitor *udev_monitor_new(struct udev *udev)
/* we consider udev running when /dev is on devtmpfs */
static bool udev_has_devtmpfs(struct udev *udev) {
- union file_handle_union h = FILE_HANDLE_INIT;
_cleanup_fclose_ FILE *f = NULL;
char line[LINE_MAX], *e;
int mount_id;
int r;
- r = name_to_handle_at(AT_FDCWD, "/dev", &h.handle, &mount_id, 0);
+ r = name_to_handle_at_loop(AT_FDCWD, "/dev", NULL, &mount_id, 0);
if (r < 0) {
if (errno != EOPNOTSUPP)
log_debug_errno(errno, "name_to_handle_at on /dev: %m");