From: Robert W. <ro...@us...> - 2002-09-05 15:51:18
|
FYI. Patch applied to CVS tree and will be included in September release. - Robbie Robert V. Williamson <ro...@us...> Linux Test Project IBM Linux Technology Center Phone: (512) 838-9295 T/L: 638-9295 Fax: (512) 838-4603 http://ltp.sourceforge.net "Steven J. Hill" <sj...@re... To: ltp...@li... m> cc: Sent by: Subject: [LTP] uClibc Patch (3/5)... ltp...@li...ur ceforge.net 09/03/2002 10:45 PM This patch removes the usage of undocumented functions 'warn' and 'errx' present in glibc to use 'fprintf' instead. This allows compilation against uClibc. Thanks. -Steve diff -urN ltp-20020813/testcases/kernel/fs/fsx-linux/fsx-linux.c ltp-20020813-patched/testcases/kernel/fs/fsx-linux/fsx-linux.c --- ltp-20020813/testcases/kernel/fs/fsx-linux/fsx-linux.c Thu Dec 20 07:51:35 2001 +++ ltp-20020813-patched/testcases/kernel/fs/fsx-linux/fsx-linux.c Tue Sep 3 08:05:11 2002 @@ -267,7 +267,7 @@ if (size_by_seek == (off_t)-1) prterr("save_buffer: lseek eof"); else if (bufferlength > size_by_seek) { - warn("save_buffer: .fsxgood file too short... will save 0x%qx bytes instead of 0x%qx\n", (unsigned long long)size_by_seek, + fprintf(stderr, "save_buffer: .fsxgood file too short... will save 0x%qx bytes instead of 0x%qx\n", (unsigned long long)size_by_seek, (unsigned long long)bufferlength); bufferlength = size_by_seek; } @@ -282,7 +282,7 @@ if (byteswritten == -1) prterr("save_buffer write"); else - warn("save_buffer: short write, 0x%x bytes instead of 0x%qx\n", + fprintf(stderr, "save_buffer: short write, 0x%x bytes instead of 0x%qx\n", (unsigned)byteswritten, (unsigned long long)bufferlength); } @@ -526,7 +526,7 @@ bzero(good_buf + file_size, offset - file_size); file_size = offset + size; if (lite) { - warn("Lite file size bug in fsx!"); + fprintf(stderr, "Lite file size bug in fsx!"); report_failure(149); } } @@ -583,7 +583,7 @@ bzero(good_buf + file_size, offset - file_size); file_size = offset + size; if (lite) { - warn("Lite file size bug in fsx!"); + fprintf(stderr, "Lite file size bug in fsx!"); report_failure(200); } } @@ -1031,13 +1031,13 @@ file_size = maxfilelen = lseek(fd, (off_t)0, L_XTND); if (file_size == (off_t)-1) { prterr(fname); - warn("main: lseek eof"); + fprintf(stderr, "main: lseek eof"); exit(94); } ret = lseek(fd, (off_t)0, SEEK_SET); if (ret == (off_t)-1) { prterr(fname); - warn("main: lseek 0"); + fprintf(stderr, "main: lseek 0"); exit(95); } } @@ -1055,9 +1055,9 @@ if (written != maxfilelen) { if (written == -1) { prterr(fname); - warn("main: error on write"); + fprintf(stderr, "main: error on write"); } else - warn("main: short write, 0x%x bytes instead of 0x%x\n", + fprintf(stderr, "main: short write, 0x%x bytes instead of 0x%x\n", (unsigned)written, maxfilelen); exit(98); } diff -urN ltp-20020813/testcases/network/ipv6/echo6/echoes6.c ltp-20020813-patched/testcases/network/ipv6/echo6/echoes6.c --- ltp-20020813/testcases/network/ipv6/echo6/echoes6.c Tue May 28 07:45:38 2002 +++ ltp-20020813-patched/testcases/network/ipv6/echo6/echoes6.c Fri Aug 30 12:03:16 2002 @@ -42,9 +42,9 @@ hints.ai_family = PF_INET6; if ((gai=getaddrinfo(argv[1], NULL, &hints, &hp))!=0) - errx(2, "Unknown subject address %s: %s\n",argv[1], gai_strerror(gai)); + fprintf(stderr, "Unknown subject address %s: %s\n", argv[1], gai_strerror(gai)); if (!hp->ai_addr || hp->ai_addr->sa_family != AF_INET6) - errx(2, "getaddrinfo failed"); + fprintf(stderr, "getaddrinfo failed"); if ((sp=getservbyname("echo","tcp"))==NULL) { printf("ERROR service is not available\n"); perror("echo"); diff -urN ltp-20020813/testcases/network/ipv6/perf_lan6/pingpong6.c ltp-20020813-patched/testcases/network/ipv6/perf_lan6/pingpong6.c --- ltp-20020813/testcases/network/ipv6/perf_lan6/pingpong6.c Fri Mar 1 13:35:17 2002 +++ ltp-20020813-patched/testcases/network/ipv6/perf_lan6/pingpong6.c Fri Aug 30 12:03:27 2002 @@ -102,9 +102,9 @@ hints.ai_family = PF_INET6; if ((gai=getaddrinfo(av[1], NULL, &hints, &hp))!=0) - errx(2, "Unknown subject address %s: %s\n",av[1], gai_strerror(gai)); + fprintf(stderr, "Unknown subject address %s: %s\n",av[1], gai_strerror(gai)); if (!hp->ai_addr || hp->ai_addr->sa_family != AF_INET6) - errx(2, "getaddrinfo failed"); + fprintf(stderr, "getaddrinfo failed"); strcpy(hnamebuf, av[1]); hostname = hnamebuf; bzero( (char *)&whereto, sizeof(struct sockaddr) ); diff -urN ltp-20020813/testcases/network/ipv6/sendfile6/testsf_c6.c ltp-20020813-patched/testcases/network/ipv6/sendfile6/testsf_c6.c --- ltp-20020813/testcases/network/ipv6/sendfile6/testsf_c6.c Thu Apr 18 12:24:33 2002 +++ ltp-20020813-patched/testcases/network/ipv6/sendfile6/testsf_c6.c Fri Aug 30 12:03:40 2002 @@ -64,9 +64,9 @@ memset(&hints, 0, sizeof(hints)); hints.ai_family = PF_INET6; if ((gai=getaddrinfo(argv[1], NULL, &hints, &hp))!=0) - errx(2, "Unknown subject address %s: %s\n",argv[1], gai_strerror(gai)); + fprintf(stderr, "Unknown subject address %s: %s\n",argv[1], gai_strerror(gai)); if (!hp->ai_addr || hp->ai_addr->sa_family != AF_INET6) - errx(2, "getaddrinfo failed"); + fprintf(stderr, "getaddrinfo failed"); /* initialize server info to make the connection */ diff -urN ltp-20020813/testcases/network/ipv6/sendfile6/testsf_s6.c ltp-20020813-patched/testcases/network/ipv6/sendfile6/testsf_s6.c --- ltp-20020813/testcases/network/ipv6/sendfile6/testsf_s6.c Thu Apr 18 12:24:33 2002 +++ ltp-20020813-patched/testcases/network/ipv6/sendfile6/testsf_s6.c Fri Aug 30 12:03:47 2002 @@ -64,9 +64,9 @@ memset(&hints, 0, sizeof(hints)); hints.ai_family = PF_INET6; if ((gai=getaddrinfo(argv[1], NULL, &hints, &hp))!=0) - errx(2, "Unknown subject address %s: %s\n",argv[1], gai_strerror(gai)); + fprintf(stderr, "Unknown subject address %s: %s\n",argv[1], gai_strerror(gai)); if (!hp->ai_addr || hp->ai_addr->sa_family != AF_INET6) - errx(2, "getaddrinfo failed"); + fprintf(stderr, "getaddrinfo failed"); /* server IP and port */ diff -urN ltp-20020813/testcases/network/nfs/fsx-linux/fsx-linux.c ltp-20020813-patched/testcases/network/nfs/fsx-linux/fsx-linux.c --- ltp-20020813/testcases/network/nfs/fsx-linux/fsx-linux.c Tue Dec 18 09:10:46 2001 +++ ltp-20020813-patched/testcases/network/nfs/fsx-linux/fsx-linux.c Tue Sep 3 08:09:42 2002 @@ -267,7 +267,7 @@ if (size_by_seek == (off_t)-1) prterr("save_buffer: lseek eof"); else if (bufferlength > size_by_seek) { - warn("save_buffer: .fsxgood file too short... will save 0x%qx bytes instead of 0x%qx\n", (unsigned long long)size_by_seek, + fprintf(stderr, "save_buffer: .fsxgood file too short... will save 0x%qx bytes instead of 0x%qx\n", (unsigned long long)size_by_seek, (unsigned long long)bufferlength); bufferlength = size_by_seek; } @@ -282,7 +282,7 @@ if (byteswritten == -1) prterr("save_buffer write"); else - warn("save_buffer: short write, 0x%x bytes instead of 0x%qx\n", + fprintf(stderr, "save_buffer: short write, 0x%x bytes instead of 0x%qx\n", (unsigned)byteswritten, (unsigned long long)bufferlength); } @@ -526,7 +526,7 @@ bzero(good_buf + file_size, offset - file_size); file_size = offset + size; if (lite) { - warn("Lite file size bug in fsx!"); + fprintf(stderr, "Lite file size bug in fsx!"); report_failure(149); } } @@ -583,7 +583,7 @@ bzero(good_buf + file_size, offset - file_size); file_size = offset + size; if (lite) { - warn("Lite file size bug in fsx!"); + fprintf(stderr, "Lite file size bug in fsx!"); report_failure(200); } } @@ -1031,13 +1031,13 @@ file_size = maxfilelen = lseek(fd, (off_t)0, L_XTND); if (file_size == (off_t)-1) { prterr(fname); - warn("main: lseek eof"); + fprintf(stderr, "main: lseek eof"); exit(94); } ret = lseek(fd, (off_t)0, SEEK_SET); if (ret == (off_t)-1) { prterr(fname); - warn("main: lseek 0"); + fprintf(stderr, "main: lseek 0"); exit(95); } } @@ -1055,9 +1055,9 @@ if (written != maxfilelen) { if (written == -1) { prterr(fname); - warn("main: error on write"); + fprintf(stderr, "main: error on write"); } else - warn("main: short write, 0x%x bytes instead of 0x%x\n", + fprintf(stderr, "main: short write, 0x%x bytes instead of 0x%x\n", (unsigned)written, maxfilelen); exit(98); } |