From 7142e36d1f4ed5a45e089bb972db73bb3f91ad94 Mon Sep 17 00:00:00 2001 From: reimar Date: Sun, 26 Nov 2006 13:09:46 +0000 Subject: Remove useless fd parameter for mmap_anon git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@21264 b3059339-0415-0410-9bf9-f77b7e298cf2 --- osdep/mmap_anon.c | 7 ++----- osdep/mmap_anon.h | 2 +- 2 files changed, 3 insertions(+), 6 deletions(-) (limited to 'osdep') 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 -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_ */ -- cgit v1.2.3