From: Ben Gras Date: Mon, 22 Aug 2005 15:08:27 +0000 (+0000) Subject: Al's no-double-empty-lines crusade X-Git-Tag: v3.1.0~309 X-Git-Url: http://zhaoyanbai.com/repos/%22http:/www.isc.org/icons/expt.png?a=commitdiff_plain;h=a17d7c827b811db07313b4d3a70d1559de988e95;p=minix.git Al's no-double-empty-lines crusade --- diff --git a/test/select/speed.c b/test/select/speed.c index cf0d36a3c..889d3a4c8 100644 --- a/test/select/speed.c +++ b/test/select/speed.c @@ -22,7 +22,6 @@ #include #include - #define NUMBER 12 void main(void) { diff --git a/test/select/test03.c b/test/select/test03.c index 3b98b0200..fcbb96556 100644 --- a/test/select/test03.c +++ b/test/select/test03.c @@ -106,7 +106,6 @@ void main(void) { FD_SET(fd3, &fds_read); /* fd3 => O_WRONLY */ FD_SET(fd4, &fds_read); /* fd4 => O_WRONLY */ - /* make a select call where none of them are ready (don't use fd5 and fd6) */ /* create a timeout as well */ timeout.tv_sec = 5; @@ -120,7 +119,6 @@ void main(void) { printf("* Dump RESULTING fds_write:\n"); dump_fdset(&fds_write); - /* close and delete dummy files */ close(fd1); close(fd2); diff --git a/test/select/test04_cli.c b/test/select/test04_cli.c index 8bf41fc95..db92f930c 100755 --- a/test/select/test04_cli.c +++ b/test/select/test04_cli.c @@ -34,7 +34,6 @@ typedef struct char data[1024]; } udp_buffer_t; - int udp_conf(char *host, long port, udp_io_hdr_t *header) { /* configures UDP connection */ diff --git a/test/select/test04_srv.c b/test/select/test04_srv.c index b6eec6c5e..b6fc6a5c4 100755 --- a/test/select/test04_srv.c +++ b/test/select/test04_srv.c @@ -76,7 +76,6 @@ int udp_conf(long port) { return netfd; } - int main(int argc,char *argv[]) { int fd; ssize_t data_read; diff --git a/test/select/test05_cli.c b/test/select/test05_cli.c index 0c96a38c4..aad9bf0e6 100644 --- a/test/select/test05_cli.c +++ b/test/select/test05_cli.c @@ -37,7 +37,6 @@ typedef struct char data[1024]; } udp_buffer_t; - int udp_conf(char *host, long port, udp_io_hdr_t *header) { /* configures UDP connection */ @@ -115,7 +114,6 @@ int main(int argc,char *argv[]) { if ((fd = udp_conf(argv[1], PORT, &buffer_send.header) ) < 0) exit(-1); - while (1) { diff --git a/test/select/test05_srv.c b/test/select/test05_srv.c index b1d9d80f4..a88526b28 100755 --- a/test/select/test05_srv.c +++ b/test/select/test05_srv.c @@ -76,7 +76,6 @@ int udp_conf(long port) { return netfd; } - int main(int argc,char *argv[]) { int fd; ssize_t data_read; @@ -96,7 +95,6 @@ int main(int argc,char *argv[]) { printf("Waiting for messages on port: %ld\n", PORT); fflush(stdout); - /* get a first message so we know who is the client and we can harass it afterwards */ diff --git a/test/select/test06_srv.c b/test/select/test06_srv.c index 99ae283ca..af0459f40 100755 --- a/test/select/test06_srv.c +++ b/test/select/test06_srv.c @@ -80,7 +80,6 @@ int listen(long port) { return netfd; } - int main(int argc,char *argv[]) { int fd; ssize_t data_read; diff --git a/test/select/test07_srv.c b/test/select/test07_srv.c index 46c4c2e94..582318c42 100755 --- a/test/select/test07_srv.c +++ b/test/select/test07_srv.c @@ -82,7 +82,6 @@ int listen(long port) { return netfd; } - int main(int argc,char *argv[]) { int fd; ssize_t data_read; diff --git a/test/select/test08_srv.c b/test/select/test08_srv.c index a4eaa793d..6074035a8 100755 --- a/test/select/test08_srv.c +++ b/test/select/test08_srv.c @@ -98,7 +98,6 @@ int listen(long port) { return netfd; } - int main(int argc,char *argv[]) { int fd; ssize_t data_read; diff --git a/test/select/test09.c b/test/select/test09.c index 1aa050d4b..3fc9ecf4c 100644 --- a/test/select/test09.c +++ b/test/select/test09.c @@ -19,7 +19,6 @@ #include #include - void main(void) { fd_set fds_read, fds_write; int retval; diff --git a/test/select/test10.c b/test/select/test10.c index 4590520c7..3f44d829c 100644 --- a/test/select/test10.c +++ b/test/select/test10.c @@ -22,7 +22,6 @@ #include #include - void main(void) { fd_set fds_read, fds_write; int retval; diff --git a/test/select/test14.c b/test/select/test14.c index 07de7c760..99cc009a3 100644 --- a/test/select/test14.c +++ b/test/select/test14.c @@ -8,7 +8,6 @@ * * Ben Gras */ - #include #include #include @@ -22,17 +21,12 @@ #include #include #include - char name[100]; - void pipehandler(int sig) { - } - #define CHILDFD 1 #define PARENTFD 0 - void do_child(int pty_fds[]) { /* reads from pipe and prints out the data */ @@ -41,10 +35,8 @@ void do_child(int pty_fds[]) fd_set fds_read; fd_set fds_exception; struct timeval timeout; - signal(SIGPIPE, pipehandler); signal(SIGUSR1, pipehandler); - /* first, close the write part, since it is not needed */ close(pty_fds[PARENTFD]); @@ -83,19 +75,15 @@ void do_child(int pty_fds[]) exit(0); } - void do_parent(int pty_fds[]) { char data[1024]; int retval; fd_set fds_write; - signal(SIGPIPE, pipehandler); signal(SIGUSR1, pipehandler); - /* first, close the read part of pty, since it is not needed */ close(pty_fds[CHILDFD]); - /* now enter a loop of read user input, and writing it to the pty */ while (1) { FD_ZERO(&fds_write); @@ -108,7 +96,6 @@ void do_parent(int pty_fds[]) fprintf(stderr, "Parent: Error in select\n"); exit(-1); } - printf("Input data: "); if(!gets(data)) { printf("parent: eof; exiting\n"); @@ -127,20 +114,17 @@ void do_parent(int pty_fds[]) exit(-1); } else printf("wrote %d\n", retval); } - /* got exit from user */ close(pty_fds[PARENTFD]); /* close pty, let child know we're done */ wait(&retval); printf("Child exited with status: %d\n", retval); exit(0); } - int main(int argc, char *argv[]) { int ptys[2]; int retval; int pid; - if(openpty(&ptys[0], &ptys[1], name, NULL, NULL) < 0) { perror("openpty"); return 1; @@ -151,12 +135,10 @@ int main(int argc, char *argv[]) fprintf(stderr, "Error forking\n"); exit(-1); } - if (pid == 0) /* child proc */ do_child(ptys); else do_parent(ptys); - /* not reached */ return 0; } diff --git a/test/t11a.c b/test/t11a.c index 20f59cad6..df6676725 100644 --- a/test/t11a.c +++ b/test/t11a.c @@ -56,7 +56,6 @@ char *s1, *s2; } } - void e(n) int n; { diff --git a/test/test1.c b/test/test1.c index 3054d3c63..918b7e264 100644 --- a/test/test1.c +++ b/test/test1.c @@ -107,7 +107,6 @@ void test1b() } } - void parent1(childpid) int childpid; { @@ -133,7 +132,6 @@ void child1() exit(gct); } - void quit() { diff --git a/test/test10.c b/test/test10.c index 1b73dbe42..0d7145382 100644 --- a/test/test10.c +++ b/test/test10.c @@ -107,7 +107,6 @@ void mkfiles() close(fd); } - void cr_file(name, size) char *name; int size; diff --git a/test/test11.c b/test/test11.c index 22c5bcc9d..a1ab97f80 100644 --- a/test/test11.c +++ b/test/test11.c @@ -67,14 +67,12 @@ char *argv[]; return(0); } - void test11a() { /* Test exec */ int n, fd; char aa[4]; - subtest = 1; if (fork()) { @@ -121,8 +119,6 @@ void test11a() } } - - void test11b() { int n; diff --git a/test/test14.c b/test/test14.c index 39f2437e4..c96c1e24b 100644 --- a/test/test14.c +++ b/test/test14.c @@ -33,7 +33,6 @@ int main() name[7] = ((pid * pid) & 037) + 33; name[8] = 0; - for (i = 0; i < TRIALS; i++) { if ( (fd0 = creat(name, 0777)) < 0) e(1); if (write(fd0, name, 20) != 20) e(2); @@ -41,7 +40,6 @@ int main() if (close(fd0) != 0) e(4); } - fd0 = creat(name, 0777); write(fd0, name, 20); unlink(name); @@ -49,7 +47,6 @@ int main() return(-1); /* impossible */ } - void e(n) int n; { diff --git a/test/test15.c b/test/test15.c index 630d4d4a3..fbaee8d32 100644 --- a/test/test15.c +++ b/test/test15.c @@ -577,7 +577,6 @@ void second() (void) memmove(one + 2, one + 1, 8); equal(one, "abbcdefgh", 14); - /* Memccpy - first test like memcpy, then the search part * The SVID, the only place where memccpy is mentioned, says overlap * might fail, so we don't try it. Besides, it's hard to see the diff --git a/test/test16.c b/test/test16.c index 2e5f2ded7..ac5a1e40d 100644 --- a/test/test16.c +++ b/test/test16.c @@ -40,7 +40,6 @@ char *argv[]; return(-1); /* impossible */ } - void test16a() { /* Test atime, ctime, and mtime. */ @@ -207,7 +206,6 @@ void test16a() if (unlink("T16.k") != 0) e(86); } - void get_times(name, a, c, m) char *name; time_t *a, *c, *m; @@ -220,8 +218,6 @@ time_t *a, *c, *m; *m = s.st_mtime; } - - void e(n) int n; { diff --git a/test/test17.c b/test/test17.c index 2211a76ad..71fe9e0f4 100644 --- a/test/test17.c +++ b/test/test17.c @@ -160,8 +160,6 @@ int mask; umask(022); } /* test */ - - /* "t1.c" created by Rene Montsma and Menno Wilcke */ /***************************************************************************** @@ -324,8 +322,6 @@ void test02() check(CREAT, EISDIR); } /* test02 */ - - void test08() { /* Test chdir to searchable dir */ @@ -442,7 +438,6 @@ void test09() /* New page */ - /* "t4.c", created by Rene Montsma and Menno Wilcke */ /***************************************************************************** @@ -551,7 +546,6 @@ void test10() } /* test10 */ - int link_alot(bigboss) char *bigboss; { @@ -697,7 +691,6 @@ void test11() /* New page */ - void comp_stats(stbf1, stbf2) struct stat *stbf1, *stbf2; { @@ -715,11 +708,8 @@ struct stat *stbf1, *stbf2; /* New page */ - /* "t5.c", created by Rene Montsma and Menno Wilcke */ - - void comp_inodes(m, m1) int m, m1; /* twee filedes's */ { @@ -1067,7 +1057,6 @@ int nr; * * *****************************************************************************/ - int open_alot() { int i; diff --git a/test/test18.c b/test/test18.c index c756221a0..4b9fc87e2 100644 --- a/test/test18.c +++ b/test/test18.c @@ -113,7 +113,6 @@ _PROTOTYPE(void clean_up_the_mess, (void)); _PROTOTYPE(void chmod_8_dirs, (int sw)); _PROTOTYPE(void quit, (void)); - /***************************************************************************** * TEST * ****************************************************************************/ @@ -144,8 +143,6 @@ int main() return(0); } - - void test() { umask(0); /* not honest, but i always forget */ @@ -161,11 +158,6 @@ void test() umask(022); } /* test */ - - - - - /* "t1.c" created by Rene Montsma and Menno Wilcke */ /***************************************************************************** @@ -187,7 +179,6 @@ void test01() if ((tempvalue = umask(0)) != 0) err(2, UMASK, "values"); - /* Now test all possible modes of umask on a file */ for (newvalue = MASK; newvalue >= 0; newvalue -= 0111) { tempvalue = umask(newvalue); @@ -210,8 +201,6 @@ void test01() err(7, UMASK, "umask may influence rest of tests!"); } /* test01 */ - - /***************************************************************************** * test CREAT * ****************************************************************************/ @@ -334,10 +323,6 @@ void test02() check(CREAT, EISDIR); } /* test02 */ - - - - /***************************************************************************** * test WRITE * ****************************************************************************/ @@ -395,7 +380,6 @@ void test03() } } /* test03 */ - void write_standards(filedes, a) int filedes; char a[]; @@ -420,14 +404,8 @@ char a[]; #endif } /* write_standards */ - - - - - /* "t2.c", created by Rene Montsma and Menno Wilcke */ - /***************************************************************************** * test READ * ****************************************************************************/ @@ -505,7 +483,6 @@ void test04() } } /* test04 */ - void read_standards(filedes, a) int filedes; char a[]; @@ -520,14 +497,12 @@ char a[]; else if (read(filedes, b, ARSIZE) != READ_EOF) err(11, READ, "read beyond endoffile"); - /* Try giving read wrong input: wrong filedes */ if (read(FAIL, b, ARSIZE) != FAIL) err(2, READ, "filedes"); else check(READ, EBADF); - /* Wrong length */ if (read(filedes, b, -ARSIZE) != FAIL) err(2, READ, "length"); @@ -535,8 +510,6 @@ char a[]; check(READ, EINVAL); } /* read_standards */ - - void read_more(filedes, a) int filedes; char a[]; @@ -662,11 +635,9 @@ void test05() else check(OPEN, EACCES); - /* Unlink testfile */ try_unlink("file05"); - /* File is not readable */ if (open("drwx/-wx", R) != FAIL) err(11, OPEN, "open unreadable file for reading"); @@ -698,7 +669,6 @@ void test05() check(CLOSE, EBADF); } /* test05 */ - void try_open(fname, mode, test) int mode, test; char *fname; @@ -710,8 +680,6 @@ char *fname; if (n != FAIL) try_close(n, fname); /* cleanup */ } /* try_open */ - - /***************************************************************************** * test LSEEK * ****************************************************************************/ @@ -771,12 +739,8 @@ void test06() } - - - /* "t3.c", created by Rene Montsma and Menno Wilcke */ - /***************************************************************************** * test ACCESS * ****************************************************************************/ @@ -795,7 +759,6 @@ void test07() if (chdir("..") != OK) err(5, CHDIR, "'..'"); - /* Check several wrong combinations */ /* File does not exist */ if (access("non-file", 0) != FAIL) @@ -817,7 +780,6 @@ void test07() } /* test07 */ - void access_standards() { int i, mode = 0; @@ -874,8 +836,6 @@ void access_standards() for (i = 0; i < 8; i++) try_access(fnames[mode], i, OK); } /* access_standards */ - - void try_access(fname, mode, test) int mode, test; char *fname; @@ -884,21 +844,13 @@ char *fname; err(100, ACCESS, "incorrect access on a file (try_access)"); } /* try_access */ - - - - - - /* "support.c", created by Rene Montsma and Menno Wilcke */ - /* Err, make_and_fill_dirs, init_array, clear_array, comp_array, try_close, try_unlink, Remove, get_mode, check, open_alot, close_alot, clean_up_the_mess. */ - /*********************************************************************** * EXTENDED FIONS * **********************************************************************/ @@ -923,7 +875,6 @@ char *s; printf(s); } - /***************************************************************************** * * * ERR(or) messages * @@ -1029,7 +980,6 @@ int number; nlcr(); } /* err */ - /***************************************************************************** * * * MAKE_AND_FILL_DIRS * @@ -1060,8 +1010,6 @@ void make_and_fill_dirs() } /* make_and_fill_dirs */ - - void put_file_in_dir(dirname, mode) char *dirname; int mode; @@ -1069,7 +1017,6 @@ int mode; { int nr; - if (chdir(dirname) != OK) err(5, CHDIR, "to dirname (put_f_in_dir)"); else { @@ -1084,7 +1031,6 @@ int mode; } } /* put_file_in_dir */ - /***************************************************************************** * * * MISCELLANEOUS * @@ -1093,7 +1039,6 @@ int mode; * * *****************************************************************************/ - void init_array(a) char *a; { @@ -1113,7 +1058,6 @@ char *b; } /* clear_array */ - int comp_array(a, b, range) char *a, *b; int range; @@ -1130,7 +1074,6 @@ int range; } } /* comp_array */ - void try_close(filedes, name) int filedes; char *name; @@ -1138,14 +1081,12 @@ char *name; if (close(filedes) != OK) err(5, CLOSE, name); } /* try_close */ - void try_unlink(fname) char *fname; { if (unlink(fname) != 0) err(5, UNLINK, fname); } /* try_unlink */ - void Remove(fdes, fname) int fdes; char *fname; @@ -1154,7 +1095,6 @@ char *fname; try_unlink(fname); } /* Remove */ - int get_mode(name) char *name; { @@ -1169,14 +1109,12 @@ char *name; return(stbf1.st_mode & 07777); /* take last 4 bits */ } /* get_mode */ - /***************************************************************************** * * * CHECK * * * *****************************************************************************/ - void check(scall, number) int number; char *scall; @@ -1235,16 +1173,12 @@ int nr; } } - /***************************************************************************** * * * ALOT-functions * * * *****************************************************************************/ - - - int open_alot() { int i; @@ -1255,7 +1189,6 @@ int open_alot() return(i); } /* open_alot */ - int close_alot(number) int number; { @@ -1270,14 +1203,12 @@ int number; return(number - count); /* return number of closed files */ } /* close_alot */ - /***************************************************************************** * * * CLEAN UP THE MESS * * * *****************************************************************************/ - void clean_up_the_mess() { int i; @@ -1294,7 +1225,6 @@ void clean_up_the_mess() if (chdir("..") != OK) err(5, CHDIR, "to '..'"); } - /* Before unlinking files in some dirs, make them writable */ chmod_8_dirs(RWX); @@ -1332,8 +1262,6 @@ int sw; /* if switch == 8, give all different } } - - void quit() { diff --git a/test/test19.c b/test/test19.c index 0ad9272d2..4d990057d 100644 --- a/test/test19.c +++ b/test/test19.c @@ -32,7 +32,6 @@ _PROTOTYPE(void pipecatcher, (int s)); _PROTOTYPE(void e, (int n)); _PROTOTYPE(void quit, (void)); - int main(argc, argv) int argc; char *argv[]; @@ -115,7 +114,6 @@ void test19a() if (unlink("T19.a3") != 0) e(32); } - void test19b() { /* Test open with O_APPEND and O_TRUNC. */ @@ -147,7 +145,6 @@ void test19b() unlink("T19.b1"); } - void test19c() { /* Test program for open(), close(), creat(), read(), write(), lseek(). */ @@ -280,8 +277,6 @@ void test19d() if (unlink("T19.d1") != 0) e(20); } - - void test19e() { /* Test link, unlink, stat, fstat, dup, umask. */ @@ -381,7 +376,6 @@ void test19f() } } - void test19g() { /* Test POSIX calls for pipe, read, write, lseek and close. */ @@ -477,21 +471,18 @@ void test19g() if (unlink("T19.g1") != 0) e(60); } - void clraa() { int i; for (i = 0; i < 100; i++) aa[i] = 0; } - void pipecatcher(s) int s; /* it is supposed to have an arg */ { pipesigs++; } - void e(n) int n; { @@ -528,4 +519,3 @@ void quit() } } - diff --git a/test/test2.c b/test/test2.c index f2b0d1c8e..a12077717 100644 --- a/test/test2.c +++ b/test/test2.c @@ -63,7 +63,6 @@ char *argv[]; return(-1); /* impossible */ } - void test2a() { /* Test pipes */ @@ -123,7 +122,6 @@ void test2a() } } - void test2b() { int fd[2], n; @@ -148,8 +146,6 @@ void test2b() } } - - void test2c() { int n; @@ -264,7 +260,6 @@ void test2d() if (errno != ECHILD) e(26); } - void test2e() { @@ -301,7 +296,6 @@ void test2e() } - void test2f() { /* test getpid, getppid, getuid, etc. */ @@ -376,7 +370,6 @@ void test2h() if (getgroups(0, g) != 0) e(3); } - void sigpip(s) int s; /* for ANSI */ { diff --git a/test/test20.c b/test/test20.c index bb7d56f0d..9d2f90b6a 100644 --- a/test/test20.c +++ b/test/test20.c @@ -10,7 +10,6 @@ * getcwd() */ - #include #include #include @@ -189,7 +188,6 @@ int t; /* subtest number to use */ return; } - void test20b() { /* Subtest 4. Test error handling. */ @@ -217,7 +215,6 @@ void test20b() } - void test20c() { /* Subtest 5. See what happens if we open too many directory streams. */ @@ -310,7 +307,6 @@ void test20d() if (system("rmdir Dir") != 0) e(33); } - void test20e() { /* Test open. */ @@ -446,7 +442,6 @@ void test20f() if (unlink("T20f") < 0) e(54); } - void test20g() { /* Test link and unlink. */ diff --git a/test/test21.c b/test/test21.c index 6d0863f3b..c46989a18 100644 --- a/test/test21.c +++ b/test/test21.c @@ -345,7 +345,6 @@ void test21d() } - void test21e() { /* Test error conditions. */ @@ -423,7 +422,6 @@ void test21f() if (rmdir("D1") != 0) e(11); } - void test21g() { int fd, D1_before, D1_after, D2_before, D2_after, x_link, y_link; @@ -590,7 +588,6 @@ void test21m() if (rmdir("D1") != 0) e(12); } - void test21n() { int D1_before, D1_after, D2_before, D2_after, x_link, y_link; @@ -624,7 +621,6 @@ void test21n() if (rmdir("D2") != 0) e(19); } - void test21o() { /* Test trying to remove . and .. */ @@ -645,7 +641,6 @@ void test21o() if (rmdir("D1") != 0) e(14); } - int get_link(name) char *name; { @@ -659,7 +654,6 @@ char *name; return(statbuf.st_nlink); } - void e(n) int n; { diff --git a/test/test22.c b/test/test22.c index f0bdfe668..1c5d00a68 100644 --- a/test/test22.c +++ b/test/test22.c @@ -185,7 +185,6 @@ int n; errno = 0; } - void quit() { Chdir(".."); diff --git a/test/test23.c b/test/test23.c index 4f5386c81..2a1dceeb6 100644 --- a/test/test23.c +++ b/test/test23.c @@ -292,7 +292,6 @@ void test23c() if (chdir(cwd) != 0) e(58); } - void makelongnames() { register int i; @@ -314,7 +313,6 @@ void makelongnames() ToLongPath[PATH_MAX] = '\0'; /* inc ToLongPath by one */ } - /* The following code, is take from pwd written by Adri Koppes */ /* My_getcwd() helper. */ @@ -331,7 +329,6 @@ char ch; return(retval); } - char *my_getcwd(buf, size) char *buf; int size; @@ -386,7 +383,6 @@ int size; return buf; } - void e(n) int n; { @@ -404,7 +400,6 @@ int n; errno = 0; } - void quit() { Chdir(".."); diff --git a/test/test24.c b/test/test24.c index 4b89a7c6c..a821bf8b6 100644 --- a/test/test24.c +++ b/test/test24.c @@ -39,7 +39,6 @@ char MaxPath[PATH_MAX]; /* Same for path */ char ToLongName[NAME_MAX + 2]; /* Name of maximum +1 length */ char ToLongPath[PATH_MAX + 1]; /* Same for path, both too long */ - void main(argc, argv) int argc; char *argv[]; @@ -165,7 +164,6 @@ void test24a() if (closedir(dirp) != 0) e(34); /* close parent's foo */ } - void test24b() { /* See what happens with too many dir's open. Check if file size seems ok, @@ -245,7 +243,6 @@ void test24b() if (closedir(dirp[2]) != 0) e(27); } - void test24c() { /* Test whether wrong things go wrong right. */ @@ -349,7 +346,6 @@ DIR *dirp; /* (`f1', `f3', `f5', `.', `..') */ subtest = oldsubtest; } - void makelongnames() { register int i; @@ -371,7 +367,6 @@ void makelongnames() ToLongPath[PATH_MAX] = '\0'; /* inc ToLongPath by one */ } - void e(n) int n; { @@ -389,7 +384,6 @@ int n; errno = 0; } - void quit() { Chdir(".."); diff --git a/test/test25.c b/test/test25.c index b8bf07d19..7d82a2aa6 100644 --- a/test/test25.c +++ b/test/test25.c @@ -93,7 +93,6 @@ void test25a() if (!(EXCLUDE(O_RDWR, ADDIT))) e(7); } - void test25b() { /* Test normal operation. */ @@ -362,7 +361,6 @@ void test25b() } } - void test25c() { /* Test normal operation Part two. */ int fd1, fd2; @@ -569,7 +567,6 @@ void test25d() MaxPath[strlen(MaxPath) - 1] = '/'; /* make ././.../a */ } - void test25e() { int fd; @@ -676,7 +673,6 @@ void test25e() ToLongPath[PATH_MAX - 1] = '/'; } - void makelongnames() { register int i; @@ -698,8 +694,6 @@ void makelongnames() ToLongPath[PATH_MAX] = '\0'; /* inc ToLongPath by one */ } - - void e(n) int n; { @@ -717,7 +711,6 @@ int n; errno = 0; } - void quit() { Chdir(".."); diff --git a/test/test26.c b/test/test26.c index 4909c16c1..729041732 100644 --- a/test/test26.c +++ b/test/test26.c @@ -65,7 +65,6 @@ void test26a() subtest = 1; System("rm -rf ../DIR_26/*"); - System("echo -n hihaho > hihaho"); if ((fd = open("hihaho", O_RDONLY)) != 3) e(1); if (lseek(fd, (off_t) 3, SEEK_SET) != (off_t) 3) e(2); @@ -245,7 +244,6 @@ void test26c() } } - void e(n) int n; { @@ -263,7 +261,6 @@ int n; errno = 0; } - void quit() { Chdir(".."); diff --git a/test/test27.c b/test/test27.c index 7145e2a70..491f6b7ff 100644 --- a/test/test27.c +++ b/test/test27.c @@ -58,7 +58,6 @@ char *argv[]; quit(); } - void test27a() { /* Test Normal operation. */ struct stat st1, st2; @@ -296,7 +295,6 @@ void test27c() System("rm -rf ../DIR_27/*"); } - void makelongnames() { register int i; @@ -335,7 +333,6 @@ int n; errno = 0; } - void quit() { Chdir(".."); diff --git a/test/test28.c b/test/test28.c index 745e3f760..d52051ee6 100644 --- a/test/test28.c +++ b/test/test28.c @@ -69,7 +69,6 @@ char *argv[]; quit(); } - void test28a() { int mode; /* used in for loop */ @@ -164,7 +163,6 @@ void test28a() if (st.st_mtime >= time2) e(44); } - void test28b() { /* Test critical values. */ struct stat st; @@ -387,7 +385,6 @@ void test28c() System("rm -rf foo"); /* clean up */ } - void makelongnames() { register int i; @@ -409,7 +406,6 @@ void makelongnames() ToLongPath[PATH_MAX] = '\0'; /* inc ToLongPath by one */ } - void e(n) int n; { @@ -427,7 +423,6 @@ int n; errno = 0; } - void quit() { Chdir(".."); diff --git a/test/test29.c b/test/test29.c index 9f58a5c9d..1ddbcb87c 100644 --- a/test/test29.c +++ b/test/test29.c @@ -475,7 +475,6 @@ errno =0; } } - void test29b() { int i, fd, stat_loc; @@ -522,7 +521,6 @@ void test29b() if (strcmp(buf, "one two three four") != 0) e(17); if (close(fd) != 0) e(18); - /* Non written bytes in regular files should be zero. */ memset(buf2, '\0', BUF_SIZE); if ((fd = open("bigfile", O_RDWR | O_CREAT, 0644)) != 3) e(19); @@ -710,7 +708,6 @@ void test29c() } } - void setsignumber(signum) int signum; { @@ -734,7 +731,6 @@ int n; errno = 0; } - void quit() { Chdir(".."); diff --git a/test/test3.c b/test/test3.c index 4ecac234c..2aa2b5588 100644 --- a/test/test3.c +++ b/test/test3.c @@ -237,8 +237,6 @@ void quit() } } - - void e(n) int n; { diff --git a/test/test30.c b/test/test30.c index 1f2cfae69..879ce77ab 100644 --- a/test/test30.c +++ b/test/test30.c @@ -67,7 +67,6 @@ char *argv[]; quit(); } - void test30a() { /* Test normal operation. */ @@ -233,7 +232,6 @@ void test30b() MaxPath[strlen(MaxPath) - 1] = '/'; /* make ././.../a */ } - void test30c() { int fd; @@ -291,7 +289,6 @@ void test30c() ToLongPath[PATH_MAX - 1] = '/'; } - void makelongnames() { register int i; @@ -313,8 +310,6 @@ void makelongnames() ToLongPath[PATH_MAX] = '\0'; /* inc ToLongPath by one */ } - - void e(n) int n; { @@ -332,7 +327,6 @@ int n; errno = 0; } - void quit() { Chdir(".."); diff --git a/test/test31.c b/test/test31.c index 5b96ae06d..59c0fde43 100644 --- a/test/test31.c +++ b/test/test31.c @@ -60,7 +60,6 @@ char *argv[]; quit(); } - void test31a() { /* Test normal operation. */ @@ -153,7 +152,6 @@ void test31b() MaxPath[strlen(MaxPath) - 1] = '/'; /* make ././.../a */ } - void test31c() { subtest = 3; @@ -220,7 +218,6 @@ void test31c() ToLongPath[PATH_MAX - 1] = '/'; } - void makelongnames() { register int i; @@ -259,7 +256,6 @@ int n; errno = 0; } - void quit() { Chdir(".."); diff --git a/test/test32.c b/test/test32.c index bc3eb1264..03105f44a 100644 --- a/test/test32.c +++ b/test/test32.c @@ -335,8 +335,6 @@ void makelongnames() ToLongPath[PATH_MAX] = '\0'; /* inc ToLongPath by one */ } - - void e(n) int n; { @@ -354,7 +352,6 @@ int n; errno = 0; } - void quit() { Chdir(".."); diff --git a/test/test33.c b/test/test33.c index 98d777515..841bed64f 100644 --- a/test/test33.c +++ b/test/test33.c @@ -178,8 +178,6 @@ void test33a() } } - - void test33b() { int stat_loc; /* For the wait(&stat_loc) call. */ @@ -601,7 +599,6 @@ void test_access() } } - void makelongnames() { register int i; @@ -623,8 +620,6 @@ void makelongnames() ToLongPath[PATH_MAX] = '\0'; /* inc ToLongPath by one */ } - - void e(n) int n; { @@ -642,7 +637,6 @@ int n; errno = 0; } - void quit() { Chdir(".."); diff --git a/test/test35.c b/test/test35.c index 7459cc4c4..94cd13ec1 100644 --- a/test/test35.c +++ b/test/test35.c @@ -170,8 +170,6 @@ void test35b() if (chmod("foo", 0777) != 0) e(5); if (utime("foo", NULL) != 0) e(6); - - System("rm -rf ../DIR_35/*"); } @@ -291,8 +289,6 @@ void test35c() System("rm -rf ../DIR_35/*"); } - - void makelongnames() { register int i; @@ -314,8 +310,6 @@ void makelongnames() PathTooLong[PATH_MAX] = '\0'; /* inc PathTooLong by one */ } - - void e(n) int n; { @@ -333,7 +327,6 @@ int n; errno = 0; } - void quit() { Chdir(".."); @@ -348,7 +341,6 @@ void quit() } } - /* Getids returns a valid uid and gid. Is used PASSWD FILE. ** It assumes the following format for a passwd file line: ** :::: diff --git a/test/test36.c b/test/test36.c index 5f92194ff..1d820539c 100644 --- a/test/test36.c +++ b/test/test36.c @@ -39,7 +39,6 @@ _PROTOTYPE(int not_provided_option, (int _option)); _PROTOTYPE(int provided_option, (int _option, int _minimum_value)); _PROTOTYPE(int variating_option, (int _option, int _minimum_value)); - char *testdirs[] = { "/", "/etc", @@ -141,7 +140,6 @@ void test36d() System("rm -rf ../DIR_36/*"); } - void makelongnames() { register int i; @@ -163,8 +161,6 @@ void makelongnames() ToLongPath[PATH_MAX] = '\0'; /* inc ToLongPath by one */ } - - void e(n) int n; { @@ -182,7 +178,6 @@ int n; errno = 0; } - void quit() { Chdir(".."); @@ -208,7 +203,6 @@ int option; return 0; } - int provided_option(option, minimum) int option, minimum; { @@ -229,7 +223,6 @@ int option, minimum; return 0; } - int variating_option(option, minimum) int option, minimum; { diff --git a/test/test37.c b/test/test37.c index b544eb278..45e2a40d0 100644 --- a/test/test37.c +++ b/test/test37.c @@ -140,7 +140,6 @@ void test37a() if (close(tube[1]) != 0) e(59); } - void test37b() { int tube[2], child2parent[2], parent2child[2]; @@ -237,7 +236,6 @@ void test37b() for (i = 3; i < OPEN_MAX; i++) (void) close(i); } - void e(n) int n; { @@ -255,7 +253,6 @@ int n; errno = 0; } - void quit() { if (errct == 0) { diff --git a/test/test38.c b/test/test38.c index 9d917f436..4bac6cb61 100644 --- a/test/test38.c +++ b/test/test38.c @@ -179,7 +179,6 @@ void test38b() if (strncmp(buf, "o!", 2) != 0) e(21); if (close(fd) != 0) e(22); - System("rm -rf ../DIR_38/*"); } @@ -215,8 +214,6 @@ void test38c() System("rm -rf ../DIR_38/*"); } - - void e(n) int n; { @@ -234,7 +231,6 @@ int n; errno = 0; } - void quit() { Chdir(".."); diff --git a/test/test39.c b/test/test39.c index 2235a966e..50cc15ed1 100644 --- a/test/test39.c +++ b/test/test39.c @@ -144,7 +144,6 @@ void test39d() fl.l_type = F_RDLCK; if (fcntl(fd7, F_SETLK, &fl) == -1) e(10); - switch (fork()) { case -1: printf("Can't fork\n"); break; case 0: @@ -257,7 +256,6 @@ void test39d() System("rm -f ../DIR_39/*\n"); } - /* This routine checks that fds 0 through 4, 7 and 8 are open and the rest ** is closed. It also checks if we can lock the first 10 bytes on fd no. 3 ** and 4. It should not be possible to lock fd no. 3, but it should be @@ -365,8 +363,6 @@ void makelongnames() ToLongPath[PATH_MAX] = '\0'; /* inc ToLongPath by one */ } - - void e(n) int n; { @@ -384,7 +380,6 @@ int n; errno = 0; } - void quit() { Chdir(".."); diff --git a/test/test4.c b/test/test4.c index bd72ed3fe..bb553e144 100644 --- a/test/test4.c +++ b/test/test4.c @@ -39,7 +39,6 @@ int main() return(-1); /* impossible */ } - void subr() { if ( (pid0 = fork()) != 0) { diff --git a/test/test40.c b/test/test40.c index 33b143584..fcca68f9a 100644 --- a/test/test40.c +++ b/test/test40.c @@ -308,7 +308,6 @@ void makelongnames() ToLongPath[PATH_MAX] = '\0'; /* inc ToLongPath by one */ } - void e(n) int n; { @@ -326,7 +325,6 @@ int n; errno = 0; } - void quit() { chdir(".."); diff --git a/test/test5.c b/test/test5.c index 71991314d..284820813 100644 --- a/test/test5.c +++ b/test/test5.c @@ -40,7 +40,6 @@ _PROTOTYPE(void ex, (void)); _PROTOTYPE(void e, (int n)); _PROTOTYPE(void quit, (void)); - #ifdef _ANSI void (*Signal(int _sig, void (*_func)(int)))(int); #define SIG_ZERO ((void (*)(int))0) /* default signal handling */ @@ -79,8 +78,6 @@ char *argv[]; return(-1); /* impossible */ } - - void test5a() { int parpid, childpid, flag, *zp; @@ -156,7 +153,6 @@ int s; /* for ANSI */ e(38); } - void test5b() { int cpid, n, pid; @@ -184,7 +180,6 @@ void test5b() } } - void test5c() { int n, i, pid, wpid; @@ -225,8 +220,6 @@ void test5d() } } - - void test5e() { /* When a signal knocks a processes out of WAIT or PAUSE, it is supposed to @@ -250,7 +243,6 @@ void test5e() } } - void test5f() { int i, j, k, n; @@ -282,7 +274,6 @@ void test5f() } } - void test5g() { int n; @@ -301,7 +292,6 @@ int s; /* for ANSI */ alarms++; } - void test5h() { /* When a signal knocks a processes out of PIPE, it is supposed to @@ -357,7 +347,6 @@ void test5i() unlink("XXXxxxXXX"); } - void ex() { int e = errno; @@ -365,7 +354,6 @@ void ex() exit(1); } - void e(n) int n; { @@ -396,7 +384,6 @@ void (*b)(); return(SIG_ZERO); } - void quit() { diff --git a/test/test6.c b/test/test6.c index dd6588358..489c5784a 100644 --- a/test/test6.c +++ b/test/test6.c @@ -55,8 +55,6 @@ char *argv[]; return(-1); /* impossible */ } - - void test6a() { /* Test sbrk() and brk(). */ @@ -107,7 +105,6 @@ void test6a() if (sbrk(0) != addr) e(12); } - void test6b() { int i, err; @@ -121,8 +118,6 @@ void test6b() kill(getpid(), SIGQUIT); } - - void test6c() { /* Test mknod, chdir, chmod, chown, access. */ diff --git a/test/test7.c b/test/test7.c index be072170b..47d954ea3 100644 --- a/test/test7.c +++ b/test/test7.c @@ -4,7 +4,6 @@ * pipe(), mkfifo(), fcntl() */ - #include #include #include @@ -50,7 +49,6 @@ _PROTOTYPE(void e, (int n)); _PROTOTYPE(void sigfunc, (int s)); _PROTOTYPE(void quit, (void)); - int main(argc, argv) int argc; char *argv[]; @@ -114,7 +112,6 @@ void test7a() for (i = 3; i < OPEN_MAX; i++) close(i); } - void test7b() { /* Test mkfifo(). */ @@ -183,7 +180,6 @@ void test7b() if (unlink("T7.b") != 0) e(28); } - void test7c() { /* Test fcntl(). */ @@ -269,7 +265,6 @@ void test7c() if (close(newfd2) != 0) e(48); } - void test7d() { /* Test file locking. */ @@ -415,7 +410,6 @@ void test7f() close(xfd); } - void test7g() { /* Test to see if SETLKW unlocks when the needed lock becomes available. */ @@ -449,7 +443,6 @@ void test7g() close(xfd); } - void test7h() { /* Test to see what happens if two processed block on the same lock. */ @@ -560,7 +553,6 @@ void test7i() } } - /* Check EMFILE. */ for (i = xfd + 1; i < OPEN_MAX; i++) open("T7.i", 0); /* use up all fds */ errno = 0; @@ -570,7 +562,6 @@ void test7i() for (i = xfd; i < OPEN_MAX; i++) if (close(i) != 0) e(29); } - void test7j() { /* Test file locking with two processes. */ @@ -620,7 +611,6 @@ void cloexec_test() exit(0); } - int set(how, first, last) int how, first, last; { diff --git a/test/test8.c b/test/test8.c index 824b63f4a..f16bdfef3 100644 --- a/test/test8.c +++ b/test/test8.c @@ -82,7 +82,6 @@ char *argv[]; system("rm -rf DIR_08; mkdir DIR_08"); chdir("DIR_08"); - for (i = 0; i < ITERATIONS; i++) { iteration = i; if (m & 0000001) test8a(); @@ -106,7 +105,6 @@ char *argv[]; return(-1); /* impossible */ } - void test8a() { /* Test signal set management. */ diff --git a/test/test9.c b/test/test9.c index 59ced5998..2e63c989e 100644 --- a/test/test9.c +++ b/test/test9.c @@ -62,7 +62,6 @@ to the value they had at the time of the Setjmp\n"); return(-1); /* impossible */ } - void test9a() { register p;