From nobody  Wed Jan 20 15:30:48 1999
Received: (from nobody@localhost)
          by hub.freebsd.org (8.8.8/8.8.8) id PAA02731;
          Wed, 20 Jan 1999 15:30:48 -0800 (PST)
          (envelope-from nobody)
Message-Id: <199901202330.PAA02731@hub.freebsd.org>
Date: Wed, 20 Jan 1999 15:30:48 -0800 (PST)
From: gelderen@mediaport.org
To: freebsd-gnats-submit@freebsd.org
Subject: Clean up for -Wall warnings
X-Send-Pr-Version: www-1.0

>Number:         9590
>Category:       kern
>Synopsis:       Clean up for -Wall warnings
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Wed Jan 20 15:40:03 PST 1999
>Closed-Date:    Sun Feb 25 04:45:42 PST 2001
>Last-Modified:  Sun Feb 25 04:47:08 PST 2001
>Originator:     Jeroen C. van Gelderen
>Release:        3.0-CURRENT
>Organization:
>Environment:
n/a
>Description:
Patches to imgact-elf.c to eliminate -Wall warnings. Comments on style are requested before I start doing the rest of the files...
>How-To-Repeat:

>Fix:
Index: imgact_elf.c
===================================================================
RCS file: /cvs/src/sys/kern/imgact_elf.c,v
retrieving revision 1.44
diff -r1.44 imgact_elf.c
310,311c310,312
<                        
<       if (error = namei(&nd)) {
---
> 
>       error = namei(&nd);              
>       if (error) {
333c334,335
<       if (error = elf_check_header(hdr, ET_DYN))
---
>       error = elf_check_header(hdr, ET_DYN);
>       if (error)
355c357
<                       if (error = elf_load_section(p, vmspace, nd.ni_vp,
---
>                       error = elf_load_section(p, vmspace, nd.ni_vp,
360c362,363
<                                                    phdr[i].p_filesz, prot)) 
---
>                                                    phdr[i].p_filesz, prot);
>                       if (error)
434c437,438
<       if (error = exec_extract_strings(imgp))
---
>       error = exec_extract_strings(imgp);
>       if (error)
453,458c457,463
<                       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) 

>Release-Note:
>Audit-Trail:

From: Edwin Woudt <edwin@woudt.nl>
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;
  
  			/*
State-Changed-From-To: open->closed 
State-Changed-By: johan 
State-Changed-When: Sun Feb 25 04:45:42 PST 2001 
State-Changed-Why:  
Another way of removing -Wall warnings was commited by 
dillon in rev 1.46. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=9590 
>Unformatted:
