[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: Feature Branch Windows Build Broken - lib/canonicalize.c - ELOOP & l
From: |
Conrad T. Pino |
Subject: |
RE: Feature Branch Windows Build Broken - lib/canonicalize.c - ELOOP & lstat |
Date: |
Tue, 24 May 2005 19:14:42 -0700 |
Hi Derek,
Here's a rough draft of a patch that allows Windows build to complete.
The draft includes edited files only and ignores generated files and
Windows build projects files are also omitted.
Briefly the plan is:
#define stat wnt_stat
#define lstat wnt_stat
int wnt_stat (const char *file, struct wnt_stat *sb);
Delete wnt_lstat definition
Prevent "lib/system.h" from redefining "lstat".
Please review and revise the concept and I'll commit the results.
Conrad
Index: lib/system.h
===================================================================
RCS file: /cvs/ccvs/lib/system.h,v
retrieving revision 1.76
diff -u -p -r1.76 system.h
--- lib/system.h 24 May 2005 21:05:37 -0000 1.76
+++ lib/system.h 25 May 2005 01:20:36 -0000
@@ -371,7 +371,7 @@ extern int errno;
otherwise return it unchanged. */
#define convert_blocks(b, k) ((k) ? ((b) + 1) / 2 : (b))
-#ifndef S_ISLNK
+#if !defined(lstat) && !defined(S_ISLNK)
# define lstat stat
#endif
Index: windows-NT/config.h.in.footer
===================================================================
RCS file: /cvs/ccvs/windows-NT/config.h.in.footer,v
retrieving revision 1.4
diff -u -p -r1.4 config.h.in.footer
--- windows-NT/config.h.in.footer 1 Mar 2005 14:37:39 -0000 1.4
+++ windows-NT/config.h.in.footer 25 May 2005 01:20:37 -0000
@@ -11,11 +11,7 @@
#define CVS_MKDIR wnt_mkdir
int wnt_mkdir (const char *PATH, int MODE);
-#define CVS_STAT wnt_stat
-int wnt_stat ();
-
-#define CVS_LSTAT wnt_lstat
-int wnt_lstat ();
+int wnt_stat (const char *file, struct wnt_stat *sb);
#define CVS_RENAME wnt_rename
int wnt_rename (const char *, const char *);
@@ -95,3 +91,6 @@ char *sock_strerror (int errnum);
/* getpagesize is missing on Windows, but 4096 seems to do the right
thing. */
#define getpagesize() 4096
+
+/* Windows has no ELOOP value in errno.h */
+#define ELOOP 10000
Index: windows-NT/config.h.in.in
===================================================================
RCS file: /cvs/ccvs/windows-NT/config.h.in.in,v
retrieving revision 1.30
diff -u -p -r1.30 config.h.in.in
--- windows-NT/config.h.in.in 2 May 2005 14:08:18 -0000 1.30
+++ windows-NT/config.h.in.in 25 May 2005 01:20:37 -0000
@@ -92,8 +92,9 @@
message to be appended to the temp file when the editor is started. */
#undef FORCE_USE_EDITOR
-/* Define if gettimeofday clobbers localtime's static buffer. */
-#undef GETTIMEOFDAY_CLOBBERS_LOCALTIME_BUFFER
+/* Define to rpl_ if the glob replacement functions and variables should be
+ used. */
+#define GLOB_PREFIX rpl_
/* Define to an alternative value if GSS_C_NT_HOSTBASED_SERVICE isn't defined
in the gssapi.h header file. MIT Kerberos 1.2.1 requires this. Only
@@ -1083,6 +1084,9 @@
/* Define to rpl_localtime if the replacement function should be used. */
#undef localtime
+/* Define to a substitute for the `lstat' function. */
+#define lstat wnt_stat
+
/* Define to rpl_malloc if the replacement function should be used. */
#undef malloc
@@ -1132,6 +1136,9 @@
/* Define as a signed type of the same size as size_t. */
#define ssize_t int
+/* Define to a substitute for the stat function. */
+#define stat wnt_stat
+
/* Define to rpl_tzset if the wrapper function should be used. */
#undef tzset
Index: windows-NT/filesubr.c
===================================================================
RCS file: /cvs/ccvs/windows-NT/filesubr.c,v
retrieving revision 1.56
diff -u -p -r1.56 filesubr.c
--- windows-NT/filesubr.c 23 May 2005 22:56:16 -0000 1.56
+++ windows-NT/filesubr.c 25 May 2005 01:20:40 -0000
@@ -970,26 +970,17 @@ static void check_statbuf (const char *f
error (1, 0, "Failed to retrieve modification time for %s", file);
}
-/* see CVS_STAT */
-int
-wnt_stat (const char *file, struct stat *sb)
-{
- int retval;
+/* undo config.h macros */
+#undef stat
+extern int stat (const char *file, struct wnt_stat *sb);
- retval = stat (file, sb);
- if (retval < 0)
- return retval;
- check_statbuf (file, sb);
- return retval;
-}
-
-/* see CVS_LSTAT */
+/* see stat macro */
int
-wnt_lstat (const char *file, struct stat *sb)
+wnt_stat (const char *file, struct wnt_stat *sb)
{
int retval;
- retval = lstat (file, sb);
+ retval = stat (file, sb);
if (retval < 0)
return retval;
check_statbuf (file, sb);