[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] tweak lstat.c to avoid mingw link failure
From: |
Jim Meyering |
Subject: |
Re: [PATCH] tweak lstat.c to avoid mingw link failure |
Date: |
Thu, 13 Nov 2008 08:02:25 +0100 |
Bruno Haible <address@hidden> 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