]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
treewide: add ul_ to parse_timestamp() function name
authorKarel Zak <kzak@redhat.com>
Tue, 13 May 2025 09:32:14 +0000 (11:32 +0200)
committerStanislav Brabec <sbrabec@suse.cz>
Thu, 29 May 2025 15:13:25 +0000 (17:13 +0200)
Signed-off-by: Karel Zak <kzak@redhat.com>
include/timeutils.h
lib/timeutils.c
login-utils/last.c
misc-utils/cal.c
sys-utils/dmesg.c
sys-utils/hwclock.c
sys-utils/rtcwake.c

index e3cd252ba56e7634b6353ac1fa2ed608145eead1..30fa99096a80f8b7303866d75085a3064d9119d6 100644 (file)
@@ -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 */
index f53ec8fee32ef4b7f0e92f273c079ded7317f511..2688f60d71c733cbeb119f5b08953d42e321b202 100644 (file)
@@ -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);
index bdd3750631863f6b9ff489bc9840603cd701e622..25d79e09a7f65ec41238775e71b9395f9ee85900 100644 (file)
@@ -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;
index 0acf042ff63ab68a9dd9257dd60bb587576fa281..05991f9ad2936a5e8b21ccc70ed7292cc0a58d58 100644 (file)
@@ -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)
index dc9a2877ab5eb4a0ad91251e4a5259ab7c441015..cccbd4067b9d378acced70129f4bb72d6c5b9a6e 100644 (file)
@@ -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;
                }
index 9977e0600173b0f1f94bc616af311255d4038767..d42099d758774d68657987252fbafac78ba7ea20 100644 (file)
@@ -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 {
index d384feb64516d8dab37b23e1968d273bf9d7e363..49dab17bdd76d0e55d306c3d9195db672fc22011 100644 (file)
@@ -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;