On Tue, 2008-12-09 at 06:36 -0800, CAI Qian wrote:
> Hi,
> 
> The following patches fixes a useless error log and possible segmentation 
> fault with fclose[1], a failure to report client and server failures[2], and  
> missing data file installation[3].
> 
> [1]
> # ./run_sched_cliserv.sh 
> fopen: No such file or directory
> sockfd = 4
> str_echo: n = 0
> ./run_sched_cliserv.sh: line 4: 29752 Segmentation fault      pthcli 127.0.0.1
> ./run_sched_cliserv.sh: line 6: 29751 Terminated              pthserv
> 
> [2]
> # ./run_sched_cliserv.sh 
> fopen: No such file or directory
> sockfd = 4
> str_echo: n = 0
> ./run_sched_cliserv.sh: line 4: 29757 Segmentation fault      pthcli 127.0.0.1
> ./run_sched_cliserv.sh: line 6: 29756 Terminated              pthserv
> 
> # echo $?
> 0
> 
> [3]
> # ./run_sched_cliserv.sh 
> fopen: No such file or directory
> sockfd = 4
> str_echo: n = 0
> ./run_sched_cliserv.sh: line 7: 29689 Terminated              pthserv
> 
> Signed-off-by: CAI Qian <[email protected]>

Thanks Cai for this Patch. But i find it difficult to apply and it fails
for me:

patching file testcases/kernel/sched/clisrv/pthcli.c
Hunk #2 succeeded at 110 with fuzz 1.
Hunk #3 FAILED at 125.
Hunk #4 FAILED at 136.
2 out of 4 hunks FAILED -- saving rejects to file
testcases/kernel/sched/clisrv/pthcli.c.rej
patching file testcases/kernel/sched/clisrv/run_sched_cliserv.sh
patching file testcases/kernel/sched/clisrv/Makefile
Hunk #1 FAILED at 15.
1 out of 1 hunk FAILED -- saving rejects to file
testcases/kernel/sched/clisrv/Makefile.rej

Can you please resend me the same with rebase from latest CVS. I can see
that these files has not been modified after Nov 08 release:

$ ls -l testcases/kernel/sched/clisrv
total 48
-rw-rw-r-- 1 subratamodak subratamodak 9216 Aug 28  2001 data
-rw-rw-r-- 1 subratamodak subratamodak 1434 Mar 25  2003 inet.h
-rw-rw-r-- 1 subratamodak subratamodak  491 Oct 23 17:21 Makefile
-rw-rw-r-- 1 subratamodak subratamodak 5095 Jun 22  2006 pthcli.c
-rw-rw-r-- 1 subratamodak subratamodak 5595 Oct 20 12:00 pthserv.c
-rw-rw-r-- 1 subratamodak subratamodak 1606 Nov 10  2007 readline.c
-rwxrwxr-x 2 subratamodak subratamodak   57 Oct 23 17:50
run_sched_cliserv.sh
-rw-rw-r-- 1 subratamodak subratamodak 1424 Nov 10  2007 writen.c

Regards--
Subrata

> 
> --- testcases/kernel/sched/clisrv/pthcli.c.orig    2008-12-09 
> 08:47:49.000000000 -0500
> +++ testcases/kernel/sched/clisrv/pthcli.c    2008-12-09 08:52:59.000000000 
> -0500
> @@ -99,10 +99,9 @@
>  int
>  main(int argc, char *argv[])
>  {
> -    FILE *fi=NULL, *input;
> +    FILE *input;
>      int sockfd;
>      struct sockaddr_in serv_addr;
> -    char *errfilename;
> 
>      pname = argv[0];
>      if (argc < 2) 
> @@ -111,8 +110,6 @@
>        exit(1);
>      }
> 
> -    errfilename = argv[1];
> -
>      /* Fill in the structure */
>      memset((char *) &serv_addr, 0x00, sizeof(serv_addr));
>      serv_addr.sin_family = AF_INET;
> @@ -128,12 +125,8 @@
>      /* Open Internet stream socket */
>      if ((sockfd = socket(AF_INET, SOCK_STREAM, 0)) < 0)
>      {
> -    if ((fi = fopen(errfilename, "w")) != 0)
> -    {
> -        fprintf(fi,"client: socket open failure, no = %d\n", errno);
> -             fclose(fi);
> -            return(errno);
> -    }
> +    printf("client: socket open failure, no = %d\n", errno);
> +    return(errno);
>      exit(1);
>      }
>      prtln();
> @@ -143,19 +136,14 @@
>      if (connect(sockfd, (struct sockaddr *) &serv_addr, sizeof(serv_addr)) < 
> 0)
>      {
>          prtln();
> -    if ((fi = fopen(errfilename, "w")) != 0)
> -    {
> -        fprintf(fi,"client: connect failure, no = %d\n", errno);
> -             fclose(fi);
> -            return(errno);
> -    }
> +    printf("client: connect failure, no = %d\n", errno);
> +    return(errno);
>      exit(1);
>      }
>  #ifdef _LINUX
>      if ((input = fopen("./data", "r")) == NULL) 
>      {
>      perror("fopen");
> -        fclose(fi);
>          return(errno);
>      }
>      str_cli(input, sockfd); /* call the routines that do the work */
> 
> --- testcases/kernel/sched/clisrv/run_sched_cliserv.sh.orig    2008-12-09 
> 08:59:26.000000000 -0500
> +++ testcases/kernel/sched/clisrv/run_sched_cliserv.sh    2008-12-09 
> 09:04:48.000000000 -0500
> @@ -1,6 +1,11 @@
> -#!/bin/bash
> +#!/bin/sh
> 
>  pthserv &
>  pthcli 127.0.0.1
> +clientCode=$?
>  killall pthserv
> -
> +serverCode=$?
> +if [ $clientCode -ne 0 ] || [ $serverCode -ne 0 ]; then
> +    exit 1
> +fi
> +exit 0
> 
> --- testcases/kernel/sched/clisrv/Makefile.orig    2008-12-09 
> 09:27:58.000000000 -0500
> +++ testcases/kernel/sched/clisrv/Makefile    2008-12-09 09:17:22.000000000 
> -0500
> @@ -15,6 +15,7 @@
>  install:
>      @set -e; for i in $(TESTS) ; do ln -f $$i ../../../bin/$$i ; done ;
>      ln -f run_sched_cliserv.sh ../../../bin/
> +    ln -f data ../../../bin/
> 
>  clean:
>      rm -fr $(OFILES) $(TESTS)
> 
> 
> ------------------------------------------------------------------------------
> SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada.
> The future of the web can't happen without you.  Join us at MIX09 to help
> pave the way to the Next Web now. Learn more and register at
> http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/
> _______________________________________________
> Ltp-list mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/ltp-list


------------------------------------------------------------------------------
SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada.
The future of the web can't happen without you.  Join us at MIX09 to help
pave the way to the Next Web now. Learn more and register at
http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list

Reply via email to