Re: [ulogd2 PATCH 3/4] ulogd: Use (FILE *)(-1) as dummy logfile when logging to syslog

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

 



Jan Engelhardt wrote:
> On Saturday 2015-05-16 15:37, Felix Janda wrote:
> 
> >-static FILE syslog_dummy;
> >+#define SYSLOG_DUMMY ((FILE *)(-1))
> 
> ^This will likely introduce a "cast to pointer from integer of different 
> size" warning on LP64 targets.
> 
> syslog_dummy = fopen("/dev/null", "w");
> 
> would be, at the cost of one more open fd, a "nice" solution,
> since syslog_dummy is guaranteed to be unique, without making
> any assumptions about any magic value(s) being unused.

This seems seems like a cleaner approach.
Preparing a new patch...

> That, or turn the assumptive macro into
> 	#define SYSLOG_DUMMY ((FILE *)(intptr_t)-1)

Thanks,
Felix
--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Netfitler Users]     [LARTC]     [Bugtraq]     [Yosemite Forum]

  Powered by Linux