|
|
4295f9 |
From a075830244f699703a88a492413d931eaeb23a65 Mon Sep 17 00:00:00 2001
|
|
|
4295f9 |
From: Yu Watanabe <watanabe.yu+github@gmail.com>
|
|
|
4295f9 |
Date: Thu, 2 Sep 2021 08:23:35 +0900
|
|
|
4295f9 |
Subject: [PATCH] udev-node: shorten code a bit and update log message
|
|
|
4295f9 |
|
|
|
4295f9 |
(cherry picked from commit 8424da2de88ceeed7be8544fb69221f0b0ea84ea)
|
|
|
4295f9 |
|
|
|
4295f9 |
Related: #1977994
|
|
|
4295f9 |
---
|
|
|
4295f9 |
src/udev/udev-node.c | 5 ++---
|
|
|
4295f9 |
1 file changed, 2 insertions(+), 3 deletions(-)
|
|
|
4295f9 |
|
|
|
4295f9 |
diff --git a/src/udev/udev-node.c b/src/udev/udev-node.c
|
|
|
4295f9 |
index 28e6e8df94..2e7df899e4 100644
|
|
|
4295f9 |
--- a/src/udev/udev-node.c
|
|
|
4295f9 |
+++ b/src/udev/udev-node.c
|
|
|
4295f9 |
@@ -447,13 +447,12 @@ static int link_update(sd_device *dev, const char *slink_in, bool add) {
|
|
|
4295f9 |
_cleanup_free_ char *target = NULL;
|
|
|
4295f9 |
struct stat st1 = {}, st2 = {};
|
|
|
4295f9 |
|
|
|
4295f9 |
- r = stat(dirname, &st1;;
|
|
|
4295f9 |
- if (r < 0 && errno != ENOENT)
|
|
|
4295f9 |
+ if (stat(dirname, &st1) < 0 && errno != ENOENT)
|
|
|
4295f9 |
return log_device_debug_errno(dev, errno, "Failed to stat %s: %m", dirname);
|
|
|
4295f9 |
|
|
|
4295f9 |
r = link_find_prioritized(dev, add, dirname, &target);
|
|
|
4295f9 |
if (r < 0)
|
|
|
4295f9 |
- return log_device_debug_errno(dev, r, "Failed to determine highest priority for symlink '%s': %m", slink);
|
|
|
4295f9 |
+ return log_device_debug_errno(dev, r, "Failed to determine device node with the highest priority for '%s': %m", slink);
|
|
|
4295f9 |
if (r == 0) {
|
|
|
4295f9 |
log_device_debug(dev, "No reference left for '%s', removing", slink);
|
|
|
4295f9 |
|