[PATCH] suggestion : flush outputs in wpa_printf

Dan Williams dcbw
Tue Feb 3 08:42:19 PST 2009


On Tue, 2009-02-03 at 17:23 +0100, Annie Rota wrote:
> Hi all,
> In order to improve interprocess readability between wpa_supplicant
> and clients of the control interface, 
> I propose to fflush the outputs of wpa_printf more often (especially
> stdout).

Jouni,

I carry a similar patch in Fedora too, so that when debugging is on the
logs actually reflect what has recently happened.  Default buffering
rules vary somewhat, leading to situations where the wpa_supplicant log
output was stalled for a long time waiting for the buffer to fill up
before being flushed out to the file.  The fedora patch is attached.

Dan


> Regards,
> 
> *** wpa_debug.c.old    2009-01-06 19:11:16.000000000 +0100
> --- wpa_debug.c    2009-02-03 16:51:52.000000000 +0100
> *************** void wpa_printf(int level, char *fmt, ..
> *** 67,76 ****
> --- 67,78 ----
>           if (out_file) {
>               vfprintf(out_file, fmt, ap);
>               fprintf(out_file, "\n");
> +             fflush(out_file),
>           } else {
>   #endif /* CONFIG_DEBUG_FILE */
>           vprintf(fmt, ap);
>           printf("\n");
> +         fflush(stdout);
>   #ifdef CONFIG_DEBUG_FILE
>           }
>   #endif /* CONFIG_DEBUG_FILE */
> 
> _______________________________________________
> HostAP mailing list
> HostAP at lists.shmoo.com
> http://lists.shmoo.com/mailman/listinfo/hostap
-------------- next part --------------
A non-text attachment was scrubbed...
Name: wpa_supplicant-0.5.7-flush-debug-output.patch
Type: text/x-patch
Size: 1549 bytes
Desc: not available
Url : http://lists.shmoo.com/pipermail/hostap/attachments/20090203/193b15c1/attachment.bin 



More information about the Hostap mailing list