Hash :
05552c43
Author :
Date :
2007-09-28T23:26:49
Fix canonicalize loop-detection corner case. Do not attempt to stat the symlink values stored via seen_triple. Without this, coreutils' tests/misc/readlink-fp-loop test would fail on linux-2.6.18, (but not 2.6.22). * lib/canonicalize.c (seen_triple): Use triple_compare_ino_str, not triple_compare. The former compares dev,ino,filename, while the latter would actually stat dirname(filename) when dev and ino were equal. * lib/hash-triple.c: Install <string.h>. (STREQ): Define. (triple_compare_ino_str): New function. * lib/hash-triple.h (triple_compare_ino_str): Declare it.
#ifndef HASH_TRIPLE_H
#define HASH_TRIPLE_H
#include <sys/types.h>
#include <sys/stat.h>
#include <stdbool.h>
/* Describe a just-created or just-renamed destination file. */
struct F_triple
{
char *name;
ino_t st_ino;
dev_t st_dev;
};
extern size_t triple_hash (void const *x, size_t table_size);
extern size_t triple_hash_no_name (void const *x, size_t table_size);
extern bool triple_compare (void const *x, void const *y);
extern bool triple_compare_ino_str (void const *x, void const *y);
extern void triple_free (void *x);
#endif