bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bash-shipped getcwd() replacement does not work on interix.


From: Michael Haubenwallner
Subject: bash-shipped getcwd() replacement does not work on interix.
Date: Thu, 20 Dec 2007 09:41:48 +0100

Machine: i586
OS: interix5.2
Compiler: gcc 
Compilation CFLAGS:  -DPROGRAM='bash' -DCONF_HOSTTYPE='i586'
-DCONF_OSTYPE='interix5.2' -DCONF_MACHTYPE='i586-pc-interix5.2'
-DCONF_VENDOR='pc'
-DLOCALEDIR='/tools/snapshot/prefix-launcher-1pre.20071219/i586-pc-interix5.2/share/locale'
 -DPACKAGE='bash' 
-DLOCAL_PREFIX=/tools/snapshot/prefix-launcher-1pre.20071219/i586-pc-interix5.2 
-DSHELL -DHAVE_CONFIG_H -DNO_MAIN_ENV_ARG -DBROKEN_DIRENT_D_INO -D_POSIX_SOURCE 
  -I.  -I/tss/prefix-launcher-1pre.20071219/buildroot/bash/bash-3.2 
-I/tss/prefix-launcher-1pre.20071219/buildroot/bash/bash-3.2/include 
-I/tss/prefix-launcher-1pre.20071219/buildroot/bash/bash-3.2/lib   -g -O2
uname output: Interix pc312001 5.2 SP-9.0.3790.3034 x86
Intel_x86_Family6_Model15_Stepping6
Machine Type: i586-pc-interix5.2

Bash Version: 3.2 
Patch Level: 33
Release Status: release

Description:
    Bash uses getcwd-replacement if libc provides getcwd without the
    feature of allocating the buffer when called without one.
    This override is done in config-bot.h, with an exception for
    solaris already.
    Problem now is that getcwd-replacement does not work on Interix
    (SUA 5.2 here).
    Now there's only one source location in builtins/common.c really
    relying on getcwd(0,0) allocating the buffer.
    But even here is some conditional code on GETCWD_BROKEN.
    So why not simply don't require allocation-feature of getcwd at all
    and use getcwd-replacement only if libc does not provide one ?

Repeat-By:
    $ PWD= 
/tools/snapshot/prefix-launcher-1pre.20071219/i586-pc-interix5.2/bin/bash
    shell-init: error retrieving current directory: getcwd: cannot access 
parent directories: No such file or directory

Fix: (patch attached)
    builtins/common.c:
       Do not depend on getcwd() doing buffer allocation.
    config-bot.h:
       Ignore GETCWD_BROKEN, keep HAVE_GETCWD as is.
    Additionally, the check for GETCWD_BROKEN can be dropped
    from configure.in and aclocal.m4.

Thanks!

/haubi/
-- 
Michael Haubenwallner
Gentoo on a different level

Attachment: bash-3.2-getcwd.patch
Description: Text Data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]