Skip to content
Snippets Groups Projects
Commit 71813f5e authored by Marc Hoersken's avatar Marc Hoersken
Browse files

tool_metalink.c: Fixed error: 'O_BINARY' undeclared

Check for O_BINARY which is not available on every system.
parent a6df3550
No related branches found
No related tags found
No related merge requests found
......@@ -337,10 +337,15 @@ static int check_hash(const char *filename,
{
unsigned char *result;
digest_context *dctx;
int check_ok;
int fd;
int check_ok, flags, fd;
flags = O_RDONLY;
#ifdef O_BINARY
/* O_BINARY is required in order to avoid binary EOF in text mode */
fd = open(filename, O_RDONLY | O_BINARY);
flags |= O_BINARY;
#endif
fd = open(filename, flags);
if(fd == -1) {
fprintf(error, "Metalink: validating (%s) FAILED (%s)\n", filename,
strerror(errno));
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment