diff options
author | Paul Eggert <eggert@cs.ucla.edu> | 2005-05-30 07:33:38 +0000 |
---|---|---|
committer | Paul Eggert <eggert@cs.ucla.edu> | 2005-05-30 07:33:38 +0000 |
commit | 3068ea6b4d6f44d4bcceadf3c6b200d3053bf2cb (patch) | |
tree | f1b9dd4fffb9174a6a87d01239b0ba35be59543d /src | |
parent | 003510fda2cc7c2f506e4e81801136dfc437fa02 (diff) | |
download | coreutils-3068ea6b4d6f44d4bcceadf3c6b200d3053bf2cb.tar.xz |
(OPENOPTS, TEXT1T01, TEXTCNVT): Remove.
(digest_file): Use O_BINARY-using expr instead of OPENOPTS.
Diffstat (limited to 'src')
-rw-r--r-- | src/md5sum.c | 25 |
1 files changed, 1 insertions, 24 deletions
diff --git a/src/md5sum.c b/src/md5sum.c index 23395f14e..0fca7aa8c 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); |