Skip to content

Commit 398653d

Browse files
committed
fmt_info_messages: The log source may not be present
For legacy I/O log files there is no source info. It is only present in the JSON-format I/O log info files.
1 parent 22bd112 commit 398653d

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

logsrvd/sendlog.c

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -606,7 +606,10 @@ fmt_info_messages(const struct eventlog *evlog, char *hostname,
606606
n++; \
607607
} while (0)
608608

609-
/* Fill in info_msgs */
609+
/*
610+
* Fill in info_msgs. For legacy I/O log files, only command, runargv,
611+
* runuser, submitcwd, submithost, submituser, ttyname may be present.
612+
*/
610613
n = 0;
611614
fill_num("columns", evlog->columns);
612615
fill_str("command", evlog->command);
@@ -631,7 +634,9 @@ fmt_info_messages(const struct eventlog *evlog, char *hostname,
631634
fill_num("runuid", evlog->runuid);
632635
}
633636
fill_str("runuser", evlog->runuser);
634-
fill_str("source", evlog->source);
637+
if (evlog->source != NULL) {
638+
fill_str("source", evlog->source);
639+
}
635640
fill_str("submitcwd", evlog->cwd);
636641
fill_str("submithost", hostname);
637642
fill_str("submituser", evlog->submituser);

0 commit comments

Comments
 (0)