[ovs-dev] [PATCH v2 3/7] test-util: Changes for 'assert' test on Windows.

Ben Pfaff blp at nicira.com
Mon Jun 23 18:51:28 UTC 2014


On Fri, Jun 13, 2014 at 07:40:02AM -0700, Gurucharan Shetty wrote:
> There is no 'kill -l' type functionality available on Windows.
> So instead of looking for the string 'ABRT', check for the exit
> code in both platforms. On msys (unit test environment), it is 9
> and on Linux, it is 134 (SIGABRT + 128).
> 
> On Windows, stderr is fully buffered if connected to a pipe.
> Make it _IONBF so that an abort does not miss log contents.
> 
> Signed-off-by: Gurucharan Shetty <gshetty at nicira.com>

Can we add a comment about why we're un-buffering stderr here?  Also I
think we might as well just do it unconditionally (not just on
Windows) because POSIX doesn't define the circumstances in which
stderr is fully buffered (it predicates it on what is an "interactive
device" but doesn't define that term).

> +#ifdef _WIN32
> +    setvbuf(stderr, NULL, _IONBF, 0);
> +#endif

Acked-by: Ben Pfaff <blp at nicira.com>

Thanks,

Ben.



More information about the dev mailing list