]> www.infradead.org Git - users/dwmw2/linux.git/commit
alarmtimer: Use EOPNOTSUPP instead of ENOTSUPP
authorThadeu Lima de Souza Cascardo <cascardo@canonical.com>
Tue, 3 Sep 2019 17:18:02 +0000 (14:18 -0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 5 Oct 2019 11:14:08 +0000 (13:14 +0200)
commitf683465f0564e0a63bc138a6b74817fc890525e5
treee51f7592545f02b01d8a79e062b9a1342623c622
parent5d67ad366f2b5e3809655b3e7890f4cc3c2b6dae
alarmtimer: Use EOPNOTSUPP instead of ENOTSUPP

commit f18ddc13af981ce3c7b7f26925f099e7c6929aba upstream.

ENOTSUPP is not supposed to be returned to userspace. This was found on an
OpenPower machine, where the RTC does not support set_alarm.

On that system, a clock_nanosleep(CLOCK_REALTIME_ALARM, ...) results in
"524 Unknown error 524"

Replace it with EOPNOTSUPP which results in the expected "95 Operation not
supported" error.

Fixes: 1c6b39ad3f01 (alarmtimers: Return -ENOTSUPP if no RTC device is present)
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: stable@vger.kernel.org
Link: https://lkml.kernel.org/r/20190903171802.28314-1-cascardo@canonical.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
kernel/time/alarmtimer.c