summary refs log tree commit diff
path: root/posix/spawn_faction_addopen.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_addopen.c
parent079199de5cdf96f85e29ecedafc69b2fb3004f2b (diff)
downloadglibc-08c7f6b0082b1b645348518fdc42643b5580d87c.tar.gz
glibc-08c7f6b0082b1b645348518fdc42643b5580d87c.tar.xz
glibc-08c7f6b0082b1b645348518fdc42643b5580d87c.zip
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_addopen.c')
-rw-r--r--posix/spawn_faction_addopen.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/posix/spawn_faction_addopen.c b/posix/spawn_faction_addopen.c
index 1405e91013..b177f07294 100644
--- a/posix/spawn_faction_addopen.c
+++ b/posix/spawn_faction_addopen.c
@@ -43,12 +43,15 @@ posix_spawn_file_actions_addopen (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_open;
   rec->action.open_action.fd = fd;
   rec->action.open_action.path = path;
   rec->action.open_action.oflag = oflag;
   rec->action.open_action.mode = mode;
 
+  /* Account for the new entry.  */
+  ++file_actions->__used;
+
   return 0;
 }