Subject: lib/1100: compile warnings in libutil
To: None <gnats-admin@sun-lamp.cs.berkeley.edu>
From: Thorsten Lockert <tholo@SigmaSoft.COM>
List: netbsd-bugs
Date: 06/03/1995 20:50:06
>Number:         1100
>Category:       lib
>Synopsis:       compile warnings in libutil
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    lib-bug-people (Library Bug People)
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sat Jun  3 20:50:03 1995
>Originator:     Thorsten Lockert
>Organization:
SigmaSoft, Th. Lockert
>Release:        May 28, 1995
>Environment:
	
System: NetBSD gandalf.sigmasoft.com 1.0A NetBSD 1.0A (GANDALF) #1: Sun May 7 21:49:27 PDT 1995 tholo@gandalf.sigmasoft.com:/usr/src/sys/arch/i386/compile/GANDALF i386


>Description:
	There are multiple compile warnings in src/lib/libutil when compiled
	with -Wall -Wstrict-prototypes

>How-To-Repeat:
	Compile it with -Wall -Wstrict-prototypes

>Fix:
	Apply the following patches:

diff -c src/lib/libutil.orig/login.c src/lib/libutil/login.c
*** src/lib/libutil.orig/login.c	Sat Jun  3 20:32:35 1995
--- src/lib/libutil/login.c	Sat Jun  3 20:37:45 1995
***************
*** 44,49 ****
--- 44,51 ----
  #include <utmp.h>
  #include <stdio.h>
  
+ void login __P((struct utmp *));
+ 
  void
  login(ut)
  	struct utmp *ut;
diff -c src/lib/libutil.orig/login_tty.c src/lib/libutil/login_tty.c
*** src/lib/libutil.orig/login_tty.c	Sat Jun  3 20:32:35 1995
--- src/lib/libutil/login_tty.c	Sat Jun  3 20:38:26 1995
***************
*** 38,44 ****
--- 38,48 ----
  
  #include <sys/param.h>
  #include <sys/ioctl.h>
+ #include <unistd.h>
  
+ int login_tty __P((int));
+ 
+ int
  login_tty(fd)
  	int fd;
  {
diff -c src/lib/libutil.orig/logout.c src/lib/libutil/logout.c
*** src/lib/libutil.orig/logout.c	Sat Jun  3 20:32:35 1995
--- src/lib/libutil/logout.c	Sat Jun  3 20:37:27 1995
***************
*** 45,50 ****
--- 45,52 ----
  #include <stdlib.h>
  #include <string.h>
  
+ int logout __P((char *));
+ 
  typedef struct utmp UTMP;
  
  int
diff -c src/lib/libutil.orig/logwtmp.c src/lib/libutil/logwtmp.c
*** src/lib/libutil.orig/logwtmp.c	Sat Jun  3 20:32:35 1995
--- src/lib/libutil/logwtmp.c	Sat Jun  3 20:36:57 1995
***************
*** 41,57 ****
  #include <sys/time.h>
  #include <sys/stat.h>
  
  #include <unistd.h>
  #include <utmp.h>
  
  logwtmp(line, name, host)
  	char *line, *name, *host;
  {
  	struct utmp ut;
  	struct stat buf;
  	int fd;
- 	time_t time();
- 	char *strncpy();
  
  	if ((fd = open(_PATH_WTMP, O_WRONLY|O_APPEND, 0)) < 0)
  		return;
--- 41,60 ----
  #include <sys/time.h>
  #include <sys/stat.h>
  
+ #include <string.h>
+ #include <time.h>
  #include <unistd.h>
  #include <utmp.h>
  
+ void logwtmp __P((char *, char *, char *));
+ 
+ void
  logwtmp(line, name, host)
  	char *line, *name, *host;
  {
  	struct utmp ut;
  	struct stat buf;
  	int fd;
  
  	if ((fd = open(_PATH_WTMP, O_WRONLY|O_APPEND, 0)) < 0)
  		return;
diff -c src/lib/libutil.orig/pty.c src/lib/libutil/pty.c
*** src/lib/libutil.orig/pty.c	Sat Jun  3 20:32:35 1995
--- src/lib/libutil/pty.c	Sat Jun  3 20:40:08 1995
***************
*** 48,53 ****
--- 48,58 ----
  #include <string.h>
  #include <grp.h>
  
+ int login_tty __P((int));
+ int openpty __P((int *, int *, char *, struct termios *, struct winsize *));
+ pid_t forkpty __P((int *, char *, struct termios *, struct winsize *));
+ 
+ int
  openpty(amaster, aslave, name, termp, winp)
  	int *amaster, *aslave;
  	char *name;
***************
*** 98,110 ****
  	return (-1);
  }
  
  forkpty(amaster, name, termp, winp)
  	int *amaster;
  	char *name;
  	struct termios *termp;
  	struct winsize *winp;
  {
! 	int master, slave, pid;
  
  	if (openpty(&master, &slave, name, termp, winp) == -1)
  		return (-1);
--- 103,117 ----
  	return (-1);
  }
  
+ pid_t
  forkpty(amaster, name, termp, winp)
  	int *amaster;
  	char *name;
  	struct termios *termp;
  	struct winsize *winp;
  {
! 	int master, slave;
! 	pid_t pid;
  
  	if (openpty(&master, &slave, name, termp, winp) == -1)
  		return (-1);
>Audit-Trail:
>Unformatted: