daandemeyer / rpms / systemd

Forked from rpms/systemd 2 years ago
Clone
1abbee
From 95a6f0f1b2a24e40380af5db1797ee60c8763ca2 Mon Sep 17 00:00:00 2001
1abbee
From: Lennart Poettering <lennart@poettering.net>
1abbee
Date: Tue, 14 Apr 2015 15:48:26 +0200
1abbee
Subject: [PATCH] udev: downgrade a few warnings to debug messages
1abbee
1abbee
https://bugs.freedesktop.org/show_bug.cgi?id=89885
1abbee
1abbee
Cherry-picked from: 8d8ce9e2
1abbee
Resolves: #1289461
1abbee
---
1abbee
 src/udev/udev-builtin-blkid.c  | 2 +-
1abbee
 src/udev/udev-builtin-usb_id.c | 6 ++----
1abbee
 2 files changed, 3 insertions(+), 5 deletions(-)
1abbee
1abbee
diff --git a/src/udev/udev-builtin-blkid.c b/src/udev/udev-builtin-blkid.c
181b3f
index 89995831b..2b2c3dad6 100644
1abbee
--- a/src/udev/udev-builtin-blkid.c
1abbee
+++ b/src/udev/udev-builtin-blkid.c
1abbee
@@ -263,7 +263,7 @@ static int builtin_blkid(struct udev_device *dev, int argc, char *argv[], bool t
1abbee
 
1abbee
         fd = open(udev_device_get_devnode(dev), O_RDONLY|O_CLOEXEC);
1abbee
         if (fd < 0) {
1abbee
-                fprintf(stderr, "error: %s: %m\n", udev_device_get_devnode(dev));
1abbee
+                err = log_debug_errno(errno, "Failure opening block device %s: %m", udev_device_get_devnode(dev));
1abbee
                 goto out;
1abbee
         }
1abbee
 
1abbee
diff --git a/src/udev/udev-builtin-usb_id.c b/src/udev/udev-builtin-usb_id.c
181b3f
index ab0d96e37..64b763c1e 100644
1abbee
--- a/src/udev/udev-builtin-usb_id.c
1abbee
+++ b/src/udev/udev-builtin-usb_id.c
1abbee
@@ -168,10 +168,8 @@ static int dev_if_packed_info(struct udev_device *dev, char *ifs_str, size_t len
1abbee
                 return log_oom();
1abbee
 
1abbee
         fd = open(filename, O_RDONLY|O_CLOEXEC);
1abbee
-        if (fd < 0) {
1abbee
-                fprintf(stderr, "error opening USB device 'descriptors' file\n");
1abbee
-                return -errno;
1abbee
-        }
1abbee
+        if (fd < 0)
1abbee
+                return log_debug_errno(errno, "Error opening USB device 'descriptors' file: %m");
1abbee
 
1abbee
         size = read(fd, buf, sizeof(buf));
1abbee
         if (size < 18 || size == sizeof(buf))