From: cheloha Date: Thu, 24 Jun 2021 22:43:31 +0000 (+0000) Subject: alarm(3): remove superfluous pointer X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=cc6be637ff74e784c669dcd5697f20e086a0dc14;p=openbsd alarm(3): remove superfluous pointer The pointer `itp' doesn't serve any purpose here, remove it. Since we're changing these lines, we may as well rename `it' to `itv' to match the existing `oitv'. Thread: https://marc.info/?l=openbsd-tech&m=162380665115598&w=2 ok millert@ --- diff --git a/lib/libc/gen/alarm.c b/lib/libc/gen/alarm.c index f15dd151219..ac17f9d0484 100644 --- a/lib/libc/gen/alarm.c +++ b/lib/libc/gen/alarm.c @@ -1,4 +1,4 @@ -/* $OpenBSD: alarm.c,v 1.9 2019/06/28 13:32:41 deraadt Exp $ */ +/* $OpenBSD: alarm.c,v 1.10 2021/06/24 22:43:31 cheloha Exp $ */ /* * Copyright (c) 1983, 1993 * The Regents of the University of California. All rights reserved. @@ -34,13 +34,12 @@ unsigned int alarm(unsigned int secs) { - struct itimerval it, oitv; - struct itimerval *itp = ⁢ + struct itimerval itv, oitv; - timerclear(&itp->it_interval); - itp->it_value.tv_sec = secs; - itp->it_value.tv_usec = 0; - if (setitimer(ITIMER_REAL, itp, &oitv) == -1) + timerclear(&itv.it_interval); + itv.it_value.tv_sec = secs; + itv.it_value.tv_usec = 0; + if (setitimer(ITIMER_REAL, &itv, &oitv) == -1) return ((unsigned int) -1); if (oitv.it_value.tv_usec) oitv.it_value.tv_sec++;