[ovs-dev] [PATCH] stopwatch: Explicitly ignore write() return value.

Ben Pfaff blp at ovn.org
Fri Apr 6 17:28:51 UTC 2018


On Fri, Apr 06, 2018 at 10:16:24AM -0700, Justin Pettit wrote:
> In some environments, builds would fail with the following error:
> 
>   lib/stopwatch.c: In function ‘stopwatch_exit’:
>   lib/stopwatch.c:448:5: error: ignoring return value of ‘write’, declared
>   with attribute warn_unused_result [-Werror=unused-result]
>       write(stopwatch_pipe[1], &pkt, sizeof pkt);
> 
> This patch explicitly ignores the return value of write().
> 
> This also fixes some minor coding style issues.
> 
> Signed-off-by: Justin Pettit <jpettit at ovn.org>

Obviously I didn't review this as carefully as I should have.  That's on
me.  I apologize.

I believe that we already have a proper abstraction for what's going on
here: a latch.  The latch implementation also hides differences between
Unix and Windows (which this inline implementation isn't doing).  Would
you mind making this use latch.h instead of raw pipes?

Would you mind breaking the style issues into a separate commit?

Thanks,

Ben.


More information about the dev mailing list