]> 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)
committerKarel Zak <kzak@redhat.com>
Tue, 13 May 2025 09:32:14 +0000 (11:32 +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 9bf7868459047b33379ac909bad10bf842255957..0f202ceaf03f162023d4a96e7622a578094bafcd 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 0c36f8ef6bbd600227fb863826c6101798a745e4..8c0eb36384e6ba18a34e2a32417303252ab5ab5c 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 0fdfc3c63bad1ef51563f8f1745c745a87707e2d..8dcf67c9425dfb870a95b8e2ee22dd84f86325b1 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 7ae7fca11892b2480723e2dccdc0abc2533cc734..5af4d03ebd81e3e367ad17c9d26ac98b91ac870e 100644 (file)
@@ -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 {
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;