Subject: current ypserv/makedbm has errors
To: None <current-users@NetBSD.ORG>
From: Tim Rightnour <root@garbled.net>
List: current-users
Date: 06/10/1998 10:43:32
I tried to compile ypserv from a sup this morning and ran into:
(this is on an alpha, though that shouldn't matter)


rigel# make
cc -O  -Werror -Wall -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith 
-I/usr/src/current/src/usr.sbin/ypserv/makedbm/../common -c makedbm.c
cc1: warnings being treated as errors
makedbm.c: In function `create_database':
makedbm.c:296: warning: passing arg 3 of `fparseln' from incompatible pointer
type
*** Error code 1

Stop.
rigel# pico -w +296 makedbm.c
rigel# make
cc -O  -Werror -Wall -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith 
-I/usr/src/current/src/usr.sbin/ypserv/makedbm/../common -c makedbm.c
cc1: warnings being treated as errors
makedbm.c: In function `create_database':
makedbm.c:323: warning: int format, different type arg (arg 3)
*** Error code 1

The fixes are:

*** makedbm.c.orig      Wed Jun 10 10:30:44 1998
--- makedbm.c   Wed Jun 10 10:42:17 1998
***************
*** 245,249 ****
        FILE *data_file;
        char myname[MAXHOSTNAMELEN];
!       int line_no = 0;
        size_t len;
        char *p, *k, *v, *slash;
--- 245,249 ----
        FILE *data_file;
        char myname[MAXHOSTNAMELEN];
!       size_t line_no = 0;
        size_t len;
        char *p, *k, *v, *slash;
***************
*** 321,325 ****
                        ypdb_close(new_db);
                        unlink(db_mapname);
!                       errx(1, "error adding record for line %d", line_no);
                }
        }
--- 321,325 ----
                        ypdb_close(new_db);
                        unlink(db_mapname);
!                       errx(1, "error adding record for line %ld", line_no);
                }
        }



---
Tim Rightnour    -  root@garbled.net
http://www.zynetwc.com/~garbled/garbled.html