Change 11216 by jhi@alpha on 2001/07/08 15:58:35
Cwd cleanups.
Affected files ...
... //depot/perl/ext/Cwd/Cwd.xs#18 edit
Differences ...
==== //depot/perl/ext/Cwd/Cwd.xs#18 (text) ====
Index: perl/ext/Cwd/Cwd.xs
--- perl/ext/Cwd/Cwd.xs.~1~ Sun Jul 8 10:00:05 2001
+++ perl/ext/Cwd/Cwd.xs Sun Jul 8 10:00:05 2001
@@ -73,12 +73,14 @@
return Perl_rmsexpand((char*)path, resolved, NULL, 0);
#else
struct stat sb;
- int fd, n, rootd, serrno;
+ int n, rootd, serrno;
char *p, *q, wbuf[MAXPATHLEN];
int symlinks = 0;
/* Save the starting point. */
#ifdef HAS_FCHDIR
+ int fd;
+
if ((fd = open(".", O_RDONLY)) < 0) {
(void)strcpy(resolved, ".");
return (NULL);
@@ -120,7 +122,7 @@
} else
p = resolved;
-#ifdef HAS_LSTAT
+#if defined(HAS_LSTAT) && defined(HAS_READLINK) && defined(HAS_SYMLINK)
/* Deal with the last component. */
if (lstat(p, &sb) == 0) {
if (S_ISLNK(sb.st_mode)) {
End of Patch.