#include "obstack.h"
#include "quote.h"
#include "remove.h"
+#include "root-dev-ino.h"
/* Avoid shadowing warnings because these are functions declared
in dirname.h as well as locals used below. */
error (EXIT_FAILURE, errno, _("cannot lstat %s"),
quote (full_filename (f)));
- /* FIXME: here (if F is a command line argument) is at least one
- place in which we'll have to compare the dev/ino against those
- of `/', in implementing fail-to-remove-root-dir semantics. */
-
if (chdir (f))
{
/* It is much more common that we reach this point for an
return RM_ERROR;
}
+ if (ROOT_DEV_INO_CHECK (x->root_dev_ino, &dir_sb))
+ {
+ ROOT_DEV_INO_WARN (full_filename (dir));
+ return 1;
+ }
+
AD_push (ds, dir, &dir_sb);
AD_INIT_OTHER_MEMBERS ();