1
0

proj: Add pid to msg()

This commit is contained in:
2025-04-14 17:05:40 +02:00
parent a738e3ee2b
commit e851f5b90d
5 changed files with 16 additions and 6 deletions

View File

@@ -602,7 +602,7 @@ static void msg(const char *fmt, ...) {
struct timespec spec;
clock_gettime(CLOCK_REALTIME, &spec);
size_t offset = snprintf(buf, sizeof(buf), "%li.%09li ", spec.tv_sec, spec.tv_nsec);
size_t offset = snprintf(buf, sizeof(buf), "%li.%09li %i ", spec.tv_sec, spec.tv_nsec, getpid());
for (char ch, state = 0; (ch = *fmt) != 0 && offset < sizeof(buf); fmt++) {
if (state == '%') {
if (ch == '%') {