]> sourceware.org Git - lvm2.git/commitdiff
fsadm: make if statement more clear
authorZdenek Kabelac <zkabelac@redhat.com>
Wed, 28 Jun 2017 14:13:29 +0000 (16:13 +0200)
committerZdenek Kabelac <zkabelac@redhat.com>
Thu, 29 Jun 2017 20:23:16 +0000 (22:23 +0200)
scripts/fsadm.sh

index 0db24ad049f8984ada9f9e4d692d31ca65f6ee84..e08862ad7499578eb85fe629b5bee05cbb477508 100755 (executable)
@@ -111,7 +111,7 @@ tool_usage() {
 }
 
 verbose() {
-       test -n "$VERB" && echo "$TOOL:" "$@" || true
+       test -z "$VERB" || echo "$TOOL:" "$@"
 }
 
 # Support multi-line error messages
@@ -423,7 +423,9 @@ try_umount() {
 }
 
 validate_parsing() {
-       test -n "$BLOCKSIZE" && test -n "$BLOCKCOUNT" || error "Cannot parse $1 output."
+       if test -z "$BLOCKSIZE" || test -z "$BLOCKCOUNT" ; then
+               error "Cannot parse $1 output."
+       fi
 }
 ####################################
 # Resize ext2/ext3/ext4 filesystem
@@ -445,7 +447,7 @@ resize_ext() {
        decode_size "$1" "$BLOCKSIZE"
        FSFORCE=$FORCE
 
-       if [ "$NEWBLOCKCOUNT" -lt "$BLOCKCOUNT" -o "$EXTOFF" -eq 1 ]; then
+       if test "$NEWBLOCKCOUNT" -lt "$BLOCKCOUNT" || test "$EXTOFF" -eq 1 ; then
                test "$IS_MOUNTED" -eq 1 && verbose "$RESIZE_EXT needs unmounted filesystem" && try_umount
                REMOUNT=$MOUNTED
                if test -n "$MOUNTED" ; then
This page took 0.035324 seconds and 5 git commands to generate.