Re: [PATCH v2] clean: use warning_errno() when appropriate

2017-02-14 Thread Jeff King
On Tue, Feb 14, 2017 at 05:28:36PM -0800, Junio C Hamano wrote: > I care more about looking at errno ONLY after we saw our call to a > system library function indicated an error, and I wanted to avoid > doing: > > res = dry_run ? 0 : rmdir(path); > saved_errno = errno; > if

Re: [PATCH v2] clean: use warning_errno() when appropriate

2017-02-14 Thread Junio C Hamano
Duy Nguyen writes: > On Wed, Feb 15, 2017 at 1:13 AM, Junio C Hamano wrote: > ... >> The reason to store the errno in saved_errno here is not because we >> want to help code after "if (res) {...}", but the patch sent as-is >> gives that impression and is

Re: [PATCH v2] clean: use warning_errno() when appropriate

2017-02-14 Thread Duy Nguyen
On Wed, Feb 15, 2017 at 1:13 AM, Junio C Hamano wrote: > Nguyễn Thái Ngọc Duy writes: > >> All these warning() calls are preceded by a system call. Report the >> actual error to help the user understand why we fail to remove >> something. >> >>

Re: [PATCH v2] clean: use warning_errno() when appropriate

2017-02-14 Thread Junio C Hamano
Nguyễn Thái Ngọc Duy writes: > All these warning() calls are preceded by a system call. Report the > actual error to help the user understand why we fail to remove > something. > > Signed-off-by: Nguyễn Thái Ngọc Duy > --- > v2 dances with errno Thanks.

[PATCH v2] clean: use warning_errno() when appropriate

2017-02-14 Thread Nguyễn Thái Ngọc Duy
All these warning() calls are preceded by a system call. Report the actual error to help the user understand why we fail to remove something. Signed-off-by: Nguyễn Thái Ngọc Duy --- v2 dances with errno builtin/clean.c | 19 ++- 1 file changed, 14