{"thread":{"id":"7835","subject":"[PATCH 1/5] remove_subtree(): Use strerror() when possible","startedAt":"2007-04-25T14:17:56Z","lastAt":"2007-04-25T14:17:56Z","messageCount":1,"participants":["Luiz Fernando N. Capitulino"],"isPatch":true,"patchVersion":1,"patchTotal":5},"messages":[{"id":"40404","messageId":"20070425111756.2fb2e870@localhost","threadId":"7835","inReplyTo":null,"subject":"[PATCH 1/5] remove_subtree(): Use strerror() when possible","fromName":"Luiz Fernando N. Capitulino","fromEmail":"lcapitulino@mandriva.com.br","sentAt":"2007-04-25T14:17:56Z","receivedAt":"2007-04-25T14:17:56Z","isPatch":true,"sender":{"key":"lcapitulino@mandriva.com.br","avatar":null},"body":"Signed-off-by: Luiz Fernando N. Capitulino <lcapitulino@mandriva.com.br>\n---\n entry.c |    8 ++++----\n 1 files changed, 4 insertions(+), 4 deletions(-)\n\ndiff --git a/entry.c b/entry.c\nindex 84f7802..b51addb 100644\n--- a/entry.c\n+++ b/entry.c\n@@ -33,7 +33,7 @@ static void remove_subtree(const char *path)\n \tchar *name;\n \t\n \tif (!dir)\n-\t\tdie(\"cannot opendir %s\", path);\n+\t\tdie(\"cannot opendir %s (%s)\", path, strerror(errno));\n \tstrcpy(pathbuf, path);\n \tname = pathbuf + strlen(path);\n \t*name++ = '/';\n@@ -45,15 +45,15 @@ static void remove_subtree(const char *path)\n \t\t\tcontinue;\n \t\tstrcpy(name, de->d_name);\n \t\tif (lstat(pathbuf, &st))\n-\t\t\tdie(\"cannot lstat %s\", pathbuf);\n+\t\t\tdie(\"cannot lstat %s (%s)\", pathbuf, strerror(errno));\n \t\tif (S_ISDIR(st.st_mode))\n \t\t\tremove_subtree(pathbuf);\n \t\telse if (unlink(pathbuf))\n-\t\t\tdie(\"cannot unlink %s\", pathbuf);\n+\t\t\tdie(\"cannot unlink %s (%s)\", pathbuf, strerror(errno));\n \t}\n \tclosedir(dir);\n \tif (rmdir(path))\n-\t\tdie(\"cannot rmdir %s\", path);\n+\t\tdie(\"cannot rmdir %s (%s)\", path, strerror(errno));\n }\n \n static int create_file(const char *path, unsigned int mode)\n-- \n1.5.1.1.320.g1cf2\n"}]}