author | Alex Riesen <raa.lkml@gmail.com> | |
Wed, 29 Apr 2009 21:21:46 +0000 (23:21 +0200) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Thu, 30 Apr 2009 01:37:41 +0000 (18:37 -0700) | ||
commit | fc71db39e0d75e8a403f36f3fecf4450886cd165 | |
tree | ea69404a0a4afc9417e39e4dcf3e09dca08b4008 | tree | snapshot |
parent | d1c8c0c8c42912eb768a05115c798de50e595f8b | commit | diff |
Introduce an unlink(2) wrapper which gives warning if unlink failed
This seem to be a very common pattern in the current code.
The function prints a generic removal failure message, the file name
which failed and readable errno presentation. The function preserves
errno and always returns the value unlink(2) returned, but prints
no message for ENOENT, as it was the most often filtered out in the
code calling unlink. Besides, removing a file is anyway the purpose of
calling unlink.
Signed-off-by: Alex Riesen <raa.lkml@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This seem to be a very common pattern in the current code.
The function prints a generic removal failure message, the file name
which failed and readable errno presentation. The function preserves
errno and always returns the value unlink(2) returned, but prints
no message for ENOENT, as it was the most often filtered out in the
code calling unlink. Besides, removing a file is anyway the purpose of
calling unlink.
Signed-off-by: Alex Riesen <raa.lkml@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
git-compat-util.h | diff | blob | history | |
wrapper.c | diff | blob | history |