• R/O
  • SSH
  • HTTPS

yash: Commit


Commit MetaInfo

Revision3831 (tree)
Time2018-03-16 00:33:30
Authormagicant

Log Message

enqueue.sh: Ensure to kill itself if interrupted

The trap should be reset before the shell re-sends the interrupting
signal to itself so that the shell is intrinsically killed by the
signal.

The "exit 1" is just in case.

Change Summary

Incremental Difference

--- yash/trunk/tests/enqueue.sh (revision 3830)
+++ yash/trunk/tests/enqueue.sh (revision 3831)
@@ -1,5 +1,5 @@
11 # enqueue.sh: runs a task sequentially
2-# (C) 2015 magicant
2+# (C) 2015-2018 magicant
33 #
44 # This program is free software: you can redistribute it and/or modify
55 # it under the terms of the GNU General Public License as published by
@@ -43,7 +43,9 @@
4343 fi
4444 rm -fr "$tmp_file"
4545 if [ "$interrupted" ]; then
46+ trap - "$interrupted"
4647 kill -s "$interrupted" $$
48+ exit 1
4749 fi
4850 }
4951 trap cleanup EXIT
Show on old repository browser