delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/2001/03/17/10:00:24

Sender: rich AT phekda DOT freeserve DOT co DOT uk
Message-ID: <3AB37BE3.32FD773B@phekda.freeserve.co.uk>
Date: Sat, 17 Mar 2001 14:59:47 +0000
From: Richard Dawe <rich AT phekda DOT freeserve DOT co DOT uk>
X-Mailer: Mozilla 4.51 [en] (X11; I; Linux 2.2.17 i586)
X-Accept-Language: de,fr
MIME-Version: 1.0
To: djgpp-workers AT delorie DOT com
Subject: Re: Patch for fileutils 4.0 WRT symlinks
References: <20010317113611 DOT A199 AT lauras DOT lt>
Reply-To: djgpp-workers AT delorie DOT com

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 -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019