kernel32: Overhaul the handling of argv in set_process_name().

Ken Thomases ken at codeweavers.com
Wed Jul 13 14:52:52 CDT 2016


On Jul 13, 2016, at 2:25 PM, Sebastian Lackner <sebastian at fds-team.de> wrote:
> 
> On 13.07.2016 20:20, Ken Thomases wrote:
> 
>> Moving the code to the bottom could be done, although it would mean
>> two #ifdef HAVE_SETPROCTITLE blocks, one to set shift_strings and the
>> other to actually make the call.  The reason is that the shifting has
>> to happen before the call to setprogname() because it's documented to
>> keep the pointer that's passed in.  We can't pass it (a substring of)
>> argv[1] and then shift the strings.
> 
> I'm not sure if two #ifdefs is actually that bad, it probably should
> depend on the operating system anyway.

By "it" you mean the decision to shift the strings?  Why should that depend on the OS?  What reliable way do we have to detect if the OS works that way other than the strings actually being contiguous?

> On systems where it doesn't make
> a difference (like FreeBSD, ...) this step can always be safely skipped.

By "systems where it doesn't make a difference", you mean those that have setproctitle()?  By "this step" you mean shifting the strings?  That's what my patch already does.

In other words, I don't understand what you're getting at with this paragraph.

-Ken




More information about the wine-devel mailing list