|
@@ -30,12 +30,21 @@ char *
|
|
|
get_current_dir_name (void)
|
|
|
{
|
|
|
char *pwd;
|
|
|
+#ifdef __USE_LARGEFILE64
|
|
|
struct stat64 dotstat, pwdstat;
|
|
|
+#else
|
|
|
+ struct stat dotstat, pwdstat;
|
|
|
+#endif
|
|
|
|
|
|
pwd = getenv ("PWD");
|
|
|
if (pwd != NULL
|
|
|
+#ifdef __USE_LARGEFILE64
|
|
|
&& stat64 (".", &dotstat) == 0
|
|
|
&& stat64 (pwd, &pwdstat) == 0
|
|
|
+#else
|
|
|
+ && stat (".", &dotstat) == 0
|
|
|
+ && stat (pwd, &pwdstat) == 0
|
|
|
+#endif
|
|
|
&& pwdstat.st_dev == dotstat.st_dev
|
|
|
&& pwdstat.st_ino == dotstat.st_ino)
|
|
|
/* The PWD value is correct. Use it. */
|