[prev in list] [next in list] [prev in thread] [next in thread] 

List:       ltp-list
Subject:    Re: [LTP] [PATCH] Close fd's to make running on NFS work (part2)
From:       Subrata Modak <subrata () linux ! vnet ! ibm ! com>
Date:       2007-11-15 6:57:56
Message-ID: 1195109806.4601.16.camel () subratamodak ! linux ! ibm ! com
[Download RAW message or body]

On Wed, 2007-11-14 at 11:07 -0600, Kumar Gala wrote:
> Missed this the first go around.
> 
> - k

Well, This worked for me and also being Applied. Kindly send your
Patches in attachments. This was a small one and i could apply the
changes manually without Hardship.

--Subrata--

> 
> --- testcases/kernel/syscalls/creat/creat05.c   2007-11-09  
> 06:12:45.000000000 -0600
> +++ ../ltp-full-20071031/testcases/kernel/syscalls/creat/ 
> creat05.c      2007-11-09 04:23:56.000000000 -0600
> @@ -68,6 +68,7 @@
> int exp_enos[] = {EMFILE, 0};
> int fd, ifile, mypid, first;
> +int *buf;
> char fname[40];
> int
> @@ -151,6 +152,11 @@
>          /* get the maximum number of files that we can open */
>          max_open = getdtablesize();
> +       /* Allocate memory for stat and ustat structure variables*/
> +       if( (buf = (int *) malloc(sizeof(int) *  max_open - first))  
> == NULL) {
> +               tst_brkm(TBROK, tst_exit, "Failed to allocate Memory");
> +       }
> +
>          /* now open as many files as we can up to max_open */
>          for (ifile = first; ifile <= max_open; ifile++) {
>                  sprintf(fname, "creat05.%d.%d", ifile, mypid);
> @@ -164,6 +170,7 @@
>                          }
>                          break;
>                  }
> +               buf[ifile-first] = fd;
>          }
> }
> @@ -177,6 +184,7 @@
>          for (i=first; i<nfiles; i++) {
>                  sprintf(fname, "creat05.%d.%d", i, mypid);
> +               close(buf[i-first]);
>                  unlink(fname);
>          }
> }
> 
> -------------------------------------------------------------------------
> This SF.net email is sponsored by: Splunk Inc.
> Still grepping through log files to find problems?  Stop.
> Now Search log events and configuration files using AJAX and a browser.
> Download your FREE copy of Splunk now >> http://get.splunk.com/
> _______________________________________________
> Ltp-list mailing list
> Ltp-list@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/ltp-list


-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic