From a9e56ca936c98bf7845e6637394306376fc46318 Mon Sep 17 00:00:00 2001
From: Karel Zak <kzak@redhat.com>
Date: Tue, 13 May 2025 11:32:14 +0200
Subject: [PATCH 4/4] treewide: add ul_ to parse_timestamp() function name

Signed-off-by: Karel Zak <kzak@redhat.com>
---
 include/timeutils.h | 2 +-
 lib/timeutils.c     | 4 ++--
 login-utils/last.c  | 6 +++---
 misc-utils/cal.c    | 2 +-
 sys-utils/dmesg.c   | 4 ++--
 sys-utils/hwclock.c | 2 +-
 sys-utils/rtcwake.c | 2 +-
 7 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/include/timeutils.h b/include/timeutils.h
index e3cd252ba..30fa99096 100644
--- a/include/timeutils.h
+++ b/include/timeutils.h
@@ -47,7 +47,7 @@ typedef uint64_t nsec_t;
 #define FORMAT_TIMESTAMP_RELATIVE_MAX 256
 #define FORMAT_TIMESPAN_MAX 64
 
-int parse_timestamp(const char *t, usec_t *usec);
+int ul_parse_timestamp(const char *t, usec_t *usec);
 int get_gmtoff(const struct tm *tp);
 
 /* flags and masks for strxxx_iso() functions */
diff --git a/lib/timeutils.c b/lib/timeutils.c
index f53ec8fee..2688f60d7 100644
--- a/lib/timeutils.c
+++ b/lib/timeutils.c
@@ -403,7 +403,7 @@ static int parse_timestamp_reference(time_t x, const char *t, usec_t *usec)
 	return 0;
 }
 
-int parse_timestamp(const char *t, usec_t *usec)
+int ul_parse_timestamp(const char *t, usec_t *usec)
 {
 	return parse_timestamp_reference(time(NULL), t, usec);
 }
@@ -872,7 +872,7 @@ int main(int argc, char *argv[])
 	if (strcmp(argv[1], "--timestamp") == 0) {
 		usec_t usec = 0;
 
-		r = parse_timestamp(argv[2], &usec);
+		r = ul_parse_timestamp(argv[2], &usec);
 		if (r)
 			errx(EXIT_FAILURE, "Can not parse '%s': %s", argv[2], strerror(-r));
 		ts.tv_sec = (time_t) (usec / USEC_PER_SEC);
diff --git a/login-utils/last.c b/login-utils/last.c
index bdd375063..25d79e09a 100644
--- a/login-utils/last.c
+++ b/login-utils/last.c
@@ -1054,17 +1054,17 @@ int main(int argc, char **argv)
 			ctl.time_fmt = LAST_TIMEFTM_CTIME;
 			break;
 		case 'p':
-			if (parse_timestamp(optarg, &p) < 0)
+			if (ul_parse_timestamp(optarg, &p) < 0)
 				errx(EXIT_FAILURE, _("invalid time value \"%s\""), optarg);
 			ctl.present = (time_t) (p / 1000000);
 			break;
 		case 's':
-			if (parse_timestamp(optarg, &p) < 0)
+			if (ul_parse_timestamp(optarg, &p) < 0)
 				errx(EXIT_FAILURE, _("invalid time value \"%s\""), optarg);
 			ctl.since = (time_t) (p / 1000000);
 			break;
 		case 't':
-			if (parse_timestamp(optarg, &p) < 0)
+			if (ul_parse_timestamp(optarg, &p) < 0)
 				errx(EXIT_FAILURE, _("invalid time value \"%s\""), optarg);
 			ctl.until = (time_t) (p / 1000000);
 			break;
diff --git a/misc-utils/cal.c b/misc-utils/cal.c
index 0acf042ff..05991f9ad 100644
--- a/misc-utils/cal.c
+++ b/misc-utils/cal.c
@@ -467,7 +467,7 @@ int main(int argc, char **argv)
 	if (argc == 1 && !isdigit_string(*argv)) {
 		usec_t x;
 		/* cal <timestamp> */
-		if (parse_timestamp(*argv, &x) == 0)
+		if (ul_parse_timestamp(*argv, &x) == 0)
 			now = (time_t) (x / 1000000);
 		/* cal <monthname> */
 		else if ((ctl.req.month = monthname_to_number(&ctl, *argv)) > 0)
diff --git a/sys-utils/dmesg.c b/sys-utils/dmesg.c
index dc9a2877a..cccbd4067 100644
--- a/sys-utils/dmesg.c
+++ b/sys-utils/dmesg.c
@@ -1818,13 +1818,13 @@ int main(int argc, char *argv[])
 			break;
 		case OPT_SINCE:
 		{
-			if (parse_timestamp(optarg, &ctl.since) < 0)
+			if (ul_parse_timestamp(optarg, &ctl.since) < 0)
 				errx(EXIT_FAILURE, _("invalid time value \"%s\""), optarg);
 			break;
 		}
 		case OPT_UNTIL:
 		{
-			if (parse_timestamp(optarg, &ctl.until) < 0)
+			if (ul_parse_timestamp(optarg, &ctl.until) < 0)
 				errx(EXIT_FAILURE, _("invalid time value \"%s\""), optarg);
 			break;
 		}
diff --git a/sys-utils/hwclock.c b/sys-utils/hwclock.c
index 9977e0600..d42099d75 100644
--- a/sys-utils/hwclock.c
+++ b/sys-utils/hwclock.c
@@ -1561,7 +1561,7 @@ int main(int argc, char **argv)
 		/* minimalistic GPLv2 based parser */
 		usec_t usec;
 
-		if (parse_timestamp(ctl.date_opt, &usec) == 0)
+		if (ul_parse_timestamp(ctl.date_opt, &usec) == 0)
 			set_time = (time_t) (usec / 1000000);
 #endif
 		else {
diff --git a/sys-utils/rtcwake.c b/sys-utils/rtcwake.c
index d384feb64..49dab17bd 100644
--- a/sys-utils/rtcwake.c
+++ b/sys-utils/rtcwake.c
@@ -516,7 +516,7 @@ int main(int argc, char **argv)
 		case OPT_DATE:
 		{	/* alarm time, see timestamp format from manual */
 			usec_t p;
-			if (parse_timestamp(optarg, &p) < 0)
+			if (ul_parse_timestamp(optarg, &p) < 0)
 				errx(EXIT_FAILURE, _("invalid time value \"%s\""), optarg);
 			alarm = (time_t) (p / 1000000);
 			break;
-- 
2.48.1

