Use MAP_FAILED to check for mmap failure instead of manually

recreating the value.
This commit is contained in:
Reimar Döffinger 2011-05-07 10:00:03 +02:00
parent f44967b1b5
commit 314374e579
1 changed files with 1 additions and 1 deletions

View File

@ -75,7 +75,7 @@ int av_file_map(const char *filename, uint8_t **bufptr, size_t *size,
#if HAVE_MMAP
ptr = mmap(NULL, *size, PROT_READ|PROT_WRITE, MAP_PRIVATE, fd, 0);
if (ptr == (void*)-1) {
if (ptr == MAP_FAILED) {
err = AVERROR(errno);
av_strerror(err, errbuf, sizeof(errbuf));
av_log(&file_log_ctx, AV_LOG_ERROR, "Error occurred in mmap(): %s\n", errbuf);