[BusyBox] [PATCH] devfsd - last minute fix n2
Allen Chan
allen at developers.alyz.com
Fri Nov 19 22:24:23 UTC 2004
This revised patch does not fix the original problem. This is because
the error message is generated during the bb_verror_msg() call inside
msg_logger(), so that errno must be restored before bb_verror_msg()
is called in order to not generate the false error message.
On Friday 19 November 2004 04:52 pm, Tito wrote:
> Ops ,
> one more last minute fix. ;-)
> Hope is the last one for today.
>
> Ciao,
> Tito
> diff -uN miscutils/devfsd_orig.c miscutils/devfsd.c
> --- miscutils/devfsd_orig.c 2004-11-19 21:30:36.000000000 +0100
> +++ miscutils/devfsd.c 2004-11-19 22:45:41.745316672 +0100
> @@ -306,22 +306,26 @@
> #if defined(CONFIG_DEVFSD_VERBOSE) || defined(CONFIG_DEBUG)
> static void msg_logger(int die, int pri, const char * fmt, ... )
> {
> + int errno_save = errno;
> va_list ap;
>
> va_start(ap, fmt);
> - if (access ("/dev/log", F_OK) == 0)
> - {
> + if (access ("/dev/log", F_OK) == 0) {
> openlog(bb_applet_name, 0, LOG_DAEMON);
> vsyslog( pri , fmt , ap);
> closelog();
> - }
> -#ifndef CONFIG_DEBUG
> - else
> -#endif
> +#ifndef CONFIG_DEBUG
> + } else {
> bb_verror_msg(fmt, ap);
> + }
> +#else
> + }
> + bb_verror_msg(fmt, ap);
> +#endif
> va_end(ap);
> if(die==DIE)
> exit(EXIT_FAILURE);
> + errno = errno_save;
> }
> #endif
>
> ----- end of patch -----
--
Allen Chan
allen at developers.alyz.com
http://www.alyz.com
More information about the busybox
mailing list