mirror of
https://github.com/mirror/wget.git
synced 2025-02-24 10:41:01 +08:00
Fix warning about redefinition of MAP_FAILED
* src/sysdep.h: Removed definition of MAP_FAILED * src/utils.c: Check and define MAP_FAILED after including sys/mmap.h
This commit is contained in:
parent
7c0752c4cb
commit
2c736abb4c
10
src/sysdep.h
10
src/sysdep.h
@ -143,16 +143,6 @@ int snprintf (char *str, size_t count, const char *fmt, ...);
|
||||
int vsnprintf (char *str, size_t count, const char *fmt, va_list arg);
|
||||
#endif
|
||||
|
||||
/* Some systems (Linux libc5, "NCR MP-RAS 3.0", and others) don't
|
||||
provide MAP_FAILED, a symbolic constant for the value returned by
|
||||
mmap() when it doesn't work. Usually, this constant should be -1.
|
||||
This only makes sense for files that use mmap() and include
|
||||
sys/mman.h *before* sysdep.h, but doesn't hurt others. */
|
||||
|
||||
#ifndef MAP_FAILED
|
||||
# define MAP_FAILED ((void *) -1)
|
||||
#endif
|
||||
|
||||
/* Enable system fnmatch only on systems where fnmatch.h is usable.
|
||||
If the fnmatch on your system is buggy, undef this symbol and a
|
||||
replacement implementation will be used instead. */
|
||||
|
15
src/utils.c
15
src/utils.c
@ -37,9 +37,6 @@ as that of the covered work. */
|
||||
#include <string.h>
|
||||
#include <time.h>
|
||||
#include <unistd.h>
|
||||
#ifdef HAVE_MMAP
|
||||
# include <sys/mman.h>
|
||||
#endif
|
||||
#ifdef HAVE_PROCESS_H
|
||||
# include <process.h> /* getpid() */
|
||||
#endif
|
||||
@ -90,6 +87,18 @@ as that of the covered work. */
|
||||
# define USE_SIGNAL_TIMEOUT
|
||||
#endif
|
||||
|
||||
/* Some systems (Linux libc5, "NCR MP-RAS 3.0", and others) don't
|
||||
provide MAP_FAILED, a symbolic constant for the value returned by
|
||||
mmap() when it doesn't work. Usually, this constant should be -1.
|
||||
This only makes sense for files that use mmap() and include
|
||||
sys/mman.h *before* sysdep.h, but doesn't hurt others. */
|
||||
#ifdef HAVE_MMAP
|
||||
# include <sys/mman.h>
|
||||
# ifndef MAP_FAILED
|
||||
# define MAP_FAILED ((void *) -1)
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#include "utils.h"
|
||||
#include "hash.h"
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user