From: William K. V. <wk...@us...> - 2006-09-13 22:03:36
|
Hi Zoltan, On Wed, 2006-09-13 at 15:51, Zoltan Boszormenyi wrote: > the code in rpdf specifically opens a disk file, > and read() returning 0 usually means > end of file. And rpdf doesn't use O_NONBLOCK > on the file it opens, so this case might be an error, > e.g. someone truncated the file while you were > reading it. It's best to stop reading and treat it > as an error. Ahh...your right. I've been programming mostly with O_NONBLOCK lately so run into read returning zero all the time, and having to check EOF explicitly. Sorry for the noise. Cheers, William. >=20 > Best regards, > Zolt=C3=A1n >=20 > William K. Volkman =C3=ADrta: > > Hi, > > Sorry, I should have said something earlier. The > > system calls of "read" or "write" returning zero is not an > > error (they return "-1", which necessitated the ssize_t type), > > so the comparisons should have been ">=3D 0". In practice > > it rarely happens unless you are doing network programming, > > during network congestion you will frequently get a "0" > > return. I didn't supply a patch however if you'd like I > > can. > > > > HTH, > > William. > > > > On Wed, 2006-09-13 at 13:39, Bob Doan wrote: > > =20 > >> Actually you can't subtract size in that routine like that because i= t > >> will cause stuff below to fail and no images will make it to the rep= ort. > >> > >> Attached is my version of it (committed) > >> On Sun, 2006-09-10 at 11:06 +0200, Zoltan Boszormenyi wrote: > >> =20 > >>> the stricter compiler and function attributes > >>> on Fedora Core 6 Test3 gave me warnings > >>> in rpdf, which turn out to be real bugs: > >>> ignored value returned by read() and write() > >>> can cause incomplete picture file read-in in > >>> rpdf/rpdf.c or incomplete PDF writeout > >>> rpdf/test.c. Also, a static function rpdf_error() > >>> isn't used anywhere, I made it inaccessible > >>> to the preprocessor with #if 0 for now. > >>> > >>> =20 > > > > > > > > ---------------------------------------------------------------------= ---- > > Using Tomcat but need to do more? Need to support web services, secur= ity? > > Get stuff done quickly with pre-integrated technology to make your jo= b easier > > Download IBM WebSphere Application Server v.1.0.1 based on Apache Ger= onimo > > http://sel.as-us.falkag.net/sel?cmd=3Dlnk&kid=3D120709&bid=3D263057&d= at=3D121642 > > _______________________________________________ > > Rlib-devel mailing list > > Rli...@li... > > https://lists.sourceforge.net/lists/listinfo/rlib-devel > > > > =20 |