Re: [iproute PATCH 51/51] lib/bpf: Check return value of write()

2017-08-15 Thread Daniel Borkmann
On 08/15/2017 02:31 PM, David Laight wrote: [...] WTF is this code doing anyway? write() is a system call, fflush() writes out any data buffered in the stdio stream. If there was anything buffered you'd want to output it earlier. Otherwise if it is going to use fflush() it should be using

RE: [iproute PATCH 51/51] lib/bpf: Check return value of write()

2017-08-15 Thread David Laight
From: Phil Sutter > Sent: 12 August 2017 13:05 > This is merely to silence the compiler warning. If write to stderr > failed, assume that printing an error message will fail as well so don't > even try. > > Signed-off-by: Phil Sutter > --- > lib/bpf.c | 3 ++- > 1 file changed, 2

Re: [iproute PATCH 51/51] lib/bpf: Check return value of write()

2017-08-14 Thread Daniel Borkmann
On 08/14/2017 07:25 PM, Phil Sutter wrote: [...] But I really think we shouldn't make such a fuss about it - writing to stderr either always works or we're in trouble everywhere. This patch was merely to shut gcc up, so no need to waste much energy on a scenario which won't happen anyway. Yup,

Re: [iproute PATCH 51/51] lib/bpf: Check return value of write()

2017-08-14 Thread Phil Sutter
On Mon, Aug 14, 2017 at 11:17:39AM +0200, Daniel Borkmann wrote: > On 08/12/2017 02:05 PM, Phil Sutter wrote: > > This is merely to silence the compiler warning. If write to stderr > > failed, assume that printing an error message will fail as well so don't > > even try. > > > > Signed-off-by:

Re: [iproute PATCH 51/51] lib/bpf: Check return value of write()

2017-08-14 Thread Daniel Borkmann
On 08/12/2017 02:05 PM, Phil Sutter wrote: This is merely to silence the compiler warning. If write to stderr failed, assume that printing an error message will fail as well so don't even try. Signed-off-by: Phil Sutter --- lib/bpf.c | 3 ++- 1 file changed, 2 insertions(+), 1