This is the mail archive of the
mailing list for the glibc project.
Re: [PATCH] posix_spawn_file_actions_addopen needs to copy the path argument (BZ 17048)
- From: Roland McGrath <roland at hack dot frob dot com>
- To: Florian Weimer <fweimer at redhat dot com>
- Cc: GNU C Library <libc-alpha at sourceware dot org>
- Date: Wed, 11 Jun 2014 14:01:11 -0700 (PDT)
- Subject: Re: [PATCH] posix_spawn_file_actions_addopen needs to copy the path argument (BZ 17048)
- Authentication-results: sourceware.org; auth=none
- References: <5398C182 dot 4040906 at redhat dot com>
This looks fine to me except for some trivia.
Please put the BZ# in the subject line when you have one.
> 2014-06-11 Florian Weimer <firstname.lastname@example.org>
> * posix/spawn_int.h (struct __spawn_action): Make the path string
> non-const to support deallocation.
> * posix/spawn_faction_addopen.c
> (posix_spawn_file_actions_addopen): Make a copy of the pathname.
> * posix/spawn_faction_destroy.c
> (posix_spawn_file_actions_destroy): Adjust comment. Deallocate
> path in all spawn_do_open actions.
> * posix/tst-spawn.c (do_test): Exercise the copy operation in
These are all one paragraph (i.e. no blank lines in between) when they are
all part of the same change. Put [BZ #17048] at the top.
> +/* Deallocated the file actions. */
> + struct __spawn_action *sa = file_actions->__actions + i;
I always have a mild preference to &foo[i] when that's what you're doing.