[Libsysio-commit] HEAD: libsysio/tests Makefile.am test_copy.c test_getcwd.c test_list.c test_mounts
Brought to you by:
lward
From: Ruth K. <rk...@us...> - 2003-08-14 19:22:02
|
Update of /cvsroot/libsysio/libsysio/tests In directory sc8-pr-cvs1:/tmp/cvs-serv16191/tests Modified Files: Makefile.am test_copy.c test_getcwd.c test_list.c test_mounts.c test_path.c test_stats.c test_stdfd.c Log Message: merge cplant branch into head Index: Makefile.am =================================================================== RCS file: /cvsroot/libsysio/libsysio/tests/Makefile.am,v retrieving revision 1.9 retrieving revision 1.10 diff -u -w -b -B -p -r1.9 -r1.10 --- Makefile.am 10 May 2003 14:43:58 -0000 1.9 +++ Makefile.am 14 Aug 2003 18:39:33 -0000 1.10 @@ -33,7 +33,15 @@ STDFD_DEV_CFLAGS= STDFD_DEV_LIB= endif -DRIVERS=$(NATIVE_DRIVER_NAME) $(INCORE_DRIVER_NAME) $(STFD_DEV_NAME) +if WITH_CPLANT_YOD +YOD_DRIVER_NAME=yod +YOD_DRIVER_CFLAGS= -DCPLANT_YOD +else +YOD_DRIVER_NAME= +YOD_DRIVER_CFLAGS= +endif + +DRIVERS=$(NATIVE_DRIVER_NAME) $(INCORE_DRIVER_NAME) $(YOD_DRIVER_NAME) $(STFD_DEV_NAME) CMNSRC=drv_init_all.c drv_data.c @@ -41,10 +49,10 @@ BUILT_SOURCES=drv_data.c CFL=$(AM_CFLAGS) $(AM_CPPFLAGS) \ $(NATIVE_DRIVER_CFLAGS) $(INCORE_DRIVER_CFLAGS) \ - $(STDFD_DEV_CFLAGS) + $(STDFD_DEV_CFLAGS) $(YOD_DRIVER_CFLAGS) LIBS=$(NATIVE_DRIVER_LIB) $(INCORE_DRIVER_LIB) \ - $(STDFD_DEV_LIB) \ + $(STDFD_DEV_LIB) $(YOD_DRIVER_LIB) \ $(top_builddir)/src/libsysio.a test_copy_SOURCES=test_copy.c $(CMNSRC) Index: test_copy.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/tests/test_copy.c,v retrieving revision 1.5 retrieving revision 1.6 diff -u -w -b -B -p -r1.5 -r1.6 --- test_copy.c 24 Mar 2003 22:09:49 -0000 1.5 +++ test_copy.c 14 Aug 2003 18:39:33 -0000 1.6 @@ -110,6 +110,7 @@ main(int argc, char * const argv[]) if (!(argc - optind)) usage(); +#ifndef CPLANT_YOD if (_sysio_init() != 0) { perror("init sysio"); exit(1); @@ -125,7 +126,7 @@ main(int argc, char * const argv[]) perror(root_driver); exit(1); } - +#endif (void )umask(022); /* @@ -143,7 +144,9 @@ main(int argc, char * const argv[]) err = copy_file(spath, dpath); +#ifndef CPLANT_YOD _sysio_shutdown(); +#endif return err; } Index: test_getcwd.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/tests/test_getcwd.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -w -b -B -p -r1.1 -r1.2 --- test_getcwd.c 9 Mar 2003 16:58:41 -0000 1.1 +++ test_getcwd.c 14 Aug 2003 18:39:33 -0000 1.2 @@ -108,7 +108,7 @@ main(int argc, char *const argv[]) default: usage(); } - +#ifndef CPLANT_YOD /* * Init sysio lib. */ @@ -130,6 +130,7 @@ main(int argc, char *const argv[]) perror("_sysio_mount_root"); exit(1); } +#endif n = argc - optind; @@ -165,10 +166,12 @@ main(int argc, char *const argv[]) } } +#ifndef CPLANT_YOD /* * Clean up. */ _sysio_shutdown(); +#endif return 0; } Index: test_list.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/tests/test_list.c,v retrieving revision 1.4 retrieving revision 1.5 diff -u -w -b -B -p -r1.4 -r1.5 --- test_list.c 24 Mar 2003 22:09:49 -0000 1.4 +++ test_list.c 14 Aug 2003 18:39:33 -0000 1.5 @@ -109,6 +109,7 @@ main(int argc, char *const argv[]) usage(); } +#ifndef CPLANT_YOD /* * Init sysio lib. */ @@ -130,7 +131,7 @@ main(int argc, char *const argv[]) perror("_sysio_mount_root"); exit(1); } - +#endif n = argc - optind; /* @@ -165,10 +166,12 @@ main(int argc, char *const argv[]) } } +#ifndef CPLANT_YOD /* * Clean up. */ _sysio_shutdown(); +#endif return 0; } Index: test_mounts.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/tests/test_mounts.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -w -b -B -p -r1.3 -r1.4 --- test_mounts.c 9 Mar 2003 16:57:47 -0000 1.3 +++ test_mounts.c 14 Aug 2003 18:39:33 -0000 1.4 @@ -103,6 +103,7 @@ main(int argc, char *const argv[]) usage(); } +#ifndef CPLANT_YOD /* * Init sysio lib. */ @@ -124,7 +125,7 @@ main(int argc, char *const argv[]) perror("_sysio_mount_root"); exit(1); } - +#endif n = argc - optind; @@ -160,10 +161,12 @@ main(int argc, char *const argv[]) } } +#ifndef CPLANT_YOD /* * Clean up. */ _sysio_shutdown(); +#endif return 0; } @@ -429,7 +432,7 @@ mountit(const char *arg) /* * Eat leading white. */ - while (*s && *s == ' ' && *s == '\t') + while (*s && *s == ' ' || *s == '\t') s++; /* * Get opts. @@ -438,7 +441,7 @@ mountit(const char *arg) while (*cp && *cp != ' ' && *cp != '\t') cp++; if (opts == cp) { - (void )fprintf(stderr, "%s: Missing target\n", arg); + (void )fprintf(stderr, "%s: Missing opts\n", arg); err = -1; goto out; } @@ -449,7 +452,7 @@ mountit(const char *arg) /* * Eat leading white. */ - while (*s && *s == ' ' && *s == '\t') + while (*s && *s == ' ' || *s == '\t') s++; /* * Get target @@ -464,6 +467,9 @@ mountit(const char *arg) if (*cp) *cp++ = '\0'; + err = mkdir(target, "0777"); + if (err && errno != EEXIST) + perror(target); err = mount(source, target, fstype, 0, opts); if (err) perror(arg); Index: test_path.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/tests/test_path.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -w -b -B -p -r1.3 -r1.4 --- test_path.c 9 Mar 2003 16:57:47 -0000 1.3 +++ test_path.c 14 Aug 2003 18:39:33 -0000 1.4 @@ -109,6 +109,7 @@ main(int argc, char *const argv[]) usage(); } +#ifndef CPLANT_YOD /* * Init sysio lib. */ @@ -130,7 +131,7 @@ main(int argc, char *const argv[]) perror("_sysio_mount_root"); exit(1); } - +#endif n = argc - optind; @@ -166,10 +167,12 @@ main(int argc, char *const argv[]) } } +#ifndef CPLANT_YOD /* * Clean up. */ _sysio_shutdown(); +#endif return 0; } Index: test_stats.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/tests/test_stats.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -w -b -B -p -r1.3 -r1.4 --- test_stats.c 9 Mar 2003 16:57:47 -0000 1.3 +++ test_stats.c 14 Aug 2003 18:39:33 -0000 1.4 @@ -99,6 +99,7 @@ main(int argc, char * const argv[]) usage(); } +#ifndef CPLANT_YOD if (_sysio_init() != 0) { perror("init sysio"); exit(1); @@ -114,16 +115,18 @@ main(int argc, char * const argv[]) perror(root_driver); exit(1); } - +#endif (void )umask(022); while (optind < argc) do_stats(argv[optind++]); +#ifndef CPLANT_YOD /* * Clean up. */ _sysio_shutdown(); +#endif return 0; } Index: test_stdfd.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/tests/test_stdfd.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -w -b -B -p -r1.2 -r1.3 --- test_stdfd.c 24 Mar 2003 22:09:49 -0000 1.2 +++ test_stdfd.c 14 Aug 2003 18:39:33 -0000 1.3 @@ -119,6 +119,7 @@ main(int argc, char *const argv[]) if (argc - optind != 1) usage(); +#ifndef CPLANT_YOD /* * Init sysio lib. */ @@ -200,6 +201,7 @@ main(int argc, char *const argv[]) goto out; } +#endif /* * Read from stdin, write to stdout and stderr. */ @@ -226,8 +228,9 @@ main(int argc, char *const argv[]) * Clean up. */ out: +#ifndef CPLANT_YOD _sysio_shutdown(); - +#endif return 0; } |