summaryrefslogtreecommitdiff
path: root/posix/spawn_faction_addclose.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2000-05-29 07:31:53 +0000
committerUlrich Drepper <drepper@redhat.com>2000-05-29 07:31:53 +0000
commit08c7f6b0082b1b645348518fdc42643b5580d87c (patch)
treeb5280480fa7790ff6f92029378b1311d870c2982 /posix/spawn_faction_addclose.c
parent079199de5cdf96f85e29ecedafc69b2fb3004f2b (diff)
downloadglibc-08c7f6b0082b1b645348518fdc42643b5580d87c.tar.gz
Update.
2000-05-29 Ulrich Drepper <drepper@redhat.com> * posix/Makefile (tests): Add tst-spawn. (tst-spawn-ARGS): New variable. * posix/tst-spawn.c: New file. * posix/spawn_faction_addclose.c: Correctly account for new entry. * posix/spawn_faction_adddup2.c: Likewise. * posix/spawn_faction_addopen.c: Likewise. * posix/spawni.c: Correctly test for success of dup2 calls. * posix/tst-preadwrite.c: Check success of malloc call.
Diffstat (limited to 'posix/spawn_faction_addclose.c')
-rw-r--r--posix/spawn_faction_addclose.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/posix/spawn_faction_addclose.c b/posix/spawn_faction_addclose.c
index 565f4b43f7..b90abb1f7a 100644
--- a/posix/spawn_faction_addclose.c
+++ b/posix/spawn_faction_addclose.c
@@ -42,9 +42,12 @@ posix_spawn_file_actions_addclose (posix_spawn_file_actions_t *file_actions,
return ENOMEM;
/* Add the new value. */
- rec = &file_actions->__actions[file_actions->__allocated];
+ rec = &file_actions->__actions[file_actions->__used];
rec->tag = spawn_do_close;
rec->action.open_action.fd = fd;
+ /* Account for the new entry. */
+ ++file_actions->__used;
+
return 0;
}