]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
hwclock: squash custom errno strings
authorJ William Piggott <elseifthen@gmx.com>
Sun, 23 Jul 2017 18:25:55 +0000 (14:25 -0400)
committerJ William Piggott <elseifthen@gmx.com>
Mon, 31 Jul 2017 20:10:47 +0000 (16:10 -0400)
warn() appends ENOENT as: No such file or directory

The custom string is unnecessary and problematic for translators.

Signed-off-by: J William Piggott <elseifthen@gmx.com>
sys-utils/hwclock-rtc.c

index 2af2666d2057bca677ed48010a26ceb1b4ee62db..36ce3976142d223a35d6d9c8d09fb763c77497f5 100644 (file)
@@ -402,10 +402,7 @@ int get_epoch_rtc(const struct hwclock_control *ctl, unsigned long *epoch_p)
 
        rtc_fd = open_rtc(ctl);
        if (rtc_fd < 0) {
-               if (errno == ENOENT)
-                       warnx(_("%s does not exist."), rtc_dev_name);
-               else
-                       warn(_("cannot open %s"), rtc_dev_name);
+               warn(_("cannot open %s"), rtc_dev_name);
                return 1;
        }
 
@@ -440,10 +437,7 @@ int set_epoch_rtc(const struct hwclock_control *ctl)
 
        rtc_fd = open_rtc(ctl);
        if (rtc_fd < 0) {
-               if (errno == ENOENT)
-                       warnx(_("%s does not exist."), rtc_dev_name);
-               else
-                       warn(_("cannot open %s"), rtc_dev_name);
+               warn(_("cannot open %s"), rtc_dev_name);
                return 1;
        }