GNU bug report logs - #15173
[cp] --link overrides dereference settings

Previous Next

Package: coreutils;

Reported by: Gian Piero Carrubba <gpiero <at> rm-rf.it>

Date: Fri, 23 Aug 2013 21:55:02 UTC

Severity: normal

Tags: fixed

Merged with 23120

Done: Bernhard Voelker <mail <at> bernhard-voelker.de>

Bug is archived. No further changes may be made.

Full log


Message #114 received at 15173 <at> debbugs.gnu.org (full text, mbox):

From: Paul Eggert <eggert <at> cs.ucla.edu>
To: Pádraig Brady <P <at> draigBrady.com>, 15173 <at> debbugs.gnu.org
Subject: Re: bug#15173: [PATCH] cp: with --link always use linkat() if
 available
Date: Sun, 09 Feb 2014 18:29:13 -0800
Pádraig Brady wrote:
> +#if ! defined HAVE_LINKAT
>              && !(LINK_FOLLOWS_SYMLINKS && S_ISLNK (src_mode)
> -                && x->dereference == DEREF_NEVER))
> +                && x->dereference == DEREF_NEVER)
> +#endif

Could you reword that sort of thing so as not to use the #if inside an 
expression?  Something like this instead, perhaps, earlier in the code:

  #if !defined HAVE_LINKAT && LINK_FOLLOWS_SYMLINKS
  # define LINKAT_FOLLOWS_SYMLINKS 1
  #else
  # define LINKAT_FOLLOWS_SYMLINKS 0
  #endif

That way, the rest of the code can simply replace LINK_FOLLOWS_SYMLINKS 
with LINKAT_FOLLOWS_SYMLINKS, which will make it easier to read.




This bug report was last modified 6 years and 207 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.