* tests/install/basic-1: Skip the latter part of this test if the
[coreutils.git] / lib / root-dev-ino.h
blobad38f7635459fd6b49cdc46f8cfe22eb3019dcd1
1 /* Root device and inode number checking.
3 Copyright (C) 2003, 2006 Free Software Foundation, Inc.
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2, or (at your option)
8 any later version.
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software Foundation,
17 Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
19 #ifndef ROOT_DEV_INO_H
20 # define ROOT_DEV_INO_H 1
22 # include "dev-ino.h"
23 # include "same-inode.h"
25 struct dev_ino *
26 get_root_dev_ino (struct dev_ino *root_d_i);
28 /* These macros are common to the programs that support the
29 --preserve-root and --no-preserve-root options. */
31 # define ROOT_DEV_INO_CHECK(Root_dev_ino, Dir_statbuf) \
32 (Root_dev_ino && SAME_INODE (*Dir_statbuf, *Root_dev_ino))
34 # define ROOT_DEV_INO_WARN(Dirname) \
35 do \
36 { \
37 if (STREQ (Dirname, "/")) \
38 error (0, 0, _("it is dangerous to operate recursively on %s"), \
39 quote (Dirname)); \
40 else \
41 error (0, 0, \
42 _("it is dangerous to operate recursively on %s (same as %s)"), \
43 quote_n (0, Dirname), quote_n (1, "/")); \
44 error (0, 0, _("use --no-preserve-root to override this failsafe")); \
45 } \
46 while (0)
48 #endif