This is the mail archive of the cygwin@sourceware.cygnus.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: problem compiling sharutils-4.2.1 under Cygwin 1.0


Steve Kelem wrote:
> I'm trying to build sharutils-4.2.1 under Cygwin 1.0 on WinNT 4.0 SP6 on
> a Pentium III 550.
> 
> It appears to build and compile ok, but fails the first test.

I'm sure you have textmode mounts. Try using binmode mounts or better
change the sources of sharutils to support the "b" flag of
f(re)open if compiled with cygwin.
It's simple. Example from sharutils-4.2, uudecode/uuencode:

--- uudecode.c.orig     Sat Jan 22 10:42:30 2000
+++ uudecode.c  Sat Jan 22 10:41:41 2000
@@ -339,8 +339,13 @@ decode (inname, forced_outname)

   /* Create output file and set mode.  */

+#ifdef __CYGWIN__
+#define OPENMODE "wb"
+#else
+#define OPENMODE "w"
+#endif
   if (strcmp (outname, "/dev/stdout") != 0 && strcmp (outname, "-") !=
0
-      && (freopen (outname, "w", stdout) == NULL
+      && (freopen (outname, OPENMODE, stdout) == NULL
 #if HAVE_FCHMOD
          || fchmod (fileno (stdout), mode & (S_IRWXU | S_IRWXG |
S_IRWXO))
 #else
--- uuencode.c.orig     Sat Jan 22 10:42:45 2000
+++ uuencode.c  Sat Jan 22 10:43:24 2000
@@ -270,7 +270,13 @@ main (argc, argv)

       /* Optional first argument is input file.  */

-      if (!freopen (argv[optind], "r", stdin) || fstat (fileno (stdin),
&sb))
+#ifdef __CYGWIN__
+#define OPENMODE "rb"
+#else
+#define OPENMODE "r"
+#endif
+      if (!freopen (argv[optind], OPENMODE, stdin)
+          || fstat (fileno (stdin), &sb))
        error (EXIT_FAILURE, errno, "%s", argv[optind]);
       mode = sb.st_mode & (S_IRWXU | S_IRWXG | S_IRWXO);
       optind++;

--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]