[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Hamm bug: syslog() does not work together with libstdc++



On Fri, Mar 06, 1998 at 07:48:06PM +0100, Farzad FARID wrote:

> development environment is Debian hamm with libc6 version 2.0.7pre1-2 and
> libg++272 version 2.7.2.8-0.1.
>  If I link my C++ program without any g++ libraries syslog works.
>  If I link my C++ program with '-lstdc++' syslog does not work at all...
> 
>  Here is a sample program I wrote to demonstrate the bug :
> 
> test-syslog.cc:
> #include <syslog.h> 
>  
> int main(int argc, char **argv) { 
>     if (argc == 1) 
>         return 0; 
>     openlog(argv[0], LOG_PID, 0); 
>  
>     for (++argv ; *argv ; ++argv) 
>         syslog(LOG_LOCAL0 | LOG_NOTICE, *argv); 
>     return 0; 
> } 
> 
> If it is compiled with 'gcc -o test-syslog test-syslog.cc' the program
> will correctly write its parameters to the syslog files.
> 
> If I use the command 'gcc -o test-syslog test-syslog.cc -lstdc++' it
> won't...
> 
>  Can anyone tell me where the problem is and how I can solve it? Is this a
> libc6 or libg++ bug?

Afaik this doesn't work.  Take a look at the manpage:

       void syslog( int priority, char *format, ...)

Now look what you've given them?

priority logical_OR facility
  as first argument


Let's take a look at the openlog() function:

       void openlog( char *ident, int option, int  facility)

Do we have  facility with the numerical value of zero?  I doubt.

Regards,

	Joey

-- 
  / Martin Schulze  *  joey@infodrom.north.de  *  26129 Oldenburg /
 /                                     http://home.pages.de/~joey/
/  VFS: no free i-nodes, contact Linus  -- finlandia, Feb '94   /


--
E-mail the word "unsubscribe" to debian-user-request@lists.debian.org
TO UNSUBSCRIBE FROM THIS MAILING LIST. Trouble?  E-mail to listmaster@debian.org .


Reply to: