chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add initialization helper for file_handle_union
[elogind.git]
/
src
/
libudev
/
libudev-monitor.c
diff --git
a/src/libudev/libudev-monitor.c
b/src/libudev/libudev-monitor.c
index 484fefeebfe27261167aef5acbf7cb6f26c4f41c..da2b63473f3aebe5a83b46202eea3a13077e34c1 100644
(file)
--- a/
src/libudev/libudev-monitor.c
+++ b/
src/libudev/libudev-monitor.c
@@
-109,10
+109,7
@@
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) {
/* we consider udev running when /dev is on devtmpfs */
static bool udev_has_devtmpfs(struct udev *udev) {
- union file_handle_union h = {
- .handle.handle_bytes = MAX_HANDLE_SZ
- };
-
+ union file_handle_union h = FILE_HANDLE_INIT;
_cleanup_fclose_ FILE *f = NULL;
char line[LINE_MAX], *e;
int mount_id;
_cleanup_fclose_ FILE *f = NULL;
char line[LINE_MAX], *e;
int mount_id;
@@
-609,7
+606,7
@@
retry:
return NULL;
}
return NULL;
}
- if (buflen < 32 || (s
ize_t)buflen >= sizeof(buf
)) {
+ if (buflen < 32 || (s
msg.msg_flags & MSG_TRUNC
)) {
log_debug("invalid message length");
return NULL;
}
log_debug("invalid message length");
return NULL;
}