Date: Mon, 10 Jul 2017 05:59:06 +0000 (UTC) From: Konstantin Belousov <kib@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r320863 - stable/11/sys/kern Message-ID: <201707100559.v6A5x61t017269@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: kib Date: Mon Jul 10 05:59:06 2017 New Revision: 320863 URL: https://svnweb.freebsd.org/changeset/base/320863 Log: MFC r320619: Resolve confusion between different error code spaces. Modified: stable/11/sys/kern/kern_exec.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/kern/kern_exec.c ============================================================================== --- stable/11/sys/kern/kern_exec.c Mon Jul 10 05:34:37 2017 (r320862) +++ stable/11/sys/kern/kern_exec.c Mon Jul 10 05:59:06 2017 (r320863) @@ -1057,9 +1057,9 @@ exec_unmap_first_page(imgp) } /* - * Destroy old address space, and allocate a new stack - * The new stack is only SGROWSIZ large because it is grown - * automatically in trap.c. + * Destroy old address space, and allocate a new stack. + * The new stack is only sgrowsiz large because it is grown + * automatically on a page fault. */ int exec_new_vmspace(imgp, sv) @@ -1113,9 +1113,9 @@ exec_new_vmspace(imgp, sv) VM_PROT_READ | VM_PROT_EXECUTE, VM_PROT_READ | VM_PROT_EXECUTE, MAP_INHERIT_SHARE | MAP_ACC_NO_CHARGE); - if (error) { + if (error != KERN_SUCCESS) { vm_object_deallocate(obj); - return (error); + return (vm_mmap_to_errno(error)); } } @@ -1139,10 +1139,9 @@ exec_new_vmspace(imgp, sv) stack_addr = sv->sv_usrstack - ssiz; error = vm_map_stack(map, stack_addr, (vm_size_t)ssiz, obj != NULL && imgp->stack_prot != 0 ? imgp->stack_prot : - sv->sv_stackprot, - VM_PROT_ALL, MAP_STACK_GROWS_DOWN); - if (error) - return (error); + sv->sv_stackprot, VM_PROT_ALL, MAP_STACK_GROWS_DOWN); + if (error != KERN_SUCCESS) + return (vm_mmap_to_errno(error)); /* * vm_ssize and vm_maxsaddr are somewhat antiquated concepts, but they
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201707100559.v6A5x61t017269>