From: Sami Kerola Date: Tue, 26 Jul 2016 13:34:30 +0000 (+0100) Subject: hwclock: fix rtc atexit registration X-Git-Tag: v2.30-rc1~267^2~3 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=926ffe745162c7d794ec69593dee09730a767539;p=thirdparty%2Futil-linux.git hwclock: fix rtc atexit registration Commit 27f9db17bd57b85947445c03e2cd9dda36ca377f missed a minus sign from comparison. Reviewed-by: J William Piggott Signed-off-by: Sami Kerola --- diff --git a/sys-utils/hwclock-rtc.c b/sys-utils/hwclock-rtc.c index fa5e07b118..92f04435b2 100644 --- a/sys-utils/hwclock-rtc.c +++ b/sys-utils/hwclock-rtc.c @@ -138,7 +138,7 @@ static int open_rtc(const struct hwclock_control *ctl) if (rtc_dev_fd < 0) rtc_dev_name = *fls; /* default for error messages */ } - if (rtc_dev_fd != 1) + if (rtc_dev_fd != -1) atexit(close_rtc); return rtc_dev_fd; }