Re: [PATCH] sub-process: print the cmd when a capability is unsupported
- From
Christian Couder <christian.couder@gmail.com>
- Date
- Aug 15, 2017, 19:32 UTC
- Message-ID
- <CAP8UFD18KbTkQZqEXK6AsPDABda-diaMLLhyFvACeVQLb+qwrA@mail.gmail.com>
- In-Reply-To
- <CAP8UFD2KBEVwZE8obaDxf+0AyU4zH0+5bWJzzHazFywgWT9QjQ@mail.gmail.com>
On Tue, Aug 15, 2017 at 9:29 PM, Christian Couder <christian.couder@gmail.com> wrote:
> On Tue, Aug 15, 2017 at 9:00 PM, Lars Schneider > <larsxschneider@gmail.com> wrote: >> >>> On 15 Aug 2017, at 19:36, Christian Couder <christian.couder@gmail.com> wrote:
Show 23 quoted lines
>>> @@ -184,8 +185,8 @@ static int handshake_capabilities(struct child_process *process,
>>> if (supported_capabilities)
>>> *supported_capabilities |= capabilities[i].flag;
>>> } else {
>>> - warning("external filter requested unsupported filter capability '%s'",
>>> - p);
>>> + warning("subprocess '%s' requested unsupported capability '%s'",
>>> + cmd, p);
>>
>> Wouldn't it be possible to use "process->argv[0]"?
>> Shouldn't that be the same as "cmd"?
>
> Well in sub-process.h there is:
>
> /* Members should not be accessed directly. */
> struct subprocess_entry {
> struct hashmap_entry ent; /* must be the first member! */
> const char *cmd;
> struct child_process process;
> };
>
> so if cmd is always the same as process->argv[0], maybe there is no
> need for the cmd member in the first place?In case it is not clear, what I mean is that if we consider that they should always be the same, it could be considered a different patch altogether to just remove the cmd member of this struct.