From dan@obluda.cz  Sun Sep 12 02:37:48 2004
Return-Path: <dan@obluda.cz>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id 9FD8D16A4CE
	for <FreeBSD-gnats-submit@freebsd.org>; Sun, 12 Sep 2004 02:37:48 +0000 (GMT)
Received: from kulesh.obluda.cz (kulesh.obluda.cz [193.179.22.243])
	by mx1.FreeBSD.org (Postfix) with ESMTP id 4A74D43D31
	for <FreeBSD-gnats-submit@freebsd.org>; Sun, 12 Sep 2004 02:37:47 +0000 (GMT)
	(envelope-from dan@obluda.cz)
Received: from kulesh.obluda.cz (localhost.eunet.cz [127.0.0.1])
	by kulesh.obluda.cz (8.13.1/8.13.1) with ESMTP id i8C2bjmm007101
	for <FreeBSD-gnats-submit@freebsd.org>; Sun, 12 Sep 2004 04:37:46 +0200 (CEST)
	(envelope-from dan@obluda.cz)
Received: (from root@localhost)
	by kulesh.obluda.cz (8.13.1/8.13.1/Submit) id i8C2bjwJ007100
	for FreeBSD-gnats-submit@freebsd.org; Sun, 12 Sep 2004 04:37:45 +0200 (CEST)
	(envelope-from dan@obluda.cz)
Message-Id: <200409120237.i8C2bjwJ007100@kulesh.obluda.cz>
Date: Sun, 12 Sep 2004 04:37:45 +0200 (CEST)
From: Dan Lukes <dan@obluda.cz>
Reply-To: Dan Lukes <dan@obluda.cz>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: [PATCH] cleanup of the usr.sbin/sysinstall code
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         71620
>Category:       bin
>Synopsis:       [PATCH] sysinstall(8): cleanup of the usr.sbin/sysinstall code
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    matteo
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sun Sep 12 02:40:24 GMT 2004
>Closed-Date:    Mon Sep 17 13:49:26 GMT 2007
>Last-Modified:  Mon Sep 17 13:49:26 GMT 2007
>Originator:     Dan Lukes
>Release:        FreeBSD 5.3-BETA3 i386
>Organization:
Obludarium
>Environment:
System: FreeBSD kulesh.obluda.cz 5.3-BETA3 FreeBSD 5.3-BETA3 #8: Sun Sep 5 07:06:40 CEST 2004 dan@kulesh.obluda.cz:/usr/obj/usr/src/sys/Dan i386
usr.sbin/sysinstall/system.c,v 1.123 2004/03/11 11:58:16 bde
usr.sbin/sysinstall/config.c,v 1.225.2.1 2004/09/02 01:54:59 kensmith
usr.sbin/sysinstall/Makefile,v 1.131 2003/11/20 20:43:06 jhb

>Description:
	There are more than 5000 warnings issued during "make buildworld".
Some of them are false positives, but some of them are sign of true errors.

	Nobody is upset by warnings due it's amount, so some errors remain
uncorrected.

	I want to cleanup the code-base from warnings, so warnings will
become "attention mark" again.

usr.sbin/sysinstall/system.c:103: warning: 'reap_children' defined but not used
usr.sbin/sysinstall/config.c:602: warning: 'write_root_xprofile' defined but not used
usr.sbin/sysinstall/config.c:627: warning: 'gotit' defined but not used
usr.sbin/sysinstall/index.c:619: warning: dereferencing type-punned pointer will break strict-aliasing rules


>How-To-Repeat:
	N/A
>Fix:
*** usr.sbin/sysinstall/system.c.ORIG	Wed Mar 17 01:05:00 2004
--- usr.sbin/sysinstall/system.c	Mon Sep  6 16:35:17 2004
***************
*** 95,100 ****
--- 95,101 ----
      restorescr(save);
  }
  
+ #if 0
  /*
   * Harvest children if we are init.
   */
***************
*** 107,112 ****
--- 108,114 ----
  	;
      errno = errbak;
  }
+ #endif
  
  /* Expand a file into a convenient location, nuking it each time */
  static char *
*** usr.sbin/sysinstall/config.c.ORIG	Fri Sep  3 10:03:52 2004
--- usr.sbin/sysinstall/config.c	Mon Sep  6 16:37:09 2004
***************
*** 597,639 ****
      return DITEM_SUCCESS;
  }
  
- static void
- write_root_xprofile(char *str)
- {
-     FILE *fp;
-     int len;
-     char **cp;
-     static char *flist[] = { /* take care of both xdm and startx */
- 	"/root/.xinitrc",
- 	"/root/.xsession",
- 	"/usr/share/skel/dot.xinitrc",
- 	"/usr/share/skel/dot.xsession",
- 	NULL,
-     };
- 
-     len = strlen(str);
-     for (cp = flist; *cp; cp++) {
- 	fp = fopen(*cp, "w");
- 	if (fp) {
- 	    fwrite(str, 1, len, fp);
- 	    fchmod(fileno(fp), 0755);
- 	    fclose(fp);
- 	}
-     }
- }
- 
- static int
- gotit(char *fname)
- {
-     char tmp[FILENAME_MAX];
- 
-     snprintf(tmp, sizeof tmp, "/usr/X11R6/bin/%s", fname);
-     if (file_executable(tmp))
- 	return TRUE;
-     snprintf(tmp, sizeof tmp, "/usr/local/bin/%s", fname);
-     return file_executable(tmp);
- }
- 
  int
  configResolv(dialogMenuItem *ditem)
  {
--- 597,602 ----
*** usr.sbin/sysinstall/Makefile.ORIG	Sat Dec  6 20:38:20 2003
--- usr.sbin/sysinstall/Makefile	Mon Sep  6 17:31:31 2004
***************
*** 18,24 ****
  SRCS+=  pccard.c
  .endif
  
! CFLAGS+= -DUSE_GZIP=1
  .if ${MACHINE} == "pc98"
  CFLAGS+= -DPC98
  .endif
--- 18,24 ----
  SRCS+=  pccard.c
  .endif
  
! CFLAGS+= -DUSE_GZIP=1 -fno-strict-aliasing
  .if ${MACHINE} == "pc98"
  CFLAGS+= -DPC98
  .endif
>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->matteo 
Responsible-Changed-By: matteo 
Responsible-Changed-When: Mon Mar 19 11:30:18 UTC 2007 
Responsible-Changed-Why:  
I'd like to take a look at this in the near future. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=71620 
State-Changed-From-To: open->closed 
State-Changed-By: matteo 
State-Changed-When: Mon Sep 17 13:48:33 UTC 2007 
State-Changed-Why:  
This warnings no longer exist. 

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