Al's no-double-empty-lines crusade

This commit is contained in:
Ben Gras 2005-08-22 15:08:27 +00:00
parent 72fbaa659b
commit a17d7c827b
50 changed files with 0 additions and 275 deletions

View file

@ -22,7 +22,6 @@
#include <net/netlib.h> #include <net/netlib.h>
#include <time.h> #include <time.h>
#define NUMBER 12 #define NUMBER 12
void main(void) { void main(void) {

View file

@ -106,7 +106,6 @@ void main(void) {
FD_SET(fd3, &fds_read); /* fd3 => O_WRONLY */ FD_SET(fd3, &fds_read); /* fd3 => O_WRONLY */
FD_SET(fd4, &fds_read); /* fd4 => 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) */ /* make a select call where none of them are ready (don't use fd5 and fd6) */
/* create a timeout as well */ /* create a timeout as well */
timeout.tv_sec = 5; timeout.tv_sec = 5;
@ -120,7 +119,6 @@ void main(void) {
printf("* Dump RESULTING fds_write:\n"); printf("* Dump RESULTING fds_write:\n");
dump_fdset(&fds_write); dump_fdset(&fds_write);
/* close and delete dummy files */ /* close and delete dummy files */
close(fd1); close(fd1);
close(fd2); close(fd2);

View file

@ -34,7 +34,6 @@ typedef struct
char data[1024]; char data[1024];
} udp_buffer_t; } udp_buffer_t;
int udp_conf(char *host, long port, udp_io_hdr_t *header) int udp_conf(char *host, long port, udp_io_hdr_t *header)
{ {
/* configures UDP connection */ /* configures UDP connection */

View file

@ -76,7 +76,6 @@ int udp_conf(long port) {
return netfd; return netfd;
} }
int main(int argc,char *argv[]) { int main(int argc,char *argv[]) {
int fd; int fd;
ssize_t data_read; ssize_t data_read;

View file

@ -37,7 +37,6 @@ typedef struct
char data[1024]; char data[1024];
} udp_buffer_t; } udp_buffer_t;
int udp_conf(char *host, long port, udp_io_hdr_t *header) int udp_conf(char *host, long port, udp_io_hdr_t *header)
{ {
/* configures UDP connection */ /* configures UDP connection */
@ -115,7 +114,6 @@ int main(int argc,char *argv[]) {
if ((fd = udp_conf(argv[1], PORT, &buffer_send.header) ) < 0) if ((fd = udp_conf(argv[1], PORT, &buffer_send.header) ) < 0)
exit(-1); exit(-1);
while (1) while (1)
{ {

View file

@ -76,7 +76,6 @@ int udp_conf(long port) {
return netfd; return netfd;
} }
int main(int argc,char *argv[]) { int main(int argc,char *argv[]) {
int fd; int fd;
ssize_t data_read; ssize_t data_read;
@ -96,7 +95,6 @@ int main(int argc,char *argv[]) {
printf("Waiting for messages on port: %ld\n", PORT); printf("Waiting for messages on port: %ld\n", PORT);
fflush(stdout); fflush(stdout);
/* get a first message so we know who is the client and we can harass it /* get a first message so we know who is the client and we can harass it
afterwards */ afterwards */

View file

@ -80,7 +80,6 @@ int listen(long port) {
return netfd; return netfd;
} }
int main(int argc,char *argv[]) { int main(int argc,char *argv[]) {
int fd; int fd;
ssize_t data_read; ssize_t data_read;

View file

@ -82,7 +82,6 @@ int listen(long port) {
return netfd; return netfd;
} }
int main(int argc,char *argv[]) { int main(int argc,char *argv[]) {
int fd; int fd;
ssize_t data_read; ssize_t data_read;

View file

@ -98,7 +98,6 @@ int listen(long port) {
return netfd; return netfd;
} }
int main(int argc,char *argv[]) { int main(int argc,char *argv[]) {
int fd; int fd;
ssize_t data_read; ssize_t data_read;

View file

@ -19,7 +19,6 @@
#include <string.h> #include <string.h>
#include <limits.h> #include <limits.h>
void main(void) { void main(void) {
fd_set fds_read, fds_write; fd_set fds_read, fds_write;
int retval; int retval;

View file

@ -22,7 +22,6 @@
#include <limits.h> #include <limits.h>
#include <string.h> #include <string.h>
void main(void) { void main(void) {
fd_set fds_read, fds_write; fd_set fds_read, fds_write;
int retval; int retval;

View file

@ -8,7 +8,6 @@
* *
* Ben Gras * Ben Gras
*/ */
#include <time.h> #include <time.h>
#include <sys/types.h> #include <sys/types.h>
#include <sys/wait.h> #include <sys/wait.h>
@ -22,17 +21,12 @@
#include <string.h> #include <string.h>
#include <signal.h> #include <signal.h>
#include <libutil.h> #include <libutil.h>
char name[100]; char name[100];
void pipehandler(int sig) void pipehandler(int sig)
{ {
} }
#define CHILDFD 1 #define CHILDFD 1
#define PARENTFD 0 #define PARENTFD 0
void do_child(int pty_fds[]) void do_child(int pty_fds[])
{ {
/* reads from pipe and prints out the data */ /* 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_read;
fd_set fds_exception; fd_set fds_exception;
struct timeval timeout; struct timeval timeout;
signal(SIGPIPE, pipehandler); signal(SIGPIPE, pipehandler);
signal(SIGUSR1, pipehandler); signal(SIGUSR1, pipehandler);
/* first, close the write part, since it is not needed */ /* first, close the write part, since it is not needed */
close(pty_fds[PARENTFD]); close(pty_fds[PARENTFD]);
@ -83,19 +75,15 @@ void do_child(int pty_fds[])
exit(0); exit(0);
} }
void do_parent(int pty_fds[]) void do_parent(int pty_fds[])
{ {
char data[1024]; char data[1024];
int retval; int retval;
fd_set fds_write; fd_set fds_write;
signal(SIGPIPE, pipehandler); signal(SIGPIPE, pipehandler);
signal(SIGUSR1, pipehandler); signal(SIGUSR1, pipehandler);
/* first, close the read part of pty, since it is not needed */ /* first, close the read part of pty, since it is not needed */
close(pty_fds[CHILDFD]); close(pty_fds[CHILDFD]);
/* now enter a loop of read user input, and writing it to the pty */ /* now enter a loop of read user input, and writing it to the pty */
while (1) { while (1) {
FD_ZERO(&fds_write); FD_ZERO(&fds_write);
@ -108,7 +96,6 @@ void do_parent(int pty_fds[])
fprintf(stderr, "Parent: Error in select\n"); fprintf(stderr, "Parent: Error in select\n");
exit(-1); exit(-1);
} }
printf("Input data: "); printf("Input data: ");
if(!gets(data)) { if(!gets(data)) {
printf("parent: eof; exiting\n"); printf("parent: eof; exiting\n");
@ -127,20 +114,17 @@ void do_parent(int pty_fds[])
exit(-1); exit(-1);
} else printf("wrote %d\n", retval); } else printf("wrote %d\n", retval);
} }
/* got exit from user */ /* got exit from user */
close(pty_fds[PARENTFD]); /* close pty, let child know we're done */ close(pty_fds[PARENTFD]); /* close pty, let child know we're done */
wait(&retval); wait(&retval);
printf("Child exited with status: %d\n", retval); printf("Child exited with status: %d\n", retval);
exit(0); exit(0);
} }
int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {
int ptys[2]; int ptys[2];
int retval; int retval;
int pid; int pid;
if(openpty(&ptys[0], &ptys[1], name, NULL, NULL) < 0) { if(openpty(&ptys[0], &ptys[1], name, NULL, NULL) < 0) {
perror("openpty"); perror("openpty");
return 1; return 1;
@ -151,12 +135,10 @@ int main(int argc, char *argv[])
fprintf(stderr, "Error forking\n"); fprintf(stderr, "Error forking\n");
exit(-1); exit(-1);
} }
if (pid == 0) /* child proc */ if (pid == 0) /* child proc */
do_child(ptys); do_child(ptys);
else else
do_parent(ptys); do_parent(ptys);
/* not reached */ /* not reached */
return 0; return 0;
} }

View file

@ -56,7 +56,6 @@ char *s1, *s2;
} }
} }
void e(n) void e(n)
int n; int n;
{ {

View file

@ -107,7 +107,6 @@ void test1b()
} }
} }
void parent1(childpid) void parent1(childpid)
int childpid; int childpid;
{ {
@ -133,7 +132,6 @@ void child1()
exit(gct); exit(gct);
} }
void quit() void quit()
{ {

View file

@ -107,7 +107,6 @@ void mkfiles()
close(fd); close(fd);
} }
void cr_file(name, size) void cr_file(name, size)
char *name; char *name;
int size; int size;

View file

@ -67,14 +67,12 @@ char *argv[];
return(0); return(0);
} }
void test11a() void test11a()
{ {
/* Test exec */ /* Test exec */
int n, fd; int n, fd;
char aa[4]; char aa[4];
subtest = 1; subtest = 1;
if (fork()) { if (fork()) {
@ -121,8 +119,6 @@ void test11a()
} }
} }
void test11b() void test11b()
{ {
int n; int n;

View file

@ -33,7 +33,6 @@ int main()
name[7] = ((pid * pid) & 037) + 33; name[7] = ((pid * pid) & 037) + 33;
name[8] = 0; name[8] = 0;
for (i = 0; i < TRIALS; i++) { for (i = 0; i < TRIALS; i++) {
if ( (fd0 = creat(name, 0777)) < 0) e(1); if ( (fd0 = creat(name, 0777)) < 0) e(1);
if (write(fd0, name, 20) != 20) e(2); if (write(fd0, name, 20) != 20) e(2);
@ -41,7 +40,6 @@ int main()
if (close(fd0) != 0) e(4); if (close(fd0) != 0) e(4);
} }
fd0 = creat(name, 0777); fd0 = creat(name, 0777);
write(fd0, name, 20); write(fd0, name, 20);
unlink(name); unlink(name);
@ -49,7 +47,6 @@ int main()
return(-1); /* impossible */ return(-1); /* impossible */
} }
void e(n) void e(n)
int n; int n;
{ {

View file

@ -577,7 +577,6 @@ void second()
(void) memmove(one + 2, one + 1, 8); (void) memmove(one + 2, one + 1, 8);
equal(one, "abbcdefgh", 14); equal(one, "abbcdefgh", 14);
/* Memccpy - first test like memcpy, then the search part /* Memccpy - first test like memcpy, then the search part
* The SVID, the only place where memccpy is mentioned, says overlap * 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 * might fail, so we don't try it. Besides, it's hard to see the

View file

@ -40,7 +40,6 @@ char *argv[];
return(-1); /* impossible */ return(-1); /* impossible */
} }
void test16a() void test16a()
{ {
/* Test atime, ctime, and mtime. */ /* Test atime, ctime, and mtime. */
@ -207,7 +206,6 @@ void test16a()
if (unlink("T16.k") != 0) e(86); if (unlink("T16.k") != 0) e(86);
} }
void get_times(name, a, c, m) void get_times(name, a, c, m)
char *name; char *name;
time_t *a, *c, *m; time_t *a, *c, *m;
@ -220,8 +218,6 @@ time_t *a, *c, *m;
*m = s.st_mtime; *m = s.st_mtime;
} }
void e(n) void e(n)
int n; int n;
{ {

View file

@ -160,8 +160,6 @@ int mask;
umask(022); umask(022);
} /* test */ } /* test */
/* "t1.c" created by Rene Montsma and Menno Wilcke */ /* "t1.c" created by Rene Montsma and Menno Wilcke */
/***************************************************************************** /*****************************************************************************
@ -324,8 +322,6 @@ void test02()
check(CREAT, EISDIR); check(CREAT, EISDIR);
} /* test02 */ } /* test02 */
void test08() void test08()
{ {
/* Test chdir to searchable dir */ /* Test chdir to searchable dir */
@ -442,7 +438,6 @@ void test09()
/* New page */ /* New page */
/* "t4.c", created by Rene Montsma and Menno Wilcke */ /* "t4.c", created by Rene Montsma and Menno Wilcke */
/***************************************************************************** /*****************************************************************************
@ -551,7 +546,6 @@ void test10()
} /* test10 */ } /* test10 */
int link_alot(bigboss) int link_alot(bigboss)
char *bigboss; char *bigboss;
{ {
@ -697,7 +691,6 @@ void test11()
/* New page */ /* New page */
void comp_stats(stbf1, stbf2) void comp_stats(stbf1, stbf2)
struct stat *stbf1, *stbf2; struct stat *stbf1, *stbf2;
{ {
@ -715,11 +708,8 @@ struct stat *stbf1, *stbf2;
/* New page */ /* New page */
/* "t5.c", created by Rene Montsma and Menno Wilcke */ /* "t5.c", created by Rene Montsma and Menno Wilcke */
void comp_inodes(m, m1) void comp_inodes(m, m1)
int m, m1; /* twee filedes's */ int m, m1; /* twee filedes's */
{ {
@ -1067,7 +1057,6 @@ int nr;
* * * *
*****************************************************************************/ *****************************************************************************/
int open_alot() int open_alot()
{ {
int i; int i;

View file

@ -113,7 +113,6 @@ _PROTOTYPE(void clean_up_the_mess, (void));
_PROTOTYPE(void chmod_8_dirs, (int sw)); _PROTOTYPE(void chmod_8_dirs, (int sw));
_PROTOTYPE(void quit, (void)); _PROTOTYPE(void quit, (void));
/***************************************************************************** /*****************************************************************************
* TEST * * TEST *
****************************************************************************/ ****************************************************************************/
@ -144,8 +143,6 @@ int main()
return(0); return(0);
} }
void test() void test()
{ {
umask(0); /* not honest, but i always forget */ umask(0); /* not honest, but i always forget */
@ -161,11 +158,6 @@ void test()
umask(022); umask(022);
} /* test */ } /* test */
/* "t1.c" created by Rene Montsma and Menno Wilcke */ /* "t1.c" created by Rene Montsma and Menno Wilcke */
/***************************************************************************** /*****************************************************************************
@ -187,7 +179,6 @@ void test01()
if ((tempvalue = umask(0)) != 0) err(2, UMASK, "values"); if ((tempvalue = umask(0)) != 0) err(2, UMASK, "values");
/* Now test all possible modes of umask on a file */ /* Now test all possible modes of umask on a file */
for (newvalue = MASK; newvalue >= 0; newvalue -= 0111) { for (newvalue = MASK; newvalue >= 0; newvalue -= 0111) {
tempvalue = umask(newvalue); tempvalue = umask(newvalue);
@ -210,8 +201,6 @@ void test01()
err(7, UMASK, "umask may influence rest of tests!"); err(7, UMASK, "umask may influence rest of tests!");
} /* test01 */ } /* test01 */
/***************************************************************************** /*****************************************************************************
* test CREAT * * test CREAT *
****************************************************************************/ ****************************************************************************/
@ -334,10 +323,6 @@ void test02()
check(CREAT, EISDIR); check(CREAT, EISDIR);
} /* test02 */ } /* test02 */
/***************************************************************************** /*****************************************************************************
* test WRITE * * test WRITE *
****************************************************************************/ ****************************************************************************/
@ -395,7 +380,6 @@ void test03()
} }
} /* test03 */ } /* test03 */
void write_standards(filedes, a) void write_standards(filedes, a)
int filedes; int filedes;
char a[]; char a[];
@ -420,14 +404,8 @@ char a[];
#endif #endif
} /* write_standards */ } /* write_standards */
/* "t2.c", created by Rene Montsma and Menno Wilcke */ /* "t2.c", created by Rene Montsma and Menno Wilcke */
/***************************************************************************** /*****************************************************************************
* test READ * * test READ *
****************************************************************************/ ****************************************************************************/
@ -505,7 +483,6 @@ void test04()
} }
} /* test04 */ } /* test04 */
void read_standards(filedes, a) void read_standards(filedes, a)
int filedes; int filedes;
char a[]; char a[];
@ -520,14 +497,12 @@ char a[];
else if (read(filedes, b, ARSIZE) != READ_EOF) else if (read(filedes, b, ARSIZE) != READ_EOF)
err(11, READ, "read beyond endoffile"); err(11, READ, "read beyond endoffile");
/* Try giving read wrong input: wrong filedes */ /* Try giving read wrong input: wrong filedes */
if (read(FAIL, b, ARSIZE) != FAIL) if (read(FAIL, b, ARSIZE) != FAIL)
err(2, READ, "filedes"); err(2, READ, "filedes");
else else
check(READ, EBADF); check(READ, EBADF);
/* Wrong length */ /* Wrong length */
if (read(filedes, b, -ARSIZE) != FAIL) if (read(filedes, b, -ARSIZE) != FAIL)
err(2, READ, "length"); err(2, READ, "length");
@ -535,8 +510,6 @@ char a[];
check(READ, EINVAL); check(READ, EINVAL);
} /* read_standards */ } /* read_standards */
void read_more(filedes, a) void read_more(filedes, a)
int filedes; int filedes;
char a[]; char a[];
@ -662,11 +635,9 @@ void test05()
else else
check(OPEN, EACCES); check(OPEN, EACCES);
/* Unlink testfile */ /* Unlink testfile */
try_unlink("file05"); try_unlink("file05");
/* File is not readable */ /* File is not readable */
if (open("drwx/-wx", R) != FAIL) if (open("drwx/-wx", R) != FAIL)
err(11, OPEN, "open unreadable file for reading"); err(11, OPEN, "open unreadable file for reading");
@ -698,7 +669,6 @@ void test05()
check(CLOSE, EBADF); check(CLOSE, EBADF);
} /* test05 */ } /* test05 */
void try_open(fname, mode, test) void try_open(fname, mode, test)
int mode, test; int mode, test;
char *fname; char *fname;
@ -710,8 +680,6 @@ char *fname;
if (n != FAIL) try_close(n, fname); /* cleanup */ if (n != FAIL) try_close(n, fname); /* cleanup */
} /* try_open */ } /* try_open */
/***************************************************************************** /*****************************************************************************
* test LSEEK * * test LSEEK *
****************************************************************************/ ****************************************************************************/
@ -771,12 +739,8 @@ void test06()
} }
/* "t3.c", created by Rene Montsma and Menno Wilcke */ /* "t3.c", created by Rene Montsma and Menno Wilcke */
/***************************************************************************** /*****************************************************************************
* test ACCESS * * test ACCESS *
****************************************************************************/ ****************************************************************************/
@ -795,7 +759,6 @@ void test07()
if (chdir("..") != OK) err(5, CHDIR, "'..'"); if (chdir("..") != OK) err(5, CHDIR, "'..'");
/* Check several wrong combinations */ /* Check several wrong combinations */
/* File does not exist */ /* File does not exist */
if (access("non-file", 0) != FAIL) if (access("non-file", 0) != FAIL)
@ -817,7 +780,6 @@ void test07()
} /* test07 */ } /* test07 */
void access_standards() void access_standards()
{ {
int i, mode = 0; int i, mode = 0;
@ -874,8 +836,6 @@ void access_standards()
for (i = 0; i < 8; i++) try_access(fnames[mode], i, OK); for (i = 0; i < 8; i++) try_access(fnames[mode], i, OK);
} /* access_standards */ } /* access_standards */
void try_access(fname, mode, test) void try_access(fname, mode, test)
int mode, test; int mode, test;
char *fname; char *fname;
@ -884,21 +844,13 @@ char *fname;
err(100, ACCESS, "incorrect access on a file (try_access)"); err(100, ACCESS, "incorrect access on a file (try_access)");
} /* try_access */ } /* try_access */
/* "support.c", created by Rene Montsma and Menno Wilcke */ /* "support.c", created by Rene Montsma and Menno Wilcke */
/* Err, make_and_fill_dirs, init_array, clear_array, comp_array, /* Err, make_and_fill_dirs, init_array, clear_array, comp_array,
try_close, try_unlink, Remove, get_mode, check, open_alot, try_close, try_unlink, Remove, get_mode, check, open_alot,
close_alot, clean_up_the_mess. close_alot, clean_up_the_mess.
*/ */
/*********************************************************************** /***********************************************************************
* EXTENDED FIONS * * EXTENDED FIONS *
**********************************************************************/ **********************************************************************/
@ -923,7 +875,6 @@ char *s;
printf(s); printf(s);
} }
/***************************************************************************** /*****************************************************************************
* * * *
* ERR(or) messages * * ERR(or) messages *
@ -1029,7 +980,6 @@ int number;
nlcr(); nlcr();
} /* err */ } /* err */
/***************************************************************************** /*****************************************************************************
* * * *
* MAKE_AND_FILL_DIRS * * MAKE_AND_FILL_DIRS *
@ -1060,8 +1010,6 @@ void make_and_fill_dirs()
} /* make_and_fill_dirs */ } /* make_and_fill_dirs */
void put_file_in_dir(dirname, mode) void put_file_in_dir(dirname, mode)
char *dirname; char *dirname;
int mode; int mode;
@ -1069,7 +1017,6 @@ int mode;
{ {
int nr; int nr;
if (chdir(dirname) != OK) if (chdir(dirname) != OK)
err(5, CHDIR, "to dirname (put_f_in_dir)"); err(5, CHDIR, "to dirname (put_f_in_dir)");
else { else {
@ -1084,7 +1031,6 @@ int mode;
} }
} /* put_file_in_dir */ } /* put_file_in_dir */
/***************************************************************************** /*****************************************************************************
* * * *
* MISCELLANEOUS * * MISCELLANEOUS *
@ -1093,7 +1039,6 @@ int mode;
* * * *
*****************************************************************************/ *****************************************************************************/
void init_array(a) void init_array(a)
char *a; char *a;
{ {
@ -1113,7 +1058,6 @@ char *b;
} /* clear_array */ } /* clear_array */
int comp_array(a, b, range) int comp_array(a, b, range)
char *a, *b; char *a, *b;
int range; int range;
@ -1130,7 +1074,6 @@ int range;
} }
} /* comp_array */ } /* comp_array */
void try_close(filedes, name) void try_close(filedes, name)
int filedes; int filedes;
char *name; char *name;
@ -1138,14 +1081,12 @@ char *name;
if (close(filedes) != OK) err(5, CLOSE, name); if (close(filedes) != OK) err(5, CLOSE, name);
} /* try_close */ } /* try_close */
void try_unlink(fname) void try_unlink(fname)
char *fname; char *fname;
{ {
if (unlink(fname) != 0) err(5, UNLINK, fname); if (unlink(fname) != 0) err(5, UNLINK, fname);
} /* try_unlink */ } /* try_unlink */
void Remove(fdes, fname) void Remove(fdes, fname)
int fdes; int fdes;
char *fname; char *fname;
@ -1154,7 +1095,6 @@ char *fname;
try_unlink(fname); try_unlink(fname);
} /* Remove */ } /* Remove */
int get_mode(name) int get_mode(name)
char *name; char *name;
{ {
@ -1169,14 +1109,12 @@ char *name;
return(stbf1.st_mode & 07777); /* take last 4 bits */ return(stbf1.st_mode & 07777); /* take last 4 bits */
} /* get_mode */ } /* get_mode */
/***************************************************************************** /*****************************************************************************
* * * *
* CHECK * * CHECK *
* * * *
*****************************************************************************/ *****************************************************************************/
void check(scall, number) void check(scall, number)
int number; int number;
char *scall; char *scall;
@ -1235,16 +1173,12 @@ int nr;
} }
} }
/***************************************************************************** /*****************************************************************************
* * * *
* ALOT-functions * * ALOT-functions *
* * * *
*****************************************************************************/ *****************************************************************************/
int open_alot() int open_alot()
{ {
int i; int i;
@ -1255,7 +1189,6 @@ int open_alot()
return(i); return(i);
} /* open_alot */ } /* open_alot */
int close_alot(number) int close_alot(number)
int number; int number;
{ {
@ -1270,14 +1203,12 @@ int number;
return(number - count); /* return number of closed files */ return(number - count); /* return number of closed files */
} /* close_alot */ } /* close_alot */
/***************************************************************************** /*****************************************************************************
* * * *
* CLEAN UP THE MESS * * CLEAN UP THE MESS *
* * * *
*****************************************************************************/ *****************************************************************************/
void clean_up_the_mess() void clean_up_the_mess()
{ {
int i; int i;
@ -1294,7 +1225,6 @@ void clean_up_the_mess()
if (chdir("..") != OK) err(5, CHDIR, "to '..'"); if (chdir("..") != OK) err(5, CHDIR, "to '..'");
} }
/* Before unlinking files in some dirs, make them writable */ /* Before unlinking files in some dirs, make them writable */
chmod_8_dirs(RWX); chmod_8_dirs(RWX);
@ -1332,8 +1262,6 @@ int sw; /* if switch == 8, give all different
} }
} }
void quit() void quit()
{ {

View file

@ -32,7 +32,6 @@ _PROTOTYPE(void pipecatcher, (int s));
_PROTOTYPE(void e, (int n)); _PROTOTYPE(void e, (int n));
_PROTOTYPE(void quit, (void)); _PROTOTYPE(void quit, (void));
int main(argc, argv) int main(argc, argv)
int argc; int argc;
char *argv[]; char *argv[];
@ -115,7 +114,6 @@ void test19a()
if (unlink("T19.a3") != 0) e(32); if (unlink("T19.a3") != 0) e(32);
} }
void test19b() void test19b()
{ {
/* Test open with O_APPEND and O_TRUNC. */ /* Test open with O_APPEND and O_TRUNC. */
@ -147,7 +145,6 @@ void test19b()
unlink("T19.b1"); unlink("T19.b1");
} }
void test19c() void test19c()
{ {
/* Test program for open(), close(), creat(), read(), write(), lseek(). */ /* Test program for open(), close(), creat(), read(), write(), lseek(). */
@ -280,8 +277,6 @@ void test19d()
if (unlink("T19.d1") != 0) e(20); if (unlink("T19.d1") != 0) e(20);
} }
void test19e() void test19e()
{ {
/* Test link, unlink, stat, fstat, dup, umask. */ /* Test link, unlink, stat, fstat, dup, umask. */
@ -381,7 +376,6 @@ void test19f()
} }
} }
void test19g() void test19g()
{ {
/* Test POSIX calls for pipe, read, write, lseek and close. */ /* Test POSIX calls for pipe, read, write, lseek and close. */
@ -477,21 +471,18 @@ void test19g()
if (unlink("T19.g1") != 0) e(60); if (unlink("T19.g1") != 0) e(60);
} }
void clraa() void clraa()
{ {
int i; int i;
for (i = 0; i < 100; i++) aa[i] = 0; for (i = 0; i < 100; i++) aa[i] = 0;
} }
void pipecatcher(s) void pipecatcher(s)
int s; /* it is supposed to have an arg */ int s; /* it is supposed to have an arg */
{ {
pipesigs++; pipesigs++;
} }
void e(n) void e(n)
int n; int n;
{ {
@ -528,4 +519,3 @@ void quit()
} }
} }

