From: Pascal J.B. <pj...@in...> - 2005-05-09 18:15:17
|
Sam Steingold writes: > do you know what happens when ident==NULL is passed to openlog? The standard doesn't evision such an occurence: http://www.opengroup.org/onlinepubs/007908799/xsh/openlog.html "The ident argument is a string that is prepended to every message." But glibc openlog man page indicates that: The use of openlog() is optional; it will automatically be called by syslog() if necessary, in which case ident will default to NULL. and notes: The parameter ident in the call of openlog() is probably stored as-is. Thus, if the string it points to is changed, syslog() may start prepending the changed string, and if the string it points to ceases to exist, the results are undefined. Most portable is to use a string constant. So we can guess that passing NULL as ident to openlog would work with glibc, but this is not prudent to pass NULL to openlog. If the user wants the default ident, he should not call openlog. -- __Pascal Bourguignon__ http://www.informatimago.com/ The world will now reboot. don't bother saving your artefacts. |