Re: some error fixes in signify

2014-01-02 Thread Ted Unangst
On Thu, Jan 02, 2014 at 14:40, Marc Espie wrote:
 Revisiting the error messages:
 - pass the filenames to the low-level functions, so they can tell you
 what's going on.
 
 - FIX readall and writeall. The logic *is* wrong. Just because they
 return something != len, doesn't mean they return -1.

hmm. the intention was to keep the code as small as possible.
a detailed dissection of every error that will never happen runs
somewhat contrary to that goal. it's not like the difference between a
failed write and a short write is meaningful to the user.

the important thing is that it not fail silently. if you need to know
why it failed, ktrace it. :)



Re: some error fixes in signify

2014-01-02 Thread Marc Espie
On Thu, Jan 02, 2014 at 10:36:53AM -0500, Ted Unangst wrote:
 On Thu, Jan 02, 2014 at 14:40, Marc Espie wrote:
  Revisiting the error messages:
  - pass the filenames to the low-level functions, so they can tell you
  what's going on.
  
  - FIX readall and writeall. The logic *is* wrong. Just because they
  return something != len, doesn't mean they return -1.
 
 hmm. the intention was to keep the code as small as possible.
 a detailed dissection of every error that will never happen runs
 somewhat contrary to that goal. it's not like the difference between a
 failed write and a short write is meaningful to the user.

Oh come on, that's a bug, and really poor style.

You're going to call err() when there's no meaningful value in errno ?
That's really a bad example, if nothing else.


There's a difference between small and obnoxiously wrong.
Even if it's a wee bit larger, it doesn't make it less easy to read.



Re: some error fixes in signify

2014-01-02 Thread Ted Unangst
On Thu, Jan 02, 2014 at 16:55, Marc Espie wrote:

 Oh come on, that's a bug, and really poor style.
 
 You're going to call err() when there's no meaningful value in errno ?
 That's really a bad example, if nothing else.

ok, sure, make it errx.

but next somebody is going to want to rewrite it into a loop to handle
nonblocking files, and then somebody adds a timeout, and then comes a
fucking progress meter...