Skip to contentSkip to conversation

change file descriptor for flock locking

PATCH In review Harald Hoyer 1 participant 1 message May 15, 2009

lore
Share & tools
lore
#0 lore raw

PATCH 6/11 change file descriptor for flock locking

dash does not like filedescriptors > 9

---
 modules.d/90crypt/cryptroot-ask.sh |    6 +++---
 modules.d/99base/init              |    5 +----
 2 files changed, 4 insertions(+), 7 deletions(-)
modules.d/90crypt/cryptroot-ask.sh +3 -3
index 499f586..48cc0f7 100755
@@ -1,8 +1,8 @@
 #!/bin/sh
 
 [ -b /dev/mapper/$2 ] && exit 0
-(
-	flock -s 200
+{
+	flock -s 9
 	/sbin/cryptsetup luksOpen -T1 $1 $2 </dev/console >/dev/console 2>&1
-) 200>/.console.lock
+} 9>/.console.lock
 
modules.d/99base/init +1 -4
index fbfad05..ce26de6 100755
@@ -79,10 +79,7 @@ while :; do
 
     sleep 0.5
     i=$(($i+1))
-    (
-    	flock -s 200
-	[ $i -gt 20 ] && emergency_shell
-    ) 200>/.console_lock
+    { flock -s 9 ; [ $i -gt 20 ] && emergency_shell; } 9>/.console_lock
 done
 
 # pre pivot scripts are sourced just before we switch over to the new root.