From 3068ea6b4d6f44d4bcceadf3c6b200d3053bf2cb Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Mon, 30 May 2005 07:33:38 +0000 Subject: [PATCH] (OPENOPTS, TEXT1T01, TEXTCNVT): Remove. (digest_file): Use O_BINARY-using expr instead of OPENOPTS. --- src/md5sum.c | 25 +------------------------ 1 file changed, 1 insertion(+), 24 deletions(-) diff --git a/src/md5sum.c b/src/md5sum.c index 23395f14e5..0fca7aa8c5 100644 --- a/src/md5sum.c +++ b/src/md5sum.c @@ -37,29 +37,6 @@ #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); -- 2.47.3