From cc1594a59a67aa957536762d70dc4ed803048f6a Mon Sep 17 00:00:00 2001 From: "Peter A. Bigot" Date: Sun, 18 Aug 2019 02:59:15 -0500 Subject: [PATCH] lib/timeutil: support const correctness for pointer parameter timeutil_timegm() does not modify the passed structure, so it should indicate that in the signature (even though the GNU extension does not). Signed-off-by: Peter A. Bigot --- include/sys/timeutil.h | 2 +- lib/os/timeutil.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/include/sys/timeutil.h b/include/sys/timeutil.h index 92acecddc89..ddc437b590e 100644 --- a/include/sys/timeutil.h +++ b/include/sys/timeutil.h @@ -32,7 +32,7 @@ extern "C" { * * @see http://man7.org/linux/man-pages/man3/timegm.3.html */ -time_t timeutil_timegm(struct tm *tm); +time_t timeutil_timegm(const struct tm *tm); #ifdef __cplusplus } diff --git a/lib/os/timeutil.c b/lib/os/timeutil.c index 745f158b64a..40a72fc0472 100644 --- a/lib/os/timeutil.c +++ b/lib/os/timeutil.c @@ -48,7 +48,7 @@ static s64_t time_days_from_civil(s64_t y, * @return the signed number of seconds between 1970-01-01T00:00:00 * and the specified time ignoring leap seconds and DST offsets. */ -time_t timeutil_timegm(struct tm *tm) +time_t timeutil_timegm(const struct tm *tm) { s64_t y = 1900 + (s64_t)tm->tm_year; unsigned int m = tm->tm_mon + 1;