This is the mail archive of the cygwin mailing list for the Cygwin project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: "run" changes behavior with cygwin-17.6

On Aug 18 14:54, Christopher Faylor wrote:
> On Wed, Aug 18, 2010 at 07:32:40PM +0100, Andy Koppe wrote:
> >On 18 August 2010 19:24, Christopher Faylor wrote:
> >>>I noticed a similar change in cygstart, too. I used to have a script
> >>>that would cd to a directory and then run cygstart. After the upgrade to
> >>>1.7.6, this stopped working. I had to use the --directory switch to
> >>>cygstart to get the right behavior.
> >>
> >> Call me dense but I don't understand why any changes are needed. ??If
> >> you're cd'ed to a non-Cygwin-special location why doesn't stuff "just
> >> work"?
> >
> >The Win32 working directory is changed to '\\?\PIPE\' at process
> >startup, otherwise the working directory can't be deleted from under
> >the process, which you can do on Linux.
> Yes, I guess I did not properly appreciate the fact that we presumably
> broke every CreateProcess call in a cygwin program when we did this.
> While I'm on record about not caring too much about that scenario, it
> seems meaner than usual for us to break this since the report which
> caused the recent change was from someone calling CreateProcess in a
> cygwin program.
> But, anyway, since we have broken this, I don't think we should force
> every user of CreateProcess to call CYGWIN_CONV_TO_POSIX_PATH.  We
> probably should add an internal interface which sets the current working
> directory for windows if it can.

I'm going to add a new call

  cygwin_internal (CW_SYNC_WINCWD);

which will do the same for the CWD as

  cygwin_internal (CW_SYNC_WINENV);

already does for the environment.  Dropping the environment had roughly
the same consequences way back when, after all.

However, in contrast to CW_SYNC_WINENV, CW_SYNC_WINCWD will return -1
and set errno if setting a Windows CWD fails.  The error codes will be

  ENOTDIR	if the CWD is a virtual directory
  EACCES	if the directory is actually inaccessible or
  ENAMETOOLONG  if the directory has a pathname > 258 chars.

I'll also add documentation for this.


Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Project Co-Leader          cygwin AT cygwin DOT com
Red Hat

Problem reports:
Unsubscribe info:

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]