summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrbb <rbb@13f79535-47bb-0310-9956-ffa450edef68>1999-11-23 21:22:48 +0000
committerrbb <rbb@13f79535-47bb-0310-9956-ffa450edef68>1999-11-23 21:22:48 +0000
commit3200eabb89b3b6c838bc20b4dde02a93330d91e5 (patch)
tree71e465528a30a1d2b3f0b73f04e0898639d599e2
parent3aa325148a7607e3d98fbba7db06fd4629e05544 (diff)
downloadlibapr-3200eabb89b3b6c838bc20b4dde02a93330d91e5.tar.gz
This removes all of the fprintf calls from APR, except for those which
are made during debugging. git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@59487 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--lib/apr_execve.c1
-rw-r--r--lib/apr_pools.c8
-rw-r--r--lib/apr_tables.c4
-rw-r--r--memory/unix/apr_pools.c8
4 files changed, 3 insertions, 18 deletions
diff --git a/lib/apr_execve.c b/lib/apr_execve.c
index be758ff8d..843d197ab 100644
--- a/lib/apr_execve.c
+++ b/lib/apr_execve.c
@@ -349,7 +349,6 @@ static const char **hashbang(const char *filename, char **argv)
newargv = (char **) malloc((p - lbuf + 1)
+ (i + sargc + 1) * sizeof(*newargv));
if (newargv == NULL) {
- fprintf(stderr, "Ouch! Out of memory in hashbang()!\n");
return NULL;
}
ws = &((char *) newargv)[(i + sargc + 1) * sizeof(*newargv)];
diff --git a/lib/apr_pools.c b/lib/apr_pools.c
index 78fcc489a..ec2068eaf 100644
--- a/lib/apr_pools.c
+++ b/lib/apr_pools.c
@@ -268,8 +268,7 @@ static union block_hdr *malloc_block(int size)
blok = (union block_hdr *) malloc(size + sizeof(union block_hdr));
if (blok == NULL) {
- fprintf(stderr, "Ouch! malloc failed in malloc_block()\n");
- exit(1);
+ return NULL;
}
debug_fill(blok, size + sizeof(union block_hdr));
blok->h.next = NULL;
@@ -299,7 +298,6 @@ static void chk_on_blk_list(union block_hdr *blok, union block_hdr *free_blk)
"at the end of a block!\n");
while (free_blk) {
if (free_blk == blok) {
- fprintf(stderr, "Ouch! Freeing free block\n");
abort();
exit(1);
}
@@ -685,9 +683,6 @@ API_EXPORT(ap_pool_t *) ap_find_pool(const void *ts)
b = *pb;
if (is_ptr_in_range(s, b, b->h.endp)) {
if (b->h.owning_pool == FREE_POOL) {
- fprintf(stderr,
- "Ouch! find_pool() called on pointer "
- "in a free block\n");
abort();
exit(1);
}
@@ -739,7 +734,6 @@ API_EXPORT(void) ap_pool_join(ap_pool_t *p, ap_pool_t *sub)
/* We could handle more general cases... but this is it for now. */
if (sub->parent != p) {
- fprintf(stderr, "pool_join: p is not parent of sub\n");
abort();
}
ap_block_alarms();
diff --git a/lib/apr_tables.c b/lib/apr_tables.c
index d9bb6ca9d..9af07c4ff 100644
--- a/lib/apr_tables.c
+++ b/lib/apr_tables.c
@@ -284,9 +284,7 @@ API_EXPORT(char *) ap_array_pstrcat(struct context_t *p,
static ap_table_entry_t *table_push(ap_table_t *t)
{
if (t->a.nelts == t->a.nalloc) {
- fprintf(stderr,
- "table_push: ap_table_t created by %p hit limit of %u\n",
- t->creator, t->a.nalloc);
+ return NULL;
}
return (ap_table_entry_t *) ap_push_array(&t->a);
}
diff --git a/memory/unix/apr_pools.c b/memory/unix/apr_pools.c
index 78fcc489a..ec2068eaf 100644
--- a/memory/unix/apr_pools.c
+++ b/memory/unix/apr_pools.c
@@ -268,8 +268,7 @@ static union block_hdr *malloc_block(int size)
blok = (union block_hdr *) malloc(size + sizeof(union block_hdr));
if (blok == NULL) {
- fprintf(stderr, "Ouch! malloc failed in malloc_block()\n");
- exit(1);
+ return NULL;
}
debug_fill(blok, size + sizeof(union block_hdr));
blok->h.next = NULL;
@@ -299,7 +298,6 @@ static void chk_on_blk_list(union block_hdr *blok, union block_hdr *free_blk)
"at the end of a block!\n");
while (free_blk) {
if (free_blk == blok) {
- fprintf(stderr, "Ouch! Freeing free block\n");
abort();
exit(1);
}
@@ -685,9 +683,6 @@ API_EXPORT(ap_pool_t *) ap_find_pool(const void *ts)
b = *pb;
if (is_ptr_in_range(s, b, b->h.endp)) {
if (b->h.owning_pool == FREE_POOL) {
- fprintf(stderr,
- "Ouch! find_pool() called on pointer "
- "in a free block\n");
abort();
exit(1);
}
@@ -739,7 +734,6 @@ API_EXPORT(void) ap_pool_join(ap_pool_t *p, ap_pool_t *sub)
/* We could handle more general cases... but this is it for now. */
if (sub->parent != p) {
- fprintf(stderr, "pool_join: p is not parent of sub\n");
abort();
}
ap_block_alarms();