mirror of
https://github.com/Interlisp/maiko.git
synced 2026-01-19 01:17:36 +00:00
Use getcwd() instead of getwd(). (#20)
getwd() has been deprecated for a long time and getcwd() should be used instead.
This commit is contained in:
parent
11c083d792
commit
d6d2a3371a
@ -271,7 +271,6 @@ typedef unsigned long u_long;
|
||||
#undef UNALIGNED_FETCH_OK
|
||||
#undef HAS_GETHOSTID
|
||||
#define seteuid(x) setresuid(-1, (x), -1)
|
||||
#define getwd(x) getcwd((x), MAXPATHLEN)
|
||||
#define getrusage(x, y)
|
||||
#define getpagesize() 4096
|
||||
#define USE_UTIME
|
||||
@ -308,7 +307,6 @@ typedef signed char s_char;
|
||||
#undef UNALIGNED_FETCH_OK
|
||||
#define MAXPATHLEN MAXNAMLEN
|
||||
#define EWOULDBLOCK EAGAIN
|
||||
#define getwd(x) getcwd((x), MAXPATHLEN)
|
||||
/* we compile on a 386 with GCC, so can use optimizations. */
|
||||
#define GCC386
|
||||
#define RESWAPPEDCODESTREAM
|
||||
@ -424,7 +422,6 @@ typedef unsigned short u_short;
|
||||
#define SYSVONLY 1
|
||||
#define SYSVSIGNALS 1
|
||||
#define NOETHER 1
|
||||
#define getwd(x) getcwd((x), MAXPATHLEN)
|
||||
#define USHORT unsigned
|
||||
#else
|
||||
#define USHORT unsigned short
|
||||
@ -453,7 +450,6 @@ typedef unsigned short u_short;
|
||||
|
||||
#if !defined(LINUX) && !defined(MACOSX) && !defined(FREEBSD)
|
||||
/* these are in the POSIX standard */
|
||||
#define getwd(x) getcwd((x), MAXPATHLEN)
|
||||
#define getrusage(x, y)
|
||||
#define getpagesize() 4096
|
||||
#endif /* LINUX , MACOSX, FREEBSD */
|
||||
|
||||
@ -552,7 +552,7 @@ int unixpathname(char *src, char *dst, int versionp, int genp)
|
||||
* "..>" or ".." means the parent directory of the
|
||||
* user's current working directory.
|
||||
*/
|
||||
if (getwd(dst) == 0) return (0);
|
||||
if (getcwd(dst, MAXPATHLEN) == 0) return (0);
|
||||
#ifdef DOS
|
||||
dp = max(strrchr(dst, '/'), strrchr(dst, DIRSEP));
|
||||
#else
|
||||
@ -575,7 +575,7 @@ int unixpathname(char *src, char *dst, int versionp, int genp)
|
||||
#endif
|
||||
case '>':
|
||||
/* ".>" means the user's current working directory. */
|
||||
if (getwd(dst) == 0) return (0);
|
||||
if (getcwd(dst, MAXPATHLEN) == 0) return (0);
|
||||
while (*dp != '\0') dp++;
|
||||
|
||||
*dp++ = DIRSEP;
|
||||
@ -584,7 +584,7 @@ int unixpathname(char *src, char *dst, int versionp, int genp)
|
||||
|
||||
case '\0':
|
||||
/* "." also means the user's current working directory. */
|
||||
if (getwd(dst) == 0) return (0);
|
||||
if (getcwd(dst, MAXPATHLEN) == 0) return (0);
|
||||
while (*dp != '\0') dp++;
|
||||
|
||||
*dp++ = DIRSEP;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user