summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordchagin <dchagin@FreeBSD.org>2016-03-08 15:12:49 +0000
committerdchagin <dchagin@FreeBSD.org>2016-03-08 15:12:49 +0000
commitda5317c33ba7cb6ad5603df8995285140d6181e2 (patch)
tree330bc3f98195068de8ec9307ff81057c56503392
parent2d946990603c55bc2d363edfe11dfe2387effe6b (diff)
downloadFreeBSD-src-da5317c33ba7cb6ad5603df8995285140d6181e2.zip
FreeBSD-src-da5317c33ba7cb6ad5603df8995285140d6181e2.tar.gz
According to POSIX and Linux implementation the alarm() system call
is always successfull. So, ignore any errors and return 0 as a Linux do. XXX. Unlike POSIX, Linux in case when the invalid seconds value specified always return 0, so in that case Linux does not return proper remining time. MFC after: 1 week
-rw-r--r--sys/compat/linux/linux_misc.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/sys/compat/linux/linux_misc.c b/sys/compat/linux/linux_misc.c
index fe4dbf6..a9c330a 100644
--- a/sys/compat/linux/linux_misc.c
+++ b/sys/compat/linux/linux_misc.c
@@ -191,7 +191,6 @@ linux_alarm(struct thread *td, struct linux_alarm_args *args)
{
struct itimerval it, old_it;
u_int secs;
- int error;
#ifdef DEBUG
if (ldebug(alarm))
@@ -207,9 +206,7 @@ linux_alarm(struct thread *td, struct linux_alarm_args *args)
it.it_value.tv_usec = 0;
it.it_interval.tv_sec = 0;
it.it_interval.tv_usec = 0;
- error = kern_setitimer(td, ITIMER_REAL, &it, &old_it);
- if (error)
- return (error);
+ kern_setitimer(td, ITIMER_REAL, &it, &old_it);
if (timevalisset(&old_it.it_value)) {
if (old_it.it_value.tv_usec != 0)
old_it.it_value.tv_sec++;
OpenPOWER on IntegriCloud