]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
(OPENOPTS, TEXT1T01, TEXTCNVT): Remove.
authorPaul Eggert <eggert@cs.ucla.edu>
Mon, 30 May 2005 07:33:38 +0000 (07:33 +0000)
committerPaul Eggert <eggert@cs.ucla.edu>
Mon, 30 May 2005 07:33:38 +0000 (07:33 +0000)
(digest_file): Use O_BINARY-using expr instead of OPENOPTS.

src/md5sum.c

index 23395f14e50254d51572b8975a4635c5e9b5b927..0fca7aa8c5332d98bfdd9ba157f0966c1cedb438 100644 (file)
 
 #define AUTHORS "Ulrich Drepper", "Scott Miller"
 
-/* Most systems do not distinguish between external and internal
-   text representations.  */
-/* FIXME: This begs for an autoconf test.  */
-#if O_BINARY
-# define OPENOPTS(BINARY) ((BINARY) ? TEXT1TO1 : TEXTCNVT)
-# define TEXT1TO1 "rb"
-# define TEXTCNVT "r"
-#else
-# if defined VMS
-#  define OPENOPTS(BINARY) ((BINARY) ? TEXT1TO1 : TEXTCNVT)
-#  define TEXT1TO1 "rb", "ctx=stm"
-#  define TEXTCNVT "r", "ctx=stm"
-# else
-#  if UNIX || __UNIX__ || unix || __unix__ || _POSIX_VERSION
-#   define OPENOPTS(BINARY) "r"
-#  else
-    /* The following line is intended to evoke an error.
-       Using #error is not portable enough.  */
-    "Cannot determine system type."
-#  endif
-# endif
-#endif
-
 
 #define DIGEST_TYPE_STRING(Alg) ((Alg) == ALG_MD5 ? "MD5" : "SHA1")
 #define DIGEST_STREAM(Alg) ((Alg) == ALG_MD5 ? md5_stream : sha1_stream)
@@ -354,7 +331,7 @@ digest_file (const char *filename, bool binary, unsigned char *bin_result,
         Some systems distinguish between internal and
         external text representations.  */
 
-      fp = fopen (filename, OPENOPTS (binary));
+      fp = fopen (filename, (O_BINARY && binary ? "rb" : "r"));
       if (fp == NULL)
        {
          error (0, errno, "%s", filename);