[ minicom-Bugs-300108 ] runscript don't close script file

noreply@alioth.debian.org noreply@alioth.debian.org
Sat, 27 Sep 2003 17:23:17 +0200


Bugs item #300108, was opened at 2003-09-09 23:34
You can respond by visiting: 
http://alioth.debian.org/tracker/?func=detail&atid=100031&aid=300108&group_id=31

Category: None
Group: None
>Status: Closed
Resolution: None
Priority: 5
Submitted By: Nobody (None)
Assigned to: Nobody (None)
Summary: runscript don't close script file

Initial Comment:
Hello
 
I found a problem in runscript. Look this script.
 
 laco:
   timeout 60
   sleep 1
   ! echo "print \`date`\"  > bips.temp ; echo "exit"
>> bips.temp
   call bips.temp
   ! cat /proc/sys/fs/file-nr
   goto laco
 
Running this with runscript command each "call
bips.temp" open a file and don't close it. You see this
when "cat /proc/sys/fs/file-nr" run.
 
To solve this I put a fclose in script.c as below.
 
Thanks,
Rogerio Pereira Junior
rogerio@abcinfo.com.br

--- script.ori  2003-09-09 15:43:33.000000000 -0300
+++ script.c    2003-09-09 15:47:32.000000000 -0300
@@ -20,6 +20,9 @@
  * 10.07.98 jl  Added the log command
  * 05.04.99 jl  The logfile name should also be passed
as a parameter
  * 04.03.2002 jl Treat the ^ character between quotes
as control code prefix
+ *
+ * Sep 5 2003   Added file close command in
readscript() routine
+ *
  */
  
 #ifdef HAVE_CONFIG_H
@@ -339,6 +342,7 @@
        if (  ((tl = (struct line *)malloc(sizeof
(struct line))) == LNULL) ||
              ((tl->line = strsave(t)) == CNULL)) {
                        s_error(_("script %s: out of
memory%s\n"), s, "\r");
+                       fclose (fp);
                        exit(1);
        }
        if (prev)
@@ -350,6 +354,7 @@
        tl->lineno = no;
        prev = tl;
   }
+  fclose (fp);
   return(0);
 }


----------------------------------------------------------------------

>Comment By: Adam Lackorzynski (al-guest)
Date: 2003-09-27 17:23

Message:
Logged In: YES 
user_id=104

Thanks, it's fixed in CVS.

----------------------------------------------------------------------

You can respond by visiting: 
http://alioth.debian.org/tracker/?func=detail&atid=100031&aid=300108&group_id=31