From: Karel Zak Date: Tue, 13 May 2025 09:32:14 +0000 (+0200) Subject: treewide: add ul_ to parse_timestamp() function name X-Git-Url: http://git.ipfire.org/gitweb/gitweb.cgi?a=commitdiff_plain;h=35435649a4d8b48074e1b2e4f1d4c39cd5733d4b;p=thirdparty%2Futil-linux.git treewide: add ul_ to parse_timestamp() function name Signed-off-by: Karel Zak --- 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 9bf786845..0f202ceaf 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 0c36f8ef6..8c0eb3638 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 */ - if (parse_timestamp(*argv, &x) == 0) + if (ul_parse_timestamp(*argv, &x) == 0) now = (time_t) (x / 1000000); /* cal */ else if ((ctl.req.month = monthname_to_number(&ctl, *argv)) > 0) diff --git a/sys-utils/dmesg.c b/sys-utils/dmesg.c index 0fdfc3c63..8dcf67c94 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 7ae7fca11..5af4d03eb 100644 --- a/sys-utils/hwclock.c +++ b/sys-utils/hwclock.c @@ -1556,7 +1556,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;