Skip to content

Commit

Permalink
gather-topology: make sure we don't gather the same file/link twice
Browse files Browse the repository at this point in the history
Symlinks may actually cause issues if the target of an already gathered
symlink is used as the destination of the new gathered link.

Signed-off-by: Brice Goglin <Brice.Goglin@inria.fr>
  • Loading branch information
bgoglin committed Apr 24, 2019
1 parent 6608c48 commit ac77483
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions utils/hwloc/hwloc-gather-topology.in
Expand Up @@ -137,11 +137,11 @@ savedir() {
done
# gather all files now
find "$path" -type f 2>/dev/null | while read -r file ; do
_savefile "$dest" "$file"
test -e "$dest/$file" || _savefile "$dest" "$file"
done
# gather symlinks
find "$path" -type l 2>/dev/null | while read -r link ; do
_savelink "$dest" "$link"
test -e "$dest/$link" || _savelink "$dest" "$link"
done
}

Expand Down

0 comments on commit ac77483

Please sign in to comment.