diff options
author | Jim Meyering <jim@meyering.net> | 2007-06-13 15:53:12 +0200 |
---|---|---|
committer | Jim Meyering <jim@meyering.net> | 2007-06-13 15:53:12 +0200 |
commit | 85c3924ce53c867507e55319cc44c6ffcd847428 (patch) | |
tree | 8c895b490c702767ce7b5ba2bc00dbdf9969e3cc /src/rmdir.c | |
parent | a780166b41f68dbea6d27eea99480708246e7618 (diff) | |
download | coreutils-85c3924ce53c867507e55319cc44c6ffcd847428.tar.xz |
rmdir: give better diagnostics
* src/rmdir.c (remove_parents): Give a more descriptive/consistent
diagnostic upon failure.
(main): Likewise.
Suggestion from Joey Hess.
* THANKS: Add Joey Hess.
Diffstat (limited to 'src/rmdir.c')
-rw-r--r-- | src/rmdir.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/src/rmdir.c b/src/rmdir.c index 5dd5a35a6..ca1af0e4c 100644 --- a/src/rmdir.c +++ b/src/rmdir.c @@ -1,6 +1,6 @@ /* rmdir -- remove directories - Copyright (C) 90, 91, 1995-2002, 2004, 2005, 2006 Free Software + Copyright (C) 90, 91, 1995-2002, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify @@ -31,7 +31,7 @@ #include "system.h" #include "error.h" -#include "quotearg.h" +#include "quote.h" /* The official name of this program (e.g., no `g' prefix). */ #define PROGRAM_NAME "rmdir" @@ -107,7 +107,7 @@ remove_parents (char *dir) /* Give a diagnostic for each attempted removal if --verbose. */ if (verbose) - error (0, 0, _("removing directory, %s"), dir); + error (0, 0, _("removing directory, %s"), quote (dir)); ok = (rmdir (dir) == 0); @@ -121,7 +121,9 @@ remove_parents (char *dir) } else { - error (0, errno, "%s", quotearg_colon (dir)); + /* Barring race conditions, DIR is expected to be a directory. */ + error (0, errno, _("failed to remove directory %s"), + quote (dir)); } break; } @@ -213,7 +215,9 @@ main (int argc, char **argv) && errno_rmdir_non_empty (errno)) continue; - error (0, errno, "%s", quotearg_colon (dir)); + /* Here, the diagnostic is less precise, since we have no idea + whether DIR is a directory. */ + error (0, errno, _("failed to remove %s"), quote (dir)); ok = false; } else if (remove_empty_parents) |