<html>
<head>
<base href="https://bugs.freedesktop.org/" />
</head>
<body>
<p>
<div>
<b><a class="bz_bug_link
bz_status_NEEDINFO "
title="NEEDINFO --- - syslog()-calls just before a program exit are not be recorded in the journal DB"
href="https://bugs.freedesktop.org/show_bug.cgi?id=69934#c2">Comment # 2</a>
on <a class="bz_bug_link
bz_status_NEEDINFO "
title="NEEDINFO --- - syslog()-calls just before a program exit are not be recorded in the journal DB"
href="https://bugs.freedesktop.org/show_bug.cgi?id=69934">bug 69934</a>
from <span class="vcard"><a class="email" href="mailto:martin@thesofty.de" title="Martin <martin@thesofty.de>"> <span class="fn">Martin</span></a>
</span></b>
<pre>Yes I think so. I wrote a small test program. When I write the syslog() without
an delay before the exit of the program, the message will not be logged.
With an sleep(1); statement before the program exit, the message is logged.
I watched the journal with
$ journal -f
while running the test-program.
My simple test program looks like this:
#include <stdio.h>
#include <stdlib.h>
#include <syslog.h>
int main()
{
FILE *pf;
/* logging made in file /var/log/syslog */
openlog("martins",LOG_CONS,LOG_USER);
pf = fopen("not_here","r");
if (!pf)
syslog(LOG_CRIT | LOG_USER,"oops -- %m\n");
//sleep(1);
//closelog();
//int i;
//for (i=0;i<1000000;i++) ;
exit(EXIT_FAILURE);
return 0;
}
As you can see, I also experimented with some alternatives of the sleep(1),
etc.</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are the QA Contact for the bug.</li>
<li>You are the assignee for the bug.</li>
</ul>
</body>
</html>