diff options
author | reimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2006-11-26 13:09:46 +0000 |
---|---|---|
committer | reimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2006-11-26 13:09:46 +0000 |
commit | 7142e36d1f4ed5a45e089bb972db73bb3f91ad94 (patch) | |
tree | d7b5557844d9d5e2b8e38d829f6d251594da509b /osdep | |
parent | c95db8d583d9f6a773865afe133340966334a86a (diff) | |
download | mpv-7142e36d1f4ed5a45e089bb972db73bb3f91ad94.tar.bz2 mpv-7142e36d1f4ed5a45e089bb972db73bb3f91ad94.tar.xz |
Remove useless fd parameter for mmap_anon
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@21264 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'osdep')
-rw-r--r-- | osdep/mmap_anon.c | 7 | ||||
-rw-r--r-- | osdep/mmap_anon.h | 2 |
2 files changed, 3 insertions, 6 deletions
diff --git a/osdep/mmap_anon.c b/osdep/mmap_anon.c index b6d0b7cf35..484615311a 100644 --- a/osdep/mmap_anon.c +++ b/osdep/mmap_anon.c @@ -31,7 +31,7 @@ * \param zerofd * \return a pointer to the mapped region upon successful completion, -1 otherwise. */ -void *mmap_anon(void *addr, size_t len, int prot, int flags, int *zerofd, off_t offset) +void *mmap_anon(void *addr, size_t len, int prot, int flags, off_t offset) { int fd; void *result; @@ -46,7 +46,6 @@ void *mmap_anon(void *addr, size_t len, int prot, int flags, int *zerofd, off_t #ifdef MAP_ANONYMOUS /* BSD-style anonymous mapping */ - fd = -1; result = mmap(addr, len, prot, flags | MAP_ANONYMOUS, -1, offset); #else /* SysV-style anonymous mapping */ @@ -57,11 +56,9 @@ void *mmap_anon(void *addr, size_t len, int prot, int flags, int *zerofd, off_t } result = mmap(addr, len, prot, flags, fd, offset); + close(fd); #endif /* MAP_ANONYMOUS */ - if (zerofd) - *zerofd = fd; - return result; } diff --git a/osdep/mmap_anon.h b/osdep/mmap_anon.h index edb909bdc0..e0f2d4e1ed 100644 --- a/osdep/mmap_anon.h +++ b/osdep/mmap_anon.h @@ -3,6 +3,6 @@ #include <sys/types.h> -void *mmap_anon(void *, size_t, int, int, int *, off_t); +void *mmap_anon(void *, size_t, int, int, off_t); #endif /* _OSDEP_MMAP_ANON_H_ */ |