Re: [PATCH 04/14] hold_lock_file_for_append: pass error message back through a strbuf

2014-12-02 Thread Jonathan Nieder
Torsten Bögershausen wrote: > On 12/03/2014 06:14 AM, Jonathan Nieder wrote: >> --- a/lockfile.c >> +++ b/lockfile.c >> @@ -179,45 +179,36 @@ int hold_lock_file_for_update(struct lock_file *lk, >> const char *path, int flags) >> return fd; >> } >> -int hold_lock_file_for_append(struct lock

Re: [PATCH 04/14] hold_lock_file_for_append: pass error message back through a strbuf

2014-12-02 Thread Torsten Bögershausen
On 12/03/2014 06:14 AM, Jonathan Nieder wrote: This way, the code does not need to carefully safeguard errno to allow callers to print a reasonable error message when they choose to do some cleanup before die()-ing. Fixes a bug waiting to happen where copy_fd would clobber the errno passed back

[PATCH 04/14] hold_lock_file_for_append: pass error message back through a strbuf

2014-12-02 Thread Jonathan Nieder
This way, the code does not need to carefully safeguard errno to allow callers to print a reasonable error message when they choose to do some cleanup before die()-ing. Fixes a bug waiting to happen where copy_fd would clobber the errno passed back via hold_lock_file_for_append from read() or writ