remove spurious null check in clock_settime
authorRich Felker <dalias@aerifal.cx>
Thu, 8 Aug 2019 01:31:41 +0000 (21:31 -0400)
committerRich Felker <dalias@aerifal.cx>
Thu, 8 Aug 2019 01:31:41 +0000 (21:31 -0400)
at the point of this check, the pointer has already been dereferenced.
clock_settime is not defined for null pointer arguments.

src/time/clock_settime.c

index 5fdaeb9e424eba594d304a387529cb61c06a22c6..1004ed15284621129789270d0f97e30c5c462095 100644 (file)
@@ -17,7 +17,7 @@ int clock_settime(clockid_t clk, const struct timespec *ts)
                return __syscall_ret(r);
        if (!IS32BIT(s))
                return __syscall_ret(-ENOTSUP);
-       return syscall(SYS_clock_settime, clk, ts ? ((long[]){s, ns}) : 0);
+       return syscall(SYS_clock_settime, clk, ((long[]){s, ns}));
 #else
        return syscall(SYS_clock_settime, clk, ts);
 #endif