binfmt/copyactions: fix comments, make the actions life cycle more clear

Signed-off-by: buxiasen <buxiasen@xiaomi.com>
This commit is contained in:
buxiasen
2025-02-22 18:28:57 +08:00
committed by archer
parent 0e5cb896c4
commit e072771516
2 changed files with 9 additions and 2 deletions

View File

@@ -177,7 +177,8 @@ void binfmt_freeargv(FAR char * const *argv);
* do not have any real option other than to copy the callers action list.
*
* Input Parameters:
* copy - Pointer of file actions
* copy - Pointer of the copied output file actions
* actions - Pointer of file actions to be copy
*
* Returned Value:
* A non-zero copy is returned on success.

View File

@@ -52,7 +52,8 @@
* do not have any real option other than to copy the callers action list.
*
* Input Parameters:
* copy - Pointer of file actions
* copy - Pointer of the copied output file actions
* actions - Pointer of file actions to be copy
*
* Returned Value:
* A non-zero copy is returned on success.
@@ -108,6 +109,11 @@ int binfmt_copyactions(FAR const posix_spawn_file_actions_t **copy,
return -ENOMEM;
}
/* We need to copy and re-organize the flink chain, be care not modify
* the actions it self, the prev have to point to the last time foreach
* item.
*/
for (entry = (FAR struct spawn_general_file_action_s *)actions,
prev = NULL; entry != NULL; entry = entry->flink)
{