View file

@ -63,7 +63,6 @@ char *argv[];
return(-1); /* impossible */ return(-1); /* impossible */
} }
void test2a() void test2a()
{ {
/* Test pipes */ /* Test pipes */
@ -123,7 +122,6 @@ void test2a()
} }
} }
void test2b() void test2b()
{ {
int fd[2], n; int fd[2], n;
@ -148,8 +146,6 @@ void test2b()
} }
} }
void test2c() void test2c()
{ {
int n; int n;
@ -264,7 +260,6 @@ void test2d()
if (errno != ECHILD) e(26); if (errno != ECHILD) e(26);
} }
void test2e() void test2e()
{ {
@ -301,7 +296,6 @@ void test2e()
} }
void test2f() void test2f()
{ {
/* test getpid, getppid, getuid, etc. */ /* test getpid, getppid, getuid, etc. */
@ -376,7 +370,6 @@ void test2h()
if (getgroups(0, g) != 0) e(3); if (getgroups(0, g) != 0) e(3);
} }
void sigpip(s) void sigpip(s)
int s; /* for ANSI */ int s; /* for ANSI */
{ {

View file

@ -10,7 +10,6 @@
* getcwd() * getcwd()
*/ */
#include <sys/types.h> #include <sys/types.h>
#include <sys/stat.h> #include <sys/stat.h>
#include <dirent.h> #include <dirent.h>
@ -189,7 +188,6 @@ int t; /* subtest number to use */
return; return;
} }
void test20b() void test20b()
{ {
/* Subtest 4. Test error handling. */ /* Subtest 4. Test error handling. */
@ -217,7 +215,6 @@ void test20b()
} }
void test20c() void test20c()
{ {
/* Subtest 5. See what happens if we open too many directory streams. */ /* 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); if (system("rmdir Dir") != 0) e(33);
} }
void test20e() void test20e()
{ {
/* Test open. */ /* Test open. */
@ -446,7 +442,6 @@ void test20f()
if (unlink("T20f") < 0) e(54); if (unlink("T20f") < 0) e(54);
} }
void test20g() void test20g()
{ {
/* Test link and unlink. */ /* Test link and unlink. */

View file

@ -345,7 +345,6 @@ void test21d()
} }
void test21e() void test21e()
{ {
/* Test error conditions. */ /* Test error conditions. */
@ -423,7 +422,6 @@ void test21f()
if (rmdir("D1") != 0) e(11); if (rmdir("D1") != 0) e(11);
} }
void test21g() void test21g()
{ {
int fd, D1_before, D1_after, D2_before, D2_after, x_link, y_link; 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); if (rmdir("D1") != 0) e(12);
} }
void test21n() void test21n()
{ {
int D1_before, D1_after, D2_before, D2_after, x_link, y_link; 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); if (rmdir("D2") != 0) e(19);
} }
void test21o() void test21o()
{ {
/* Test trying to remove . and .. */ /* Test trying to remove . and .. */
@ -645,7 +641,6 @@ void test21o()
if (rmdir("D1") != 0) e(14); if (rmdir("D1") != 0) e(14);
} }
int get_link(name) int get_link(name)
char *name; char *name;
{ {
@ -659,7 +654,6 @@ char *name;
return(statbuf.st_nlink); return(statbuf.st_nlink);
} }
void e(n) void e(n)
int n; int n;
{ {

View file

@ -185,7 +185,6 @@ int n;
errno = 0; errno = 0;
} }
void quit() void quit()
{ {
Chdir(".."); Chdir("..");

View file

@ -292,7 +292,6 @@ void test23c()
if (chdir(cwd) != 0) e(58); if (chdir(cwd) != 0) e(58);
} }
void makelongnames() void makelongnames()
{ {
register int i; register int i;
@ -314,7 +313,6 @@ void makelongnames()
ToLongPath[PATH_MAX] = '\0'; /* inc ToLongPath by one */ ToLongPath[PATH_MAX] = '\0'; /* inc ToLongPath by one */
} }
/* The following code, is take from pwd written by Adri Koppes */ /* The following code, is take from pwd written by Adri Koppes */
/* My_getcwd() helper. */ /* My_getcwd() helper. */
@ -331,7 +329,6 @@ char ch;
return(retval); return(retval);
} }
char *my_getcwd(buf, size) char *my_getcwd(buf, size)
char *buf; char *buf;
int size; int size;
@ -386,7 +383,6 @@ int size;
return buf; return buf;
} }
void e(n) void e(n)
int n; int n;
{ {
@ -404,7 +400,6 @@ int n;
errno = 0; errno = 0;
} }
void quit() void quit()
{ {
Chdir(".."); Chdir("..");

View file

@ -39,7 +39,6 @@ char MaxPath[PATH_MAX]; /* Same for path */
char ToLongName[NAME_MAX + 2]; /* Name of maximum +1 length */ char ToLongName[NAME_MAX + 2]; /* Name of maximum +1 length */
char ToLongPath[PATH_MAX + 1]; /* Same for path, both too long */ char ToLongPath[PATH_MAX + 1]; /* Same for path, both too long */
void main(argc, argv) void main(argc, argv)
int argc; int argc;
char *argv[]; char *argv[];
@ -165,7 +164,6 @@ void test24a()
if (closedir(dirp) != 0) e(34); /* close parent's foo */ if (closedir(dirp) != 0) e(34); /* close parent's foo */
} }
void test24b() void test24b()
{ {
/* See what happens with too many dir's open. Check if file size seems ok, /* 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); if (closedir(dirp[2]) != 0) e(27);
} }
void test24c() void test24c()
{ {
/* Test whether wrong things go wrong right. */ /* Test whether wrong things go wrong right. */
@ -349,7 +346,6 @@ DIR *dirp; /* (`f1', `f3', `f5', `.', `..') */
subtest = oldsubtest; subtest = oldsubtest;
} }
void makelongnames() void makelongnames()
{ {
register int i; register int i;
@ -371,7 +367,6 @@ void makelongnames()
ToLongPath[PATH_MAX] = '\0'; /* inc ToLongPath by one */ ToLongPath[PATH_MAX] = '\0'; /* inc ToLongPath by one */
} }
void e(n) void e(n)
int n; int n;
{ {
@ -389,7 +384,6 @@ int n;
errno = 0; errno = 0;
} }
void quit() void quit()
{ {
Chdir(".."); Chdir("..");

View file

@ -93,7 +93,6 @@ void test25a()
if (!(EXCLUDE(O_RDWR, ADDIT))) e(7); if (!(EXCLUDE(O_RDWR, ADDIT))) e(7);
} }
void test25b() void test25b()
{ /* Test normal operation. */ { /* Test normal operation. */
@ -362,7 +361,6 @@ void test25b()
} }
} }
void test25c() void test25c()
{ /* Test normal operation Part two. */ { /* Test normal operation Part two. */
int fd1, fd2; int fd1, fd2;
@ -569,7 +567,6 @@ void test25d()
MaxPath[strlen(MaxPath) - 1] = '/'; /* make ././.../a */ MaxPath[strlen(MaxPath) - 1] = '/'; /* make ././.../a */
} }
void test25e() void test25e()
{ {
int fd; int fd;
@ -676,7 +673,6 @@ void test25e()
ToLongPath[PATH_MAX - 1] = '/'; ToLongPath[PATH_MAX - 1] = '/';
} }
void makelongnames() void makelongnames()
{ {
register int i; register int i;
@ -698,8 +694,6 @@ void makelongnames()
ToLongPath[PATH_MAX] = '\0'; /* inc ToLongPath by one */ ToLongPath[PATH_MAX] = '\0'; /* inc ToLongPath by one */
} }
void e(n) void e(n)
int n; int n;
{ {
@ -717,7 +711,6 @@ int n;
errno = 0; errno = 0;
} }
void quit() void quit()
{ {
Chdir(".."); Chdir("..");

View file

@ -65,7 +65,6 @@ void test26a()
subtest = 1; subtest = 1;
System("rm -rf ../DIR_26/*"); System("rm -rf ../DIR_26/*");
System("echo -n hihaho > hihaho"); System("echo -n hihaho > hihaho");
if ((fd = open("hihaho", O_RDONLY)) != 3) e(1); if ((fd = open("hihaho", O_RDONLY)) != 3) e(1);
if (lseek(fd, (off_t) 3, SEEK_SET) != (off_t) 3) e(2); if (lseek(fd, (off_t) 3, SEEK_SET) != (off_t) 3) e(2);
@ -245,7 +244,6 @@ void test26c()
} }
} }
void e(n) void e(n)
int n; int n;
{ {
@ -263,7 +261,6 @@ int n;
errno = 0; errno = 0;
} }
void quit() void quit()
{ {
Chdir(".."); Chdir("..");

View file

@ -58,7 +58,6 @@ char *argv[];
quit(); quit();
} }
void test27a() void test27a()
{ /* Test Normal operation. */ { /* Test Normal operation. */
struct stat st1, st2; struct stat st1, st2;
@ -296,7 +295,6 @@ void test27c()
System("rm -rf ../DIR_27/*"); System("rm -rf ../DIR_27/*");
} }
void makelongnames() void makelongnames()
{ {
register int i; register int i;
@ -335,7 +333,6 @@ int n;
errno = 0; errno = 0;
} }
void quit() void quit()
{ {
Chdir(".."); Chdir("..");

View file

@ -69,7 +69,6 @@ char *argv[];
quit(); quit();
} }
void test28a() void test28a()
{ {
int mode; /* used in for loop */ int mode; /* used in for loop */
@ -164,7 +163,6 @@ void test28a()
if (st.st_mtime >= time2) e(44); if (st.st_mtime >= time2) e(44);
} }
void test28b() void test28b()
{ /* Test critical values. */ { /* Test critical values. */
struct stat st; struct stat st;
@ -387,7 +385,6 @@ void test28c()
System("rm -rf foo"); /* clean up */ System("rm -rf foo"); /* clean up */
} }
void makelongnames() void makelongnames()
{ {
register int i; register int i;
@ -409,7 +406,6 @@ void makelongnames()
ToLongPath[PATH_MAX] = '\0'; /* inc ToLongPath by one */ ToLongPath[PATH_MAX] = '\0'; /* inc ToLongPath by one */
} }
void e(n) void e(n)
int n; int n;
{ {
@ -427,7 +423,6 @@ int n;
errno = 0; errno = 0;
} }
void quit() void quit()
{ {
Chdir(".."); Chdir("..");

View file

@ -475,7 +475,6 @@ errno =0;
} }
} }
void test29b() void test29b()
{ {
int i, fd, stat_loc; int i, fd, stat_loc;
@ -522,7 +521,6 @@ void test29b()
if (strcmp(buf, "one two three four") != 0) e(17); if (strcmp(buf, "one two three four") != 0) e(17);
if (close(fd) != 0) e(18); if (close(fd) != 0) e(18);
/* Non written bytes in regular files should be zero. */ /* Non written bytes in regular files should be zero. */
memset(buf2, '\0', BUF_SIZE); memset(buf2, '\0', BUF_SIZE);
if ((fd = open("bigfile", O_RDWR | O_CREAT, 0644)) != 3) e(19); if ((fd = open("bigfile", O_RDWR | O_CREAT, 0644)) != 3) e(19);
@ -710,7 +708,6 @@ void test29c()
} }
} }
void setsignumber(signum) void setsignumber(signum)
int signum; int signum;
{ {
@ -734,7 +731,6 @@ int n;
errno = 0; errno = 0;
} }
void quit() void quit()
{ {
Chdir(".."); Chdir("..");

View file

@ -237,8 +237,6 @@ void quit()
} }
} }
void e(n) void e(n)
int n; int n;
{ {

View file

@ -67,7 +67,6 @@ char *argv[];
quit(); quit();
} }
void test30a() void test30a()
{ /* Test normal operation. */ { /* Test normal operation. */
@ -233,7 +232,6 @@ void test30b()
MaxPath[strlen(MaxPath) - 1] = '/'; /* make ././.../a */ MaxPath[strlen(MaxPath) - 1] = '/'; /* make ././.../a */
} }
void test30c() void test30c()
{ {
int fd; int fd;
@ -291,7 +289,6 @@ void test30c()
ToLongPath[PATH_MAX - 1] = '/'; ToLongPath[PATH_MAX - 1] = '/';
} }
void makelongnames() void makelongnames()
{ {
register int i; register int i;
@ -313,8 +310,6 @@ void makelongnames()
ToLongPath[PATH_MAX] = '\0'; /* inc ToLongPath by one */ ToLongPath[PATH_MAX] = '\0'; /* inc ToLongPath by one */
} }
void e(n) void e(n)
int n; int n;
{ {
@ -332,7 +327,6 @@ int n;
errno = 0; errno = 0;
} }
void quit() void quit()
{ {
Chdir(".."); Chdir("..");

View file

@ -60,7 +60,6 @@ char *argv[];
quit(); quit();
} }
void test31a() void test31a()
{ /* Test normal operation. */ { /* Test normal operation. */
@ -153,7 +152,6 @@ void test31b()
MaxPath[strlen(MaxPath) - 1] = '/'; /* make ././.../a */ MaxPath[strlen(MaxPath) - 1] = '/'; /* make ././.../a */
} }
void test31c() void test31c()
{ {
subtest = 3; subtest = 3;
@ -220,7 +218,6 @@ void test31c()
ToLongPath[PATH_MAX - 1] = '/'; ToLongPath[PATH_MAX - 1] = '/';
} }
void makelongnames() void makelongnames()
{ {
register int i; register int i;
@ -259,7 +256,6 @@ int n;
errno = 0; errno = 0;
} }
void quit() void quit()
{ {
Chdir(".."); Chdir("..");

View file

@ -335,8 +335,6 @@ void makelongnames()
ToLongPath[PATH_MAX] = '\0'; /* inc ToLongPath by one */ ToLongPath[PATH_MAX] = '\0'; /* inc ToLongPath by one */
} }
void e(n) void e(n)
int n; int n;
{ {
@ -354,7 +352,6 @@ int n;
errno = 0; errno = 0;
} }
void quit() void quit()
{ {
Chdir(".."); Chdir("..");

View file

@ -178,8 +178,6 @@ void test33a()
} }
} }
void test33b() void test33b()
{ {
int stat_loc; /* For the wait(&stat_loc) call. */ int stat_loc; /* For the wait(&stat_loc) call. */
@ -601,7 +599,6 @@ void test_access()
} }
} }
void makelongnames() void makelongnames()
{ {
register int i; register int i;
@ -623,8 +620,6 @@ void makelongnames()
ToLongPath[PATH_MAX] = '\0'; /* inc ToLongPath by one */ ToLongPath[PATH_MAX] = '\0'; /* inc ToLongPath by one */
} }
void e(n) void e(n)
int n; int n;
{ {
@ -642,7 +637,6 @@ int n;
errno = 0; errno = 0;
} }
void quit() void quit()
{ {
Chdir(".."); Chdir("..");

View file

@ -170,8 +170,6 @@ void test35b()
if (chmod("foo", 0777) != 0) e(5); if (chmod("foo", 0777) != 0) e(5);
if (utime("foo", NULL) != 0) e(6); if (utime("foo", NULL) != 0) e(6);
System("rm -rf ../DIR_35/*"); System("rm -rf ../DIR_35/*");
} }
@ -291,8 +289,6 @@ void test35c()
System("rm -rf ../DIR_35/*"); System("rm -rf ../DIR_35/*");
} }
void makelongnames() void makelongnames()
{ {
register int i; register int i;
@ -314,8 +310,6 @@ void makelongnames()
PathTooLong[PATH_MAX] = '\0'; /* inc PathTooLong by one */ PathTooLong[PATH_MAX] = '\0'; /* inc PathTooLong by one */
} }
void e(n) void e(n)
int n; int n;
{ {
@ -333,7 +327,6 @@ int n;
errno = 0; errno = 0;
} }
void quit() void quit()
{ {
Chdir(".."); Chdir("..");
@ -348,7 +341,6 @@ void quit()
} }
} }
/* Getids returns a valid uid and gid. Is used PASSWD FILE. /* Getids returns a valid uid and gid. Is used PASSWD FILE.
** It assumes the following format for a passwd file line: ** It assumes the following format for a passwd file line:
** <user_name>:<passwd>:<uid>:<gid>:<other_stuff> ** <user_name>:<passwd>:<uid>:<gid>:<other_stuff>

View file

@ -39,7 +39,6 @@ _PROTOTYPE(int not_provided_option, (int _option));
_PROTOTYPE(int provided_option, (int _option, int _minimum_value)); _PROTOTYPE(int provided_option, (int _option, int _minimum_value));
_PROTOTYPE(int variating_option, (int _option, int _minimum_value)); _PROTOTYPE(int variating_option, (int _option, int _minimum_value));
char *testdirs[] = { char *testdirs[] = {
"/", "/",
"/etc", "/etc",
@ -141,7 +140,6 @@ void test36d()
System("rm -rf ../DIR_36/*"); System("rm -rf ../DIR_36/*");
} }
void makelongnames() void makelongnames()
{ {
register int i; register int i;
@ -163,8 +161,6 @@ void makelongnames()
ToLongPath[PATH_MAX] = '\0'; /* inc ToLongPath by one */ ToLongPath[PATH_MAX] = '\0'; /* inc ToLongPath by one */
} }
void e(n) void e(n)
int n; int n;
{ {
@ -182,7 +178,6 @@ int n;
errno = 0; errno = 0;
} }
void quit() void quit()
{ {
Chdir(".."); Chdir("..");
@ -208,7 +203,6 @@ int option;
return 0; return 0;
} }
int provided_option(option, minimum) int provided_option(option, minimum)
int option, minimum; int option, minimum;
{ {
@ -229,7 +223,6 @@ int option, minimum;
return 0; return 0;
} }
int variating_option(option, minimum) int variating_option(option, minimum)
int option, minimum; int option, minimum;
{ {

View file

@ -140,7 +140,6 @@ void test37a()
if (close(tube[1]) != 0) e(59); if (close(tube[1]) != 0) e(59);
} }
void test37b() void test37b()
{ {
int tube[2], child2parent[2], parent2child[2]; int tube[2], child2parent[2], parent2child[2];
@ -237,7 +236,6 @@ void test37b()
for (i = 3; i < OPEN_MAX; i++) (void) close(i); for (i = 3; i < OPEN_MAX; i++) (void) close(i);
} }
void e(n) void e(n)
int n; int n;
{ {
@ -255,7 +253,6 @@ int n;
errno = 0; errno = 0;
} }
void quit() void quit()
{ {
if (errct == 0) { if (errct == 0) {

View file

@ -179,7 +179,6 @@ void test38b()
if (strncmp(buf, "o!", 2) != 0) e(21); if (strncmp(buf, "o!", 2) != 0) e(21);
if (close(fd) != 0) e(22); if (close(fd) != 0) e(22);
System("rm -rf ../DIR_38/*"); System("rm -rf ../DIR_38/*");
} }
@ -215,8 +214,6 @@ void test38c()
System("rm -rf ../DIR_38/*"); System("rm -rf ../DIR_38/*");
} }
void e(n) void e(n)
int n; int n;
{ {
@ -234,7 +231,6 @@ int n;
errno = 0; errno = 0;
} }
void quit() void quit()
{ {
Chdir(".."); Chdir("..");

View file

@ -144,7 +144,6 @@ void test39d()
fl.l_type = F_RDLCK; fl.l_type = F_RDLCK;
if (fcntl(fd7, F_SETLK, &fl) == -1) e(10); if (fcntl(fd7, F_SETLK, &fl) == -1) e(10);
switch (fork()) { switch (fork()) {
case -1: printf("Can't fork\n"); break; case -1: printf("Can't fork\n"); break;
case 0: case 0:
@ -257,7 +256,6 @@ void test39d()
System("rm -f ../DIR_39/*\n"); System("rm -f ../DIR_39/*\n");
} }
/* This routine checks that fds 0 through 4, 7 and 8 are open and the rest /* 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 ** 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 ** 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 */ ToLongPath[PATH_MAX] = '\0'; /* inc ToLongPath by one */
} }
void e(n) void e(n)
int n; int n;
{ {
@ -384,7 +380,6 @@ int n;
errno = 0; errno = 0;
} }
void quit() void quit()
{ {
Chdir(".."); Chdir("..");

View file

@ -39,7 +39,6 @@ int main()
return(-1); /* impossible */ return(-1); /* impossible */
} }
void subr() void subr()
{ {
if ( (pid0 = fork()) != 0) { if ( (pid0 = fork()) != 0) {

View file

@ -308,7 +308,6 @@ void makelongnames()
ToLongPath[PATH_MAX] = '\0'; /* inc ToLongPath by one */ ToLongPath[PATH_MAX] = '\0'; /* inc ToLongPath by one */
} }
void e(n) void e(n)
int n; int n;
{ {
@ -326,7 +325,6 @@ int n;
errno = 0; errno = 0;
} }
void quit() void quit()
{ {
chdir(".."); chdir("..");

View file

@ -40,7 +40,6 @@ _PROTOTYPE(void ex, (void));
_PROTOTYPE(void e, (int n)); _PROTOTYPE(void e, (int n));
_PROTOTYPE(void quit, (void)); _PROTOTYPE(void quit, (void));
#ifdef _ANSI #ifdef _ANSI
void (*Signal(int _sig, void (*_func)(int)))(int); void (*Signal(int _sig, void (*_func)(int)))(int);
#define SIG_ZERO ((void (*)(int))0) /* default signal handling */ #define SIG_ZERO ((void (*)(int))0) /* default signal handling */
@ -79,8 +78,6 @@ char *argv[];
return(-1); /* impossible */ return(-1); /* impossible */
} }
void test5a() void test5a()
{ {
int parpid, childpid, flag, *zp; int parpid, childpid, flag, *zp;
@ -156,7 +153,6 @@ int s; /* for ANSI */
e(38); e(38);
} }
void test5b() void test5b()
{ {
int cpid, n, pid; int cpid, n, pid;
@ -184,7 +180,6 @@ void test5b()
} }
} }
void test5c() void test5c()
{ {
int n, i, pid, wpid; int n, i, pid, wpid;
@ -225,8 +220,6 @@ void test5d()
} }
} }
void test5e() void test5e()
{ {
/* When a signal knocks a processes out of WAIT or PAUSE, it is supposed to /* When a signal knocks a processes out of WAIT or PAUSE, it is supposed to
@ -250,7 +243,6 @@ void test5e()
} }
} }
void test5f() void test5f()
{ {
int i, j, k, n; int i, j, k, n;
@ -282,7 +274,6 @@ void test5f()
} }
} }
void test5g() void test5g()
{ {
int n; int n;
@ -301,7 +292,6 @@ int s; /* for ANSI */
alarms++; alarms++;
} }
void test5h() void test5h()
{ {
/* When a signal knocks a processes out of PIPE, it is supposed to /* When a signal knocks a processes out of PIPE, it is supposed to
@ -357,7 +347,6 @@ void test5i()
unlink("XXXxxxXXX"); unlink("XXXxxxXXX");
} }
void ex() void ex()
{ {
int e = errno; int e = errno;
@ -365,7 +354,6 @@ void ex()
exit(1); exit(1);
} }
void e(n) void e(n)
int n; int n;
{ {
@ -396,7 +384,6 @@ void (*b)();
return(SIG_ZERO); return(SIG_ZERO);
} }
void quit() void quit()
{ {

View file

@ -55,8 +55,6 @@ char *argv[];
return(-1); /* impossible */ return(-1); /* impossible */
} }
void test6a() void test6a()
{ {
/* Test sbrk() and brk(). */ /* Test sbrk() and brk(). */
@ -107,7 +105,6 @@ void test6a()
if (sbrk(0) != addr) e(12); if (sbrk(0) != addr) e(12);
} }
void test6b() void test6b()
{ {
int i, err; int i, err;
@ -121,8 +118,6 @@ void test6b()
kill(getpid(), SIGQUIT); kill(getpid(), SIGQUIT);
} }
void test6c() void test6c()
{ {
/* Test mknod, chdir, chmod, chown, access. */ /* Test mknod, chdir, chmod, chown, access. */

View file

@ -4,7 +4,6 @@
* pipe(), mkfifo(), fcntl() * pipe(), mkfifo(), fcntl()
*/ */
#include <sys/types.h> #include <sys/types.h>
#include <sys/stat.h> #include <sys/stat.h>
#include <sys/wait.h> #include <sys/wait.h>
@ -50,7 +49,6 @@ _PROTOTYPE(void e, (int n));
_PROTOTYPE(void sigfunc, (int s)); _PROTOTYPE(void sigfunc, (int s));
_PROTOTYPE(void quit, (void)); _PROTOTYPE(void quit, (void));
int main(argc, argv) int main(argc, argv)
int argc; int argc;
char *argv[]; char *argv[];
@ -114,7 +112,6 @@ void test7a()
for (i = 3; i < OPEN_MAX; i++) close(i); for (i = 3; i < OPEN_MAX; i++) close(i);
} }
void test7b() void test7b()
{ {
/* Test mkfifo(). */ /* Test mkfifo(). */
@ -183,7 +180,6 @@ void test7b()
if (unlink("T7.b") != 0) e(28); if (unlink("T7.b") != 0) e(28);
} }
void test7c() void test7c()
{ {
/* Test fcntl(). */ /* Test fcntl(). */
@ -269,7 +265,6 @@ void test7c()
if (close(newfd2) != 0) e(48); if (close(newfd2) != 0) e(48);
} }
void test7d() void test7d()
{ {
/* Test file locking. */ /* Test file locking. */
@ -415,7 +410,6 @@ void test7f()
close(xfd); close(xfd);
} }
void test7g() void test7g()
{ {
/* Test to see if SETLKW unlocks when the needed lock becomes available. */ /* Test to see if SETLKW unlocks when the needed lock becomes available. */
@ -449,7 +443,6 @@ void test7g()
close(xfd); close(xfd);
} }
void test7h() void test7h()
{ {
/* Test to see what happens if two processed block on the same lock. */ /* Test to see what happens if two processed block on the same lock. */
@ -560,7 +553,6 @@ void test7i()
} }
} }
/* Check EMFILE. */ /* Check EMFILE. */
for (i = xfd + 1; i < OPEN_MAX; i++) open("T7.i", 0); /* use up all fds */ for (i = xfd + 1; i < OPEN_MAX; i++) open("T7.i", 0); /* use up all fds */
errno = 0; errno = 0;
@ -570,7 +562,6 @@ void test7i()
for (i = xfd; i < OPEN_MAX; i++) if (close(i) != 0) e(29); for (i = xfd; i < OPEN_MAX; i++) if (close(i) != 0) e(29);
} }
void test7j() void test7j()
{ {
/* Test file locking with two processes. */ /* Test file locking with two processes. */
@ -620,7 +611,6 @@ void cloexec_test()
exit(0); exit(0);
} }
int set(how, first, last) int set(how, first, last)
int how, first, last; int how, first, last;
{ {

View file

@ -82,7 +82,6 @@ char *argv[];
system("rm -rf DIR_08; mkdir DIR_08"); system("rm -rf DIR_08; mkdir DIR_08");
chdir("DIR_08"); chdir("DIR_08");
for (i = 0; i < ITERATIONS; i++) { for (i = 0; i < ITERATIONS; i++) {
iteration = i; iteration = i;
if (m & 0000001) test8a(); if (m & 0000001) test8a();
@ -106,7 +105,6 @@ char *argv[];
return(-1); /* impossible */ return(-1); /* impossible */
} }
void test8a() void test8a()
{ {
/* Test signal set management. */ /* Test signal set management. */

View file

@ -62,7 +62,6 @@ to the value they had at the time of the Setjmp\n");
return(-1); /* impossible */ return(-1); /* impossible */
} }
void test9a() void test9a()
{ {
register p; register p;