[Tilesathome] Signal handler for tilesgen in loop mode

Scott Walde scott at waldetech.ca
Sat May 26 18:17:27 BST 2007


This patch adds a signal handler to tilesGen.pl that gets enabled in 
loop mode.  It traps SIGINT (ctrl-c) and increments a counter.  The loop 
mode "while" loop is changed to read while($sigintcount==0) instead of 
while(1).  The handler will exit immediately when $sigintcount == 3.  
The end result:

In loop mode, a single Ctrl-C will cause tilesGen.pl to finish the 
current tileset, then exit.  Three ctrl-cs will exit the program now 
with no cleanup instead of finishing.

This is a scratch I've been meaning to itch for a while, but only got 
around to it today.  I hope you find it useful.

Legalese:  This patch is licensed with the same license as tilesGen.pl.

ttyl
srw


-------------- next part --------------
A non-text attachment was scrubbed...
Name: tilesgen_add_sigint_handler.diff
Type: text/x-patch
Size: 1647 bytes
Desc: not available
URL: <http://lists.openstreetmap.org/pipermail/tilesathome/attachments/20070526/18abad23/attachment.bin>


More information about the Tilesathome mailing list