Re: [Linux-cluster] [PATCH 0/4] fence

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

 



On Fri, 2005-02-18 at 13:28 -0500, Lon Hohberger wrote:
> On Fri, 2005-02-18 at 12:01 +0800, David Teigland wrote:
> 
> > For reference, existing:
> > 
> > #define die(fmt, args...) \
> > do \
> > { \
> > 	fprintf(stderr, "%s: ", prog_name); \
> > 	fprintf(stderr, fmt "\n", ##args); \
> > 	syslog(LOG_ERR, fmt, ##args); \
> > 	exit(EXIT_FAILURE); \
> > } \
> > while (0)

Side note:

#define die(fmt, ...) \
do \
{ \
	fprintf(stderr, "%s: ", prog_name); \
	fprintf(stderr, fmt "\n", __VA_ARGS__); \
	syslog(LOG_ERR, fmt, __VA_ARGS__); \
	exit(EXIT_FAILURE); \
}\
while (0)

...is functionally equivalent, is ISO-C99 compliant (as to opposed to a
"GNUism"), and does not rely on the compiler actually successfully
inlining anything.

-- Lon


[Index of Archives]     [Corosync Cluster Engine]     [GFS]     [Linux Virtualization]     [Centos Virtualization]     [Centos]     [Linux RAID]     [Fedora Users]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite Camping]

  Powered by Linux