# HG changeset patch # User Matti Hamalainen # Date 1310460196 -10800 # Node ID 2e1e5d2d4ce7016bc6392292805977470dfb8d92 # Parent bb9c5005805e87f99fc64f606aa9dcd1a15c478f rpouch: Fix the occasional "tfclose: : bad handle" error when handling random containers. diff -r bb9c5005805e -r 2e1e5d2d4ce7 gm-rpouch.tf --- a/gm-rpouch.tf Sat Jul 09 11:34:55 2011 +0300 +++ b/gm-rpouch.tf Tue Jul 12 11:43:16 2011 +0300 @@ -26,10 +26,14 @@ /set rpouch_get=0 /set rpouch_regs= -/def -i -F -msimple -t"It is labeled as 'pussi'." grpouch_fgrab =\ +/def -i grpouch_close =\ /if (rpouch_save!~"" & rpouch_save >= 0)\ /test tfclose(rpouch_save)%;\ - /endif%;\ + /set rpouch_save=-1%;\ + /endif + +/def -i -F -msimple -t"It is labeled as 'pussi'." grpouch_fgrab =\ + /grpouch_close%;\ /set rpouch_save=$[tfopen(strcat(HOME,"/public_html/reagents.txt"),"w")] /def -i grpouch_report =\ @@ -78,10 +82,7 @@ /msq @{BCred}No such reagent pouch@{n} '@{BCgreen}%{rpouch_target}@{n}'! /def -i -p999 -F -mregexp -t"^This item is in " grpouch_end =\ - /if (rpouch_save >= 0)\ - /test tfclose(rpouch_save)%;\ - /set rpouch_save=-1%;\ - /endif%;\ + /grpouch_close%;\ /if (rpouch_st & !rpouch_get)\ /let _nval=$[rpouch_total_pwr + rpouch_total_std + rpouch_total_por]%;\ /if (opt_reglite=~"on")\