Re: [PATCH] add strerror(errno) to die() calls where applicable

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

 



On Thu, Jun 04, 2009 at 05:58:14AM +0400, Alexander Potashev wrote:

> I was also thinking (about 1 month ago) about a helper function
> similar to your 'diesys', but I never thought that adding yet another
> "backend" function (diesys_routine) is reasonable.
> 
> Following your approach, you will need to add 'set_diesys_routine' and
> call it along with 'set_die_routine' (however, if you want to use
> 'diesys', but there are several places in 'daemon.c' and
> 'fast-import.c' where 'die' is being used to write 'strerror(errno)').

Yeah, I didn't look into who is actually using set_die_routine, but
adding another routine like this makes it a lot more annoying for
git-daemon to use it. So I think your approach is probably better,
though I have a few comments on the patch itself (which I'll put in the
next mail).

-Peff

PS Actually, the nicest interface IMHO would be a variadic macro
like:

  #define diesys(fmt, ...) die(fmt ": %s", __VA_ARGS__, strerror(errno))

but that requires a c99 compiler, which we otherwise do not need.
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]