Fixed a bashism with trap numbers in hgeditor.
authorJavi Merino <cibervicho@gmail.com>
Tue, 11 May 2010 12:06:30 +0200
changeset 11190 43337076ba9262bc6fd763c149b9f649abc406ff
parent 11189 3ef2572de32f715d51ea67ea2ca0d38d5fad36d8
child 11191 c45a47bc41148b6037cd7337c4529a5e67b92222
push id1
push usergszorc@mozilla.com
push dateWed, 18 Mar 2015 16:34:57 +0000
Fixed a bashism with trap numbers in hgeditor. When using trap in a shell script, it's more portable to use signal names, instead of numbers. Signal names (INT, KILL,...) are defined in POSIX, whereas its corresponding numbers aren't.
hgeditor
--- a/hgeditor
+++ b/hgeditor
@@ -20,17 +20,17 @@ esac
 
 HGTMP=""
 cleanup_exit() {
     rm -rf "$HGTMP"
 }
 
 # Remove temporary files even if we get interrupted
 trap "cleanup_exit" 0 # normal exit
-trap "exit 255" 1 2 3 6 15 # HUP INT QUIT ABRT TERM
+trap "exit 255" HUP INT QUIT ABRT TERM
 
 HGTMP="${TMPDIR-/tmp}/hgeditor.$RANDOM.$RANDOM.$RANDOM.$$"
 (umask 077 && mkdir "$HGTMP") || {
     echo "Could not create temporary directory! Exiting." 1>&2
     exit 1
 }
 
 (