rbb 99/06/09 05:57:18
Modified: apr/test testproc.c
Log:
Because we don't include empty directories in tarballs, the testproc program
wasn't working an anything but a cvs extract. This fixes that by having the
prgarm create and remove the directory each time it runs.
Submitted by: David Reid and Ryan Bloom
Revision Changes Path
1.12 +17 -2 apache-apr/apr/test/testproc.c
Index: testproc.c
===================================================================
RCS file: /home/cvs/apache-apr/apr/test/testproc.c,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -r1.11 -r1.12
--- testproc.c 1999/06/08 15:52:14 1.11
+++ testproc.c 1999/06/09 12:57:17 1.12
@@ -84,9 +84,17 @@
teststr = ap_pstrdup(context, "Whooo Hoooo\0");
if (argc > 1) {
- fprintf(stdout, "%s", teststr);
+ fprintf(stdout, "%s", teststr);
exit(1);
}
+
+ fprintf(stdout, "Creating directory for later use.......");
+ if (ap_make_dir(context, "proctest", APR_UREAD | APR_UWRITE |
APR_UEXECUTE) != APR_SUCCESS) {
+ fprintf(stderr, "Could not create dir\n");
+ exit(-1);
+ }
+ fprintf(stdout, "OK\n");
+
fprintf(stdout, "Creating procattr.......");
if (ap_createprocattr_init(context, &attr) != APR_SUCCESS) {
fprintf(stderr, "Could not create attr\n");
@@ -142,7 +150,14 @@
else fprintf(stderr, "Uh-Oh\n");
}
else fprintf(stderr, "Read failed.\n");
+
+ fprintf(stdout, "Removing directory.......");
+ if (ap_remove_dir(context, "proctest") != APR_SUCCESS) {
+ fprintf(stderr, "Could not remove directory.\n");
+ exit(-1);
+ }
+ fprintf(stdout, "OK\n");
- return(1);
+ return(1);
}