On Mon, Jun 23, 2014 at 11:51 AM, Ben Pfaff <b...@nicira.com> wrote:
> 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 <gshe...@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).
Okay. I will add the following incremental before pushing it.

diff --git a/tests/test-util.c b/tests/test-util.c
index 093ee9c..202f8d0 100644
--- a/tests/test-util.c
+++ b/tests/test-util.c
@@ -1086,9 +1086,11 @@ test_util_main(int argc, char *argv[])
 {
     set_program_name(argv[0]);
     parse_options(argc, argv);
-#ifdef _WIN32
+    /* On Windows, stderr is fully buffered if connected to a pipe.
+     * Make it _IONBF so that an abort does not miss log contents.
+     * POSIX doesn't define the circumstances in which stderr is
+     * fully buffered either. */
     setvbuf(stderr, NULL, _IONBF, 0);
-#endif
     run_command(argc - optind, argv + optind, commands);
>
>> +#ifdef _WIN32
>> +    setvbuf(stderr, NULL, _IONBF, 0);
>> +#endif
>
> Acked-by: Ben Pfaff <b...@nicira.com>
>
> Thanks,
>
> Ben.
_______________________________________________
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev

Reply via email to