Bruno Haible <[EMAIL PROTECTED]> wrote: > Jim Meyering wrote: >> I needed this patch in libvirt to avoid a link error. >> * lib/lstat.c: Include <sys/stat.h> *before* the use of stat in >> orig_stat. > > This is not right: On Unix systems on which lstat is not POSIX compliant, > it will lead to an endless recursion > rpl_lstat -> orig_lstat -> rpl_lstat -> ... > > In a compilation on mingw, test-lstat.exe linked fine for me. The only > anomaly that I can see is that lstat.c is compiled, indeed with an undefined > reference to 'lstat'. It will lead to a link error when creating a shared > library. I would propose this fix instead:
Much better ;-) Thank you. I've pushed that verbatim, after adding this one-line log summary: lstat: don't compile lstat.c on systems lacking lstat
