Re: [hackers] [sbase] [PATCH 04/10] Don't use buffered IO (fread) when not appropriate

2016-12-06 Thread Silvan Jegen
Hi Laslo On Tue, Dec 6, 2016 at 12:51 PM, Laslo Hunhold wrote: > On Tue, 6 Dec 2016 10:26:22 +0100 > Silvan Jegen wrote: >> It only compiled for me because "util.h" includes stdio.h so the >> definitions are included already. We can still remove this include if >> we don't want it to be included

Re: [hackers] [sbase] [PATCH 04/10] Don't use buffered IO (fread) when not appropriate

2016-12-06 Thread Laslo Hunhold
On Tue, 6 Dec 2016 10:26:22 +0100 Silvan Jegen wrote: Hey Silvan, > It only compiled for me because "util.h" includes stdio.h so the > definitions are included already. We can still remove this include if > we don't want it to be included twice but I don't know which approach > is preferred here

Re: [hackers] [sbase] [PATCH 04/10] Don't use buffered IO (fread) when not appropriate

2016-12-06 Thread Silvan Jegen
On Tue, Dec 6, 2016 at 9:17 AM, Michael Forney wrote: > On Mon, Dec 5, 2016 at 12:15 PM, Silvan Jegen wrote: >> Hi >> >> Some comments below. >> >> On Sun, Dec 04, 2016 at 09:55:06PM -0800, Michael Forney wrote: >>> diff --git a/cksum.c b/cksum.c >>> index 570ca81..b53ec17 100644 >>> --- a/cksum.

Re: [hackers] [sbase] [PATCH 04/10] Don't use buffered IO (fread) when not appropriate

2016-12-06 Thread Michael Forney
On Mon, Dec 5, 2016 at 12:15 PM, Silvan Jegen wrote: > Hi > > Some comments below. > > On Sun, Dec 04, 2016 at 09:55:06PM -0800, Michael Forney wrote: >> diff --git a/cksum.c b/cksum.c >> index 570ca81..b53ec17 100644 >> --- a/cksum.c >> +++ b/cksum.c >> @@ -1,7 +1,9 @@ >> /* See LICENSE file for

Re: [hackers] [sbase] [PATCH 04/10] Don't use buffered IO (fread) when not appropriate

2016-12-05 Thread Silvan Jegen
Hi Some comments below. On Sun, Dec 04, 2016 at 09:55:06PM -0800, Michael Forney wrote: > fread reads the entire requested size (BUFSIZ), which causes tools to > block if only small amounts of data are available at a time. At best, > this causes unnecessary copies and inefficiency, at worst, tool