summaryrefslogtreecommitdiff
path: root/tests/df/no-mtab-status.sh
diff options
context:
space:
mode:
authorIgor Pashev <pashev.igor@gmail.com>2014-09-30 18:22:54 +0400
committerIgor Pashev <pashev.igor@gmail.com>2014-09-30 18:22:54 +0400
commit08bc9e01c274a01d107b348f921e1c74dd04bd3a (patch)
tree25348bff03c29d9dd6c6dd96bf82c7c9f9265ccf /tests/df/no-mtab-status.sh
parentb9c7373f203ab77c58cb6b131f8b58236ea337a2 (diff)
parentc18578632fd3c9e513e613a86ba2b7c4ebee6c45 (diff)
downloadcoreutils-08bc9e01c274a01d107b348f921e1c74dd04bd3a.tar.gz
Merge tag 'upstream/8.23'
Upstream version 8.23
Diffstat (limited to 'tests/df/no-mtab-status.sh')
-rwxr-xr-xtests/df/no-mtab-status.sh13
1 files changed, 10 insertions, 3 deletions
diff --git a/tests/df/no-mtab-status.sh b/tests/df/no-mtab-status.sh
index 896a9fe5..9ea2036d 100755
--- a/tests/df/no-mtab-status.sh
+++ b/tests/df/no-mtab-status.sh
@@ -2,7 +2,7 @@
# Test df's behaviour when the mount list cannot be read.
# This test is skipped on systems that lack LD_PRELOAD support; that's fine.
-# Copyright (C) 2012-2013 Free Software Foundation, Inc.
+# Copyright (C) 2012-2014 Free Software Foundation, Inc.
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -19,9 +19,16 @@
. "${srcdir=.}/tests/init.sh"; path_prepend_ ./src
print_ver_ df
+require_gcc_shared_
df || skip_ "df fails"
+grep '^#define HAVE_MNTENT_H 1' $CONFIG_HEADER > /dev/null \
+ || skip_ "no mntent.h available to confirm the interface"
+
+grep '^#define HAVE_GETMNTENT 1' $CONFIG_HEADER > /dev/null \
+ || skip_ "getmntent is not used on this system"
+
# Simulate "mtab" failure.
cat > k.c <<'EOF' || framework_failure_
#include <stdio.h>
@@ -44,8 +51,8 @@ struct mntent *getmntent (FILE *fp)
EOF
# Then compile/link it:
-$CC -shared -fPIC -ldl -O2 k.c -o k.so \
- || skip_ "getmntent hack does not work on this platform"
+gcc_shared_ k.c k.so \
+ || framework_failure_ 'failed to build shared library'
# Test if LD_PRELOAD works:
LD_PRELOAD=./k.so df