[ovs-dev] [PATCH 07/11] daemon-windows: Recognize --no-chdir option for windows.

Ben Pfaff blp at nicira.com
Wed Apr 23 16:21:48 UTC 2014


On Wed, Apr 23, 2014 at 8:47 AM, Gurucharan Shetty <shettyg at nicira.com> wrote:
> On Tue, Apr 22, 2014 at 2:58 PM, Ben Pfaff <blp at nicira.com> wrote:
>> On Tue, Apr 22, 2014 at 01:40:55PM -0700, Gurucharan Shetty wrote:
>>> > Should OVS chdir to the root (on all drives?) on Windows
>>> > also?
>>> Looks like chdir("/") on windows takes me to C:/ . So doing that on
>>> windows should be good. I will re-spin this.
>>
>> OK.
>>
>> If Windows works like it used to, there's an independent notion of the
>> current working directory on every drive, so one would have to do
>> something like:
>>
>>     char c;
>>
>>     for (c = 'a'; c <= 'z'; c++) {
>>         char dir[] = {c, ':', '/', 0};
>>         chdir(dir);
>>     }
>>
>> to really chdir to the root everywhere.  But I do not know whether it
>> matters.
> I see that this notion is true in current versions of windows too.
>
> I suppose a working directory for every drive is useful if a program
> changes its drive midway in the program. (This is what I understood
> after trying reading some msdn documentation, though there are
> probably other reasons too.)
>
> I decided to use the first version of this patch for the time being
> (which does not do anything other than accept the "--chdir" option.
> Once I see a real use case for doing something, I will add the
> feature.

OK, I'm happy with that.



More information about the dev mailing list