From owner-freebsd-bugs Thu Jan 21 03:00:05 1999 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id DAA19256 for freebsd-bugs-outgoing; Thu, 21 Jan 1999 03:00:05 -0800 (PST) (envelope-from owner-freebsd-bugs@FreeBSD.ORG) Received: from freefall.freebsd.org (freefall.FreeBSD.ORG [204.216.27.21]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id DAA19245 for ; Thu, 21 Jan 1999 03:00:02 -0800 (PST) (envelope-from gnats@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.8.8/8.8.5) id DAA27549; Thu, 21 Jan 1999 03:00:03 -0800 (PST) Date: Thu, 21 Jan 1999 03:00:03 -0800 (PST) Message-Id: <199901211100.DAA27549@freefall.freebsd.org> To: freebsd-bugs@FreeBSD.ORG From: Edwin Woudt Subject: Re: kern/9590: Clean up for -Wall warnings Reply-To: Edwin Woudt Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org The following reply was made to PR kern/9590; it has been noted by GNATS. From: Edwin Woudt To: freebsd-gnats-submit@freebsd.org, gelderen@mediaport.org Cc: Subject: Re: kern/9590: Clean up for -Wall warnings Date: Thu, 21 Jan 1999 11:55:32 +0100 Context diffs as suggested by Bill Fenner: Index: imgact_elf.c =================================================================== RCS file: /cvs/src/sys/kern/imgact_elf.c,v retrieving revision 1.44 diff -u -r1.44 imgact_elf.c --- imgact_elf.c 1998/12/19 02:55:33 1.44 +++ imgact_elf.c 1999/01/21 10:54:41 @@ -307,8 +307,9 @@ } NDINIT(&nd, LOOKUP, LOCKLEAF|FOLLOW, UIO_SYSSPACE, file, p); - - if (error = namei(&nd)) { + + error = namei(&nd); + if (error) { nd.ni_vp = NULL; goto fail; } @@ -330,7 +331,8 @@ goto fail; hdr = (Elf_Ehdr *)imgp->image_header; - if (error = elf_check_header(hdr, ET_DYN)) + error = elf_check_header(hdr, ET_DYN); + if (error) goto fail; /* Only support headers that fit within first page for now */ @@ -352,12 +354,13 @@ if (phdr[i].p_flags & PF_R) prot |= VM_PROT_READ; - if (error = elf_load_section(p, vmspace, nd.ni_vp, + error = elf_load_section(p, vmspace, nd.ni_vp, phdr[i].p_offset, (caddr_t)phdr[i].p_vaddr + (*addr), phdr[i].p_memsz, - phdr[i].p_filesz, prot)) + phdr[i].p_filesz, prot); + if (error) goto fail; /* @@ -431,7 +434,8 @@ /* * From this point on, we may have resources that need to be freed. */ - if (error = exec_extract_strings(imgp)) + error = exec_extract_strings(imgp); + if (error) goto fail; exec_new_vmspace(imgp); @@ -450,12 +454,13 @@ if (phdr[i].p_flags & PF_R) prot |= VM_PROT_READ; - if (error = elf_load_section(imgp->proc, - vmspace, imgp->vp, - phdr[i].p_offset, - (caddr_t)phdr[i].p_vaddr, - phdr[i].p_memsz, - phdr[i].p_filesz, prot)) + error = elf_load_section(imgp->proc, + vmspace, imgp->vp, + phdr[i].p_offset, + (caddr_t)phdr[i].p_vaddr, + phdr[i].p_memsz, + phdr[i].p_filesz, prot); + if (error) goto fail; /* To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message