This is the mail archive of the
cygwin-patches
mailing list for the Cygwin project.
Re: [PATCH] Add get_current_dir_name(3)
On Sun, Jan 01, 2012 at 01:13:25AM -0600, Yaakov (Cygwin/X) wrote:
>On Sun, 2012-01-01 at 01:46 -0500, Christopher Faylor wrote:
>> On Sat, Dec 31, 2011 at 08:45:07PM -0600, Yaakov (Cygwin/X) wrote:
>> >+extern "C" char *
>> >+get_current_dir_name (void)
>> >+{
>> >+ char *pwd = getenv ("PWD");
>> >+ char *cwd = getcwd (NULL, 0);
>> >+
>> >+ if (pwd)
>> >+ {
>> >+ struct __stat64 pwdbuf, cwdbuf;
>> >+ stat64 (pwd, &pwdbuf);
>> >+ stat64 (cwd, &cwdbuf);
>> >+ if (pwdbuf.st_ino == cwdbuf.st_ino)
>>
>> You have to check st_dev here too don't you?
>
>Of course. Revised patch for winsup/cygwin attached.
Looks good. The Cygwin part is approved.
Thanks.
cgf