diff options
Diffstat (limited to 'src/journald/LMI_JournalRecordInLogProvider.c')
-rw-r--r-- | src/journald/LMI_JournalRecordInLogProvider.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/journald/LMI_JournalRecordInLogProvider.c b/src/journald/LMI_JournalRecordInLogProvider.c index 9be0f19..33a50e5 100644 --- a/src/journald/LMI_JournalRecordInLogProvider.c +++ b/src/journald/LMI_JournalRecordInLogProvider.c @@ -68,6 +68,7 @@ static CMPIStatus LMI_JournalRecordInLogEnumInstances( int r; CMPIStatus rc; unsigned long count = 0; + char errbuf[STRERROR_BUF_LEN]; LMI_JournalMessageLogRef_Init(&message_log_ref, _cb, ns); LMI_JournalMessageLogRef_Set_CreationClassName(&message_log_ref, LMI_JournalMessageLog_ClassName); @@ -78,12 +79,12 @@ static CMPIStatus LMI_JournalRecordInLogEnumInstances( r = sd_journal_open(&journal, 0); if (r < 0) - KReturn2(_cb, ERR_FAILED, "Error opening journal: %s\n", strerror(-r)); + KReturn2(_cb, ERR_FAILED, "Error opening journal: %s\n", strerror_r(-r, errbuf, sizeof(errbuf))); r = sd_journal_seek_tail(journal); if (r < 0) { sd_journal_close(journal); - KReturn2(_cb, ERR_NOT_FOUND, "Failed to seek to the end of the journal: %s\n", strerror(-r)); + KReturn2(_cb, ERR_NOT_FOUND, "Failed to seek to the end of the journal: %s\n", strerror_r(-r, errbuf, sizeof(errbuf))); } SD_JOURNAL_FOREACH_BACKWARDS(journal) { |