summaryrefslogtreecommitdiff
path: root/sysdeps/mach/hurd/mmap.c
diff options
context:
space:
mode:
authorSamuel Thibault <samuel.thibault@ens-lyon.org>2015-03-21 04:49:44 +0100
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2015-03-21 04:49:44 +0100
commit868df0f9e99de0faf1d72cb623834437ebf6f615 (patch)
tree25bb170e1830f2d5189b103d9e3ac7b86226e2fa /sysdeps/mach/hurd/mmap.c
parentd583531a9e15bc6d2b21a4cc3460682bc16b4892 (diff)
downloadglibc-868df0f9e99de0faf1d72cb623834437ebf6f615.tar.gz
Fix warnings
* sysdeps/mach/hurd/Makefile ($(common-objpfx)errnos.d): Depend on libc-modules.h * sysdeps/mach/hurd/i386/trampoline.c (_hurd_setup_sighandler): Remove unused declaration of _hurd_intr_rpc_msg_in_trap. * mach/mach_init.c (__mach_init): Test whether HAVE_HOST_PAGE_SIZE is defined instead of whether it is non-zero. * sysdeps/mach/hurd/i386/intr-msg.h (INTR_MSG_TRAP): Use "+m" input constraint instead of both input and output constraint. Use ecx clobber instead of %ecx. * sysdeps/mach/hurd/malloc-machine.h (mutex_init, mutex_lock, mutex_unlock): Use a statement expression instead of an expression list. * sysdeps/mach/hurd/setitimer.c (_hurd_itimer_thread_stack_size): Set type to vm_size_t instead of vm_address_t. * sysdeps/mach/hurd/fork.c (__fork): Test whether STACK_GROWTH_UP is defined instead of whether it is non-zero. * hurd/hurd/ioctl.h (_hurd_locked_install_cttyid): New declaration. * sysdeps/mach/hurd/setsid.c: Include <hurd/ioctl.h>. * sysdeps/mach/hurd/mmap.c (__mmap): Use 0 instead of NULL for comparisons with mapaddr. * nscd/nscd-client.h: Include <time.h>. * sysdeps/mach/hurd/dl-sysdep.c (fmh): Pass vm_offset_t dummy 9th parameter to __vm_region instead of int.
Diffstat (limited to 'sysdeps/mach/hurd/mmap.c')
-rw-r--r--sysdeps/mach/hurd/mmap.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/sysdeps/mach/hurd/mmap.c b/sysdeps/mach/hurd/mmap.c
index 393008f2fe..139f27ad30 100644
--- a/sysdeps/mach/hurd/mmap.c
+++ b/sysdeps/mach/hurd/mmap.c
@@ -48,8 +48,7 @@ __mmap (__ptr_t addr, size_t len, int prot, int flags, int fd, off_t offset)
&& prot == (PROT_READ|PROT_WRITE)) /* cf VM_PROT_DEFAULT */
{
/* vm_allocate has (a little) less overhead in the kernel too. */
- err = __vm_allocate (__mach_task_self (), &mapaddr, len,
- mapaddr == NULL);
+ err = __vm_allocate (__mach_task_self (), &mapaddr, len, mapaddr == 0);
if (err == KERN_NO_SPACE)
{
@@ -61,7 +60,7 @@ __mmap (__ptr_t addr, size_t len, int prot, int flags, int fd, off_t offset)
if (!err)
err = __vm_allocate (__mach_task_self (), &mapaddr, len, 0);
}
- else if (mapaddr != NULL)
+ else if (mapaddr != 0)
err = __vm_allocate (__mach_task_self (), &mapaddr, len, 1);
}
@@ -145,7 +144,7 @@ __mmap (__ptr_t addr, size_t len, int prot, int flags, int fd, off_t offset)
err = __vm_map (__mach_task_self (),
&mapaddr, (vm_size_t) len, (vm_address_t) 0,
- mapaddr == NULL,
+ mapaddr == 0,
memobj, (vm_offset_t) offset,
! (flags & MAP_SHARED),
vmprot, VM_PROT_ALL,
@@ -167,7 +166,7 @@ __mmap (__ptr_t addr, size_t len, int prot, int flags, int fd, off_t offset)
(flags & MAP_SHARED) ? VM_INHERIT_SHARE
: VM_INHERIT_COPY);
}
- else if (mapaddr != NULL)
+ else if (mapaddr != 0)
err = __vm_map (__mach_task_self (),
&mapaddr, (vm_size_t) len, (vm_address_t) 0,
1, memobj, (vm_offset_t) offset,