summaryrefslogtreecommitdiff
path: root/test/testproc.c
diff options
context:
space:
mode:
authorJeff Trawick <trawick@apache.org>2002-10-11 12:21:42 +0000
committerJeff Trawick <trawick@apache.org>2002-10-11 12:21:42 +0000
commit087e6875ed706259fde37562d83f30a2ec69249e (patch)
tree8278dbc5afeae642b3c638e83dca8fad11c41fb6 /test/testproc.c
parent5dc5564e4594d434a7e5c32f0e86bd89a359a9e5 (diff)
downloadapr-087e6875ed706259fde37562d83f30a2ec69249e.tar.gz
don't tell apr_file_write() to write 256 bytes when we only give it
13 or so bytes of valid storage (got EFAULT) before that change, we relied on filling up the child process's buffer so that fgets() would return even though no '\n' was written... but that no longer happens so add '\n' to end of message so that fgets() returns in the child this showed up when I moved an ElectricFence regression test from RH 6.1 to RH 8.0 git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63899 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'test/testproc.c')
-rw-r--r--test/testproc.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/test/testproc.c b/test/testproc.c
index 00585e3b9..0b3adf164 100644
--- a/test/testproc.c
+++ b/test/testproc.c
@@ -108,11 +108,11 @@ int main(int argc, char *argv[])
fprintf(stderr, "%s", teststr);
exit(1);
}
- teststr = apr_pstrdup(pool, "Whooo Hoooo\0");
+ teststr = apr_pstrdup(pool, "Whooo Hoooo\n");
printf("APR Process Test\n================\n\n");
- STD_TEST_NEQ("Creating directory for later use",
+ STD_TEST_NEQ("Creating directory \"proctest\" for later use",
apr_dir_make("proctest", APR_UREAD | APR_UWRITE | APR_UEXECUTE, pool))
/* =================================================================== */
@@ -136,12 +136,15 @@ int main(int argc, char *argv[])
testfile = newproc.in;
printf("OK\n");
- length = 256;
+ length = strlen(teststr);
printf("%-60s", "Writing the data to child");
- if (apr_file_write(testfile, teststr, &length) == APR_SUCCESS) {
+ if ((rv = apr_file_write(testfile, teststr, &length)) == APR_SUCCESS) {
printf("OK\n");
}
- else printf("Write failed.\n");
+ else {
+ printf("Write failed: (%d) %s.\n",
+ rv, apr_strerror(rv, msgbuf, sizeof msgbuf));
+ }
printf("%-60s", "Grabbing child's stdout");
testfile = newproc.out;
@@ -155,7 +158,7 @@ int main(int argc, char *argv[])
printf("OK\n");
else {
printf( "Uh-Oh\n");
- printf(" (I actually got %s_\n", buf);
+ printf(" (I actually got %s)\n", buf);
}
}
else {