Skip to contentSkip to conversation

busybox compat: use stat -c instead of stat --format

PATCH In review Ari Sundholm 2 participants 2 messages Aug 25, 2015 – Aug 26, 2015

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 busybox compat: use stat -c instead of stat --format

From: Ari Sundholm <[email protected]>

---
 tests/generic/040 |    4 ++--
 tests/generic/041 |    2 +-
 tests/generic/104 |    4 ++--
 3 files changed, 5 insertions(+), 5 deletions(-)
tests/generic/040 +2 -2
index c841fbc..b44a433 100755
@@ -122,9 +122,9 @@ _mount_flakey
 # The fstests framework automatically calls fsck after a test is run, so we
 # don't need to call fsck explicitly here.
 
-echo "Link count before rm foo_link_*: $(stat --format=%h $SCRATCH_MNT/foo)"
+echo "Link count before rm foo_link_*: $(stat -c %h $SCRATCH_MNT/foo)"
 rm -f $SCRATCH_MNT/foo_link_*
-echo "Link count after rm foo_link_*: $(stat --format=%h $SCRATCH_MNT/foo)"
+echo "Link count after rm foo_link_*: $(stat -c %h $SCRATCH_MNT/foo)"
 cat $SCRATCH_MNT/foo
 
 status=0
tests/generic/041 +1 -1
index f38b662..50fb26f 100755
@@ -116,7 +116,7 @@ _mount_flakey
 # the hard links and read the file's data. This is just to verify we don't
 # get stale file handle errors (due to dangling directory index entries that
 # point to inodes that no longer exist).
-echo "Link count: $(stat --format=%h $SCRATCH_MNT/foo)"
+echo "Link count: $(stat -c %h $SCRATCH_MNT/foo)"
 [ -f $SCRATCH_MNT/foo ] || echo "Link foo is missing"
 for ((i = 1; i <= 3003; i++)); do
 	name=foo_link_`printf "%04d" $i`
tests/generic/104 +2 -2
index eeb7363..fef3583 100755
@@ -81,8 +81,8 @@ _load_flakey_table $FLAKEY_ALLOW_WRITES
 _mount_flakey
 
 # Now verify both our files have a link count of 2.
-echo "Link count for file foo: $(stat --format=%h $SCRATCH_MNT/testdir/foo)"
-echo "Link count for file bar: $(stat --format=%h $SCRATCH_MNT/testdir/bar)"
+echo "Link count for file foo: $(stat -c %h $SCRATCH_MNT/testdir/foo)"
+echo "Link count for file bar: $(stat -c %h $SCRATCH_MNT/testdir/bar)"
 
 # We should be able to remove all the links of our files in testdir, and after
 # that the parent directory should become empty and therefore possible to
Signature · 1 line
1.7.10.4
Reviewed-by on v1 1/1
#1 lore raw
Quoted 3 lines · Ari Sundholm

From: Ari Sundholm <[email protected]>

Looks good to me.

Quoted 58 lines
---
 tests/generic/040 |    4 ++--
 tests/generic/041 |    2 +-
 tests/generic/104 |    4 ++--
 3 files changed, 5 insertions(+), 5 deletions(-)
tests/generic/040 +2 -2
index c841fbc..b44a433 100755
@@ -122,9 +122,9 @@ _mount_flakey
 # The fstests framework automatically calls fsck after a test is run, so we
 # don't need to call fsck explicitly here.
 
-echo "Link count before rm foo_link_*: $(stat --format=%h $SCRATCH_MNT/foo)"
+echo "Link count before rm foo_link_*: $(stat -c %h $SCRATCH_MNT/foo)"
 rm -f $SCRATCH_MNT/foo_link_*
-echo "Link count after rm foo_link_*: $(stat --format=%h $SCRATCH_MNT/foo)"
+echo "Link count after rm foo_link_*: $(stat -c %h $SCRATCH_MNT/foo)"
 cat $SCRATCH_MNT/foo
 
 status=0
tests/generic/041 +1 -1
index f38b662..50fb26f 100755
@@ -116,7 +116,7 @@ _mount_flakey
 # the hard links and read the file's data. This is just to verify we don't
 # get stale file handle errors (due to dangling directory index entries that
 # point to inodes that no longer exist).
-echo "Link count: $(stat --format=%h $SCRATCH_MNT/foo)"
+echo "Link count: $(stat -c %h $SCRATCH_MNT/foo)"
 [ -f $SCRATCH_MNT/foo ] || echo "Link foo is missing"
 for ((i = 1; i <= 3003; i++)); do
 	name=foo_link_`printf "%04d" $i`
tests/generic/104 +2 -2
index eeb7363..fef3583 100755
@@ -81,8 +81,8 @@ _load_flakey_table $FLAKEY_ALLOW_WRITES
 _mount_flakey
 
 # Now verify both our files have a link count of 2.
-echo "Link count for file foo: $(stat --format=%h $SCRATCH_MNT/testdir/foo)"
-echo "Link count for file bar: $(stat --format=%h $SCRATCH_MNT/testdir/bar)"
+echo "Link count for file foo: $(stat -c %h $SCRATCH_MNT/testdir/foo)"
+echo "Link count for file bar: $(stat -c %h $SCRATCH_MNT/testdir/bar)"
 
 # We should be able to remove all the links of our files in testdir, and after
 # that the parent directory should become empty and therefore possible to
Signature · 7 lines
1.7.10.4


--
To unsubscribe from this list: send the line "unsubscribe fstests" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html