Skip Menu |
 

This queue is for tickets about the Sys-Syslog CPAN distribution.

Report information
The Basics
Id: 44410
Status: resolved
Priority: 0/
Queue: Sys-Syslog

People
Owner: Nobody in particular
Requestors: info [...] gknw.de
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: 0.28



Subject: Syslog.pm does not match Syslog.xs for LOG_UPTO usage
Date: Thu, 19 Mar 2009 01:59:26 +0100
To: bug-Sys-Syslog [...] rt.cpan.org
From: Guenter Knauf <info [...] gknw.de>
Download (untitled) / with headers
text/plain 838b
Hi, While Syslog.xs has a conditional for LOG_UPTO at line 95ff, Syslog.pm uses it unconditionally at line 98; this renders the whole module useless when the LOG_UPTO macro is not defined in the OS headers: perl -mSys::Syslog -e 'print $Sys::Syslog::VERSION' Your vendor has not defined the Sys::Syslog macro LOG_UPTO at sys:\perl\lib/Sys/Syslog.pm line 98. I think if Syslog.pm requires LOG_UPTO from Syslog.xs then its nonsense to have a conditonal in the xs file which checks for presense of the LOG_UPTO macro - why should I build a module only for having it croak directly when it loads? Then its far better that it breaks at compile time so I know that the module isnt usable at all. Either make compilation break when mandatory system header macros are missing, or rewrite Syslog.pm so that they are not mandatory. Thanks, Guen.
Subject: Re: [rt.cpan.org #44410] Syslog.pm does not match Syslog.xs for LOG_UPTO usage
Date: Thu, 19 Mar 2009 09:01:10 +0100
To: bug-Sys-Syslog [...] rt.cpan.org
From: Sébastien Aperghis-Tramoni <saper [...] cpan.org>
Download (untitled) / with headers
text/plain 680b
Guenter Knauf wrote via RT: Show quoted text
> Hi, > While Syslog.xs has a conditional for LOG_UPTO at line 95ff, Syslog.pm > uses it unconditionally at line 98; this renders the whole module > useless when the LOG_UPTO macro is not defined in the OS headers: > perl -mSys::Syslog -e 'print $Sys::Syslog::VERSION' > Your vendor has not defined the Sys::Syslog macro LOG_UPTO at > sys:\perl\lib/Sys/Syslog.pm line 98.
What is your system? I never saw a system where LOG_UPTO() isn't defined, and I never saw such an error in CPAN Testers reports: » http://bbbike.radzeit.de/~slaven/cpantestersmatrix.cgi?dist=Sys- Syslog -- Sébastien Aperghis-Tramoni Close the world, txEn eht nepO.
Subject: Re: [rt.cpan.org #44410] Syslog.pm does not match Syslog.xs for LOG_UPTO usage
Date: Sat, 21 Mar 2009 14:20:57 +0100
To: bug-Sys-Syslog [...] rt.cpan.org
From: Guenter Knauf <info [...] gknw.de>
Download (untitled) / with headers
text/plain 1.6k
Hi Sébastien, Sébastien Aperghis-Tramoni via RT schrieb: Show quoted text
Show quoted text
> What is your system? I never saw a system where LOG_UPTO() isn't > defined, and I never saw such an error in CPAN Testers reports: > » http://bbbike.radzeit.de/~slaven/cpantestersmatrix.cgi?dist=Sys- > Syslog
The system is Novell NetWare, and LOG_UPTO() is definitely missing in the system headers; however that's not the point: if I would get aware of the fact that LOG_UPTO() is mandatory for Sys::Syslog to get it working already during build stage I would either decide to fix the headers myself and add this macro, or to exclude Sys::Syslog from the build; but now the situation is that I can just build fine but end up with an unusable module, and find this only at testing/usage stage. So I would suggest that you change the check for LOG_UPTO defined in Syslog.xs to something like: #ifndef LOG_UPTO #error LOG_UPTO is mandatory for Sys::Syslog and it doesnt work without! #endif The croak() which is currently in the code would only make sense if I would be able to use other functionality of Sys::Syslog which dont rely on LOG_UPTO, but this is appearently not the case since it croaks already when loading only. Furthermore I guess that same goes for LOG_MASK, so probably best would be something like that directly at the beginning of Syslog.xs: /* LOG_MASK and LOG_UPTO macros are mandatory for this module! */ #if !defined(LOG_UPTO) || !defined(LOG_MASK) #error LOG_MASK and LOG_UPTO are mandatory for Sys::Syslog and this module does not work without these macros defined! #endif Then also the code would be more clean, and free of unnecessary ifdefs in the middle of the code. Guenter.
Subject: Re: [rt.cpan.org #44410] Syslog.pm does not match Syslog.xs for LOG_UPTO usage
Date: Wed, 25 Mar 2009 01:32:06 +0100
To: bug-Sys-Syslog [...] rt.cpan.org
From: Sébastien Aperghis-Tramoni <saper [...] cpan.org>
Hello, Guenter Knauf wrote via RT: Show quoted text
> Sébastien Aperghis-Tramoni via RT schrieb: >
>> What is your system? I never saw a system where LOG_UPTO() isn't >> defined, and I never saw such an error in CPAN Testers reports:
> > The system is Novell NetWare, and LOG_UPTO() is definitely missing in > the system headers; however that's not the point: if I would get aware > of the fact that LOG_UPTO() is mandatory for Sys::Syslog to get it > working already during build stage I would either decide to fix the > headers myself and add this macro, or to exclude Sys::Syslog from the > build; but now the situation is that I can just build fine but end up > with an unusable module, and find this only at testing/usage stage. > [..] > Then also the code would be more clean, and free of unnecessary ifdefs > in the middle of the code.
It's then just simpler to #define the macros if they are not available, and indeed rip off the #ifdef from the main code. » http://svnweb.mongueurs.net/Sys-Syslog/revision/?rev=250 -- Sébastien Aperghis-Tramoni Close the world, txEn eht nepO.


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.