Browse Source

base-files: localize variable in do_move_devtmpfs(), remove extra temporary variable and shorten conditional

SVN-Revision: 22380
Jo-Philipp Wich 15 years ago
parent
commit
9bf9ea9802
1 changed files with 3 additions and 6 deletions
  1. 3 6
      package/base-files/files/lib/preinit/20_device_fs_mount

+ 3 - 6
package/base-files/files/lib/preinit/20_device_fs_mount

@@ -3,13 +3,10 @@
 # Copyright (C) 2010 Vertical Communications
 # Copyright (C) 2010 Vertical Communications
 
 
 do_move_devtmpfs() {
 do_move_devtmpfs() {
-    foo="`grep devtmpfs /proc/mounts`"
-    x=${foo#* }
-    x=${x%% *}
+    local mnt="$(grep devtmpfs /proc/mounts)"
+          mnt="${mnt#* }"; mnt="${mnt%% *}"
 
 
-    if [ "$x" != "/dev" ] ; then
-	mount -o move "$x" /dev
-    fi
+    [ "$mnt" = "/dev" ] || mount -o move "$mnt" /dev
 }
 }
 
 
 do_mount_devfs() {
 do_mount_devfs() {