bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] tweak lstat.c to avoid mingw link failure


From: Jim Meyering
Subject: [PATCH] tweak lstat.c to avoid mingw link failure
Date: Wed, 12 Nov 2008 17:36:12 +0100

I needed this patch in libvirt to avoid a link error.
FYI, there, lstat is pulled in solely via the dependency from tempname.
Anyone see a problem with it?

>From 96045aad0862b2f6166b41ec51088b7932c2cf6b Mon Sep 17 00:00:00 2001
From: Jim Meyering <address@hidden>
Date: Wed, 12 Nov 2008 17:33:35 +0100
Subject: [PATCH] tweak lstat.c to avoid mingw link failure

* lib/lstat.c: Include <sys/stat.h> *before* the use of stat in
orig_stat.  Otherwise, on mingw (which lacks lstat), any program using
the lstat module would not get the redefinition-to-stat provided by
gnulib's sys/stat.h.  Reported by Daniel P. Berrange.
---
 lib/lstat.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/lib/lstat.c b/lib/lstat.c
index 3e07270..e45520d 100644
--- a/lib/lstat.c
+++ b/lib/lstat.c
@@ -25,15 +25,15 @@
 #include <sys/stat.h>
 #undef __need_system_sys_stat_h

+/* Specification.  */
+#include <sys/stat.h>
+
 static inline int
 orig_lstat (const char *filename, struct stat *buf)
 {
   return lstat (filename, buf);
 }

-/* Specification.  */
-#include <sys/stat.h>
-
 #include <string.h>
 #include <errno.h>

--
1.6.0.4.857.gaca5




reply via email to

[Prev in Thread] Current Thread [Next in Thread]