Mail Archives: djgpp-workers/2001/03/17/10:00:24
Hello.
Laurynas Biveinis wrote:
>
> Hello, below is the mostly trivial patch which is necessarry
> to get working fileutils with djgpp 2.04. If want to keep 2.03
> compatibility, you'll have to tweak it a bit.
[snip]
> -#ifdef __DJGPP__
> -/* DJGPP doesn't have S_ISLNK defined, because MS-DOS doesn't support links.
> - * However, DJGPP's `link' simulates hard links by copying, and we can
> - * have ``symbolic links'' for DJGPP .EXE programs. Therefore, just
> - * for the purpose of this program, it makes sense to define S_ISLNK
> - * so we could have working `ln'. */
> -
> -#define S_ISLNK(x) (0) /* defined, but no file is a link */
> -#endif
[snip]
OK, here's what I've decided on. I've added an autoconf check for lstat(),
defining HAVE_LSTAT. Rather than tie the checks to DJGPP's version number,
I've done it on HAVE_LSTAT.
src/djutils.c's lstat() is only used if !HAVE_LSTAT. The S_ISLNK
definition in src/ln.c is now what is shown below:
---start src/ln.c excerpt---
#ifdef __DJGPP__
/* Versions of DJGPP > 2.03 support symlinks (currently only DJGPP CVS).
If
* symlinks are supported, we can rely on DJGPP to DTRT. */
#if !(defined(HAVE_LSTAT) && defined(S_ISLNK))
/* DJGPP doesn't have S_ISLNK defined, because MS-DOS doesn't support
links.
* However, DJGPP's `link' simulates hard links by copying, and we can
* have ``symbolic links'' for DJGPP .EXE programs. Therefore, just
* for the purpose of this program, it makes sense to define S_ISLNK
* so we could have working `ln'. */
#define S_ISLNK(x) (0) /* defined, but no file is a link */
#endif /* !(HAVE_LSTAT && S_ISLNK) */
#endif /* __DJGPP__ */
---end src/ln.c excerpt---
I think is OK. Can anybody see any problems with this?
Bye, Rich =]
--
Richard Dawe <richdawe AT bigfoot DOT com> http://www.bigfoot.com/~richdawe/
"The soul is the mirror of an indestructible universe."
--- Gottfried W. Leibniz
- Raw text -