summaryrefslogtreecommitdiff
path: root/posix/spawn_faction_init.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2000-10-01 19:08:30 +0000
committerUlrich Drepper <drepper@redhat.com>2000-10-01 19:08:30 +0000
commitd77cd295eb5bde456868eb5d7c71042edaa88151 (patch)
tree009cdfc6bae0fc762f5ac9da7c81dc04f3f599e5 /posix/spawn_faction_init.c
parent4a9dcff10ec07770aaf0b4dedaac44eacbbaa110 (diff)
Update.
* Makefile (repertoiremaps): Remove variable. (distribute): Remove repertoiremaps. (install-others): Likewise. Add .gz to charmaps. ($(inst_i18ndir)/charmaps/%): Install in gzipped format. 2000-09-30 Bruno Haible <haible@clisp.cons.org>
Diffstat (limited to 'posix/spawn_faction_init.c')
-rw-r--r--posix/spawn_faction_init.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/posix/spawn_faction_init.c b/posix/spawn_faction_init.c
index edd41ddd6f..f4b0775b0b 100644
--- a/posix/spawn_faction_init.c
+++ b/posix/spawn_faction_init.c
@@ -21,23 +21,24 @@
#include <stdlib.h>
#include <string.h>
+#include "spawn_int.h"
+
/* Function used to increase the size of the allocated array. This
function is called from the `add'-functions. */
int
__posix_spawn_file_actions_realloc (posix_spawn_file_actions_t *file_actions)
{
+ int newalloc = file_actions->__allocated + 8;
void *newmem = realloc (file_actions->__actions,
- file_actions->__allocated += 8);
+ newalloc * sizeof (struct __spawn_action));
if (newmem == NULL)
- {
- /* Not enough memory. */
- file_actions->__allocated -= 8;
- return ENOMEM;
- }
+ /* Not enough memory. */
+ return ENOMEM;
file_actions->__actions = (struct __spawn_action *) newmem;
+ file_actions->__allocated = newalloc;
return 0;
}