Index | Thread | Search

From:
Mike <the.lists@mgm51.com>
Subject:
A question about syslogd ...
To:
tech@openbsd.org
Date:
Sun, 27 Apr 2025 23:36:37 -0400

Download raw body.

Thread
  • Mike:

    A question about syslogd ...

With each new OpenBSD version, I patch the syslogd daemon.

Here's the patch I do ...

===============

# cvs diff -u -N syslogd.c syslogd.c
Index: syslogd.c
===================================================================
RCS file: /cvs/src/usr.sbin/syslogd/syslogd.c,v
diff -u -p -u -r1.284 syslogd.c
--- syslogd.c    23 Jan 2025 12:27:42 -0000    1.284
+++ syslogd.c    28 Apr 2025 03:26:40 -0000
@@ -1775,13 +1775,13 @@ current_time(char *timestamp)
          struct tm *tm;
          size_t l;

-        tm = gmtime(&now.tv_sec);
+        tm = localtime(&now.tv_sec);
          l = strftime(timestamp, 33, "%FT%T", tm);
          /*
           * Use only millisecond precision as some time has
           * passed since syslog(3) was called.
           */
-        snprintf(timestamp + l, 33 - l, ".%03ldZ", now.tv_usec / 1000);
+        snprintf(timestamp + l, 33 - l, ".%03ld", now.tv_usec / 1000);
      } else
          strlcpy(timestamp, ctime(&now.tv_sec) + 4, 16);
  }


===========================

The purpose of the patch is to continue the ISO timestamp format of the 
-Z option, but with local time.

So, my question is, let's suppose I'd want to submit a patch for that 
purpose.

Should I use a -L option for that, or should I go with two options, one 
for the ISO format specification, and the other for the time zone to be 
used?