[tlbuild] Patch for seek.c

Ken Brown kbrow1i at gmail.com
Tue Jul 24 22:16:07 CEST 2012


Hi Peter,

Several months ago you suggested that I look at the Cygwin-specific code 
in texk/seetexk/seek.c.  I replied that the code looked wrong to me but 
that removing it didn't solve the problem we were discussing.

Now that the dust has settled on TL2012, I suggest removing that code, 
since there's plenty of time for testing before TL2013.  The attached 
patch does this.

With the patch applied, all the seetexk tests still pass.  Let me know 
if you think I should do further tests.  I never use the seetexk 
programs, so this isn't something that will come up in my normal work.

Ken

P.S. In the same discussion several months ago, you asked me what's the 
difference between __CYGWIN__ and __CYGWIN32__.  I've since learned, as 
a result of a discussion on the Cygwin list, that __CYGWIN32__ is 
deprecated and may well be removed at some point.
-------------- next part --------------
--- seek.c.orig	2012-03-22 10:50:18.000000000 -0400
+++ seek.c	2012-07-24 11:06:43.940287400 -0400
@@ -38,10 +38,6 @@
 #include <config.h>
 #endif
 
-#ifdef __CYGWIN32__
-#include <io.h>
-#endif
-
 #ifdef KPATHSEA
 #include <kpathsea/c-fopen.h>
 #endif
@@ -86,7 +82,7 @@
 #define BSIZE BUFSIZ
 #endif
 	char stackbuf[BSIZE];
-#if defined(WIN32) || defined(MSDOS) || defined(__CYGWIN32__)
+#if defined(WIN32) || defined(MSDOS)
 	int orig_fdmode;
 #endif
 	const char *open_mode;
@@ -123,7 +119,7 @@
 	}
 #endif
 
-#if defined(WIN32) || defined(MSDOS) || defined(__CYGWIN32__)
+#if defined(WIN32) || defined(MSDOS)
 	/* make sure we open the temp file in the same mode that
 	   the original handle was open.  */
 	orig_fdmode = setmode(ifd, 0);
@@ -155,7 +151,7 @@
 	(void) fclose(f);
 	(void) lseek(tf, 0L, 0);
 	errno = 0;
-#if defined(WIN32) || defined(MSDOS) || defined(__CYGWIN32__)
+#if defined(WIN32) || defined(MSDOS)
 	open_mode =  orig_fdmode == O_BINARY ? FOPEN_RBIN_MODE : "r";
 #else
 	open_mode = "r";


More information about the tlbuild mailing list