summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/udev/udev-node.c4
-rw-r--r--src/udev/udev-watch.c6
2 files changed, 5 insertions, 5 deletions
diff --git a/src/udev/udev-node.c b/src/udev/udev-node.c
index 5d2997fd8f..43004bc0bc 100644
--- a/src/udev/udev-node.c
+++ b/src/udev/udev-node.c
@@ -337,7 +337,7 @@ out:
void udev_node_add(struct udev_device *dev, bool apply,
mode_t mode, uid_t uid, gid_t gid,
struct udev_list *seclabel_list) {
- char filename[UTIL_PATH_SIZE];
+ char filename[sizeof("/dev/block/:") + 2*DECIMAL_STR_MAX(unsigned)];
struct udev_list_entry *list_entry;
log_debug("handling device node '%s', devnum=%s, mode=%#o, uid="UID_FMT", gid="GID_FMT,
@@ -360,7 +360,7 @@ void udev_node_add(struct udev_device *dev, bool apply,
void udev_node_remove(struct udev_device *dev) {
struct udev_list_entry *list_entry;
- char filename[UTIL_PATH_SIZE];
+ char filename[sizeof("/dev/block/:") + 2*DECIMAL_STR_MAX(unsigned)];
/* remove/update symlinks, remove symlinks from name index */
udev_list_entry_foreach(list_entry, udev_device_get_devlinks_list_entry(dev))
diff --git a/src/udev/udev-watch.c b/src/udev/udev-watch.c
index 9ce5e975de..bc9096ed0c 100644
--- a/src/udev/udev-watch.c
+++ b/src/udev/udev-watch.c
@@ -89,7 +89,7 @@ unlink:
}
void udev_watch_begin(struct udev *udev, struct udev_device *dev) {
- char filename[UTIL_PATH_SIZE];
+ char filename[sizeof("/run/udev/watch/") + DECIMAL_STR_MAX(int)];
int wd;
int r;
@@ -116,7 +116,7 @@ void udev_watch_begin(struct udev *udev, struct udev_device *dev) {
void udev_watch_end(struct udev *udev, struct udev_device *dev) {
int wd;
- char filename[UTIL_PATH_SIZE];
+ char filename[sizeof("/run/udev/watch/") + DECIMAL_STR_MAX(int)];
if (inotify_fd < 0)
return;
@@ -135,7 +135,7 @@ void udev_watch_end(struct udev *udev, struct udev_device *dev) {
}
struct udev_device *udev_watch_lookup(struct udev *udev, int wd) {
- char filename[UTIL_PATH_SIZE];
+ char filename[sizeof("/run/udev/watch/") + DECIMAL_STR_MAX(int)];
char device[UTIL_NAME_SIZE];
ssize_t len;