summaryrefslogtreecommitdiff
path: root/lib/libc/gen
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libc/gen')
-rw-r--r--lib/libc/gen/alarm.c4
-rw-r--r--lib/libc/gen/confstr.c8
-rw-r--r--lib/libc/gen/ctype_.c4
-rw-r--r--lib/libc/gen/disklabel.c17
-rw-r--r--lib/libc/gen/errlist.c9
-rw-r--r--lib/libc/gen/getcap.c8
-rw-r--r--lib/libc/gen/getgrouplist.c3
-rw-r--r--lib/libc/gen/getpwent.c7
-rw-r--r--lib/libc/gen/getttyent.c6
-rw-r--r--lib/libc/gen/nlist.c9
-rw-r--r--lib/libc/gen/sleep.c8
-rw-r--r--lib/libc/gen/sysconf.c3
-rw-r--r--lib/libc/gen/ttyname.c3
-rw-r--r--lib/libc/gen/ualarm.c6
-rw-r--r--lib/libc/gen/uname.c3
-rw-r--r--lib/libc/gen/unvis.c4
-rw-r--r--lib/libc/gen/usleep.c8
17 files changed, 47 insertions, 63 deletions
diff --git a/lib/libc/gen/alarm.c b/lib/libc/gen/alarm.c
index bc85cff4cf4..2e8f75a4cfd 100644
--- a/lib/libc/gen/alarm.c
+++ b/lib/libc/gen/alarm.c
@@ -32,7 +32,7 @@
*/
#if defined(LIBC_SCCS) && !defined(lint)
-static char rcsid[] = "$OpenBSD: alarm.c,v 1.2 1996/08/19 08:21:43 tholo Exp $";
+static char rcsid[] = "$OpenBSD: alarm.c,v 1.3 1996/09/15 09:30:54 tholo Exp $";
#endif /* LIBC_SCCS and not lint */
/*
@@ -52,7 +52,7 @@ alarm(secs)
itp->it_value.tv_sec = secs;
itp->it_value.tv_usec = 0;
if (setitimer(ITIMER_REAL, itp, &oitv) < 0)
- return (-1);
+ return ((unsigned int) -1);
if (oitv.it_value.tv_usec)
oitv.it_value.tv_sec++;
return (oitv.it_value.tv_sec);
diff --git a/lib/libc/gen/confstr.c b/lib/libc/gen/confstr.c
index f391bf86dfd..cb25deed19a 100644
--- a/lib/libc/gen/confstr.c
+++ b/lib/libc/gen/confstr.c
@@ -32,7 +32,7 @@
*/
#if defined(LIBC_SCCS) && !defined(lint)
-static char rcsid[] = "$OpenBSD: confstr.c,v 1.2 1996/08/19 08:21:59 tholo Exp $";
+static char rcsid[] = "$OpenBSD: confstr.c,v 1.3 1996/09/15 09:30:55 tholo Exp $";
#endif /* LIBC_SCCS and not lint */
#include <sys/param.h>
@@ -59,15 +59,15 @@ confstr(name, buf, len)
mib[0] = CTL_USER;
mib[1] = USER_CS_PATH;
if (sysctl(mib, 2, NULL, &tlen, NULL, 0) == -1)
- return (-1);
+ return ((size_t) -1);
if (len != 0 && buf != NULL) {
if ((p = malloc(tlen)) == NULL)
- return (-1);
+ return ((size_t) -1);
if (sysctl(mib, 2, p, &tlen, NULL, 0) == -1) {
sverrno = errno;
free(p);
errno = sverrno;
- return (-1);
+ return ((size_t) -1);
}
/*
* POSIX 1003.2 requires partial return of
diff --git a/lib/libc/gen/ctype_.c b/lib/libc/gen/ctype_.c
index 99de11571ae..c3fd0372ab8 100644
--- a/lib/libc/gen/ctype_.c
+++ b/lib/libc/gen/ctype_.c
@@ -37,7 +37,7 @@
*/
#if defined(LIBC_SCCS) && !defined(lint)
-static char rcsid[] = "$OpenBSD: ctype_.c,v 1.2 1996/08/19 08:22:08 tholo Exp $";
+static char rcsid[] = "$OpenBSD: ctype_.c,v 1.3 1996/09/15 09:30:56 tholo Exp $";
#endif /* LIBC_SCCS and not lint */
#include <ctype.h>
@@ -48,7 +48,7 @@ const char _C_ctype_[1 + 256] = {
_C, _C|_S, _C|_S, _C|_S, _C|_S, _C|_S, _C, _C,
_C, _C, _C, _C, _C, _C, _C, _C,
_C, _C, _C, _C, _C, _C, _C, _C,
- _S|_B, _P, _P, _P, _P, _P, _P, _P,
+ _S|(char)_B, _P, _P, _P, _P, _P, _P, _P,
_P, _P, _P, _P, _P, _P, _P, _P,
_N, _N, _N, _N, _N, _N, _N, _N,
_N, _N, _P, _P, _P, _P, _P, _P,
diff --git a/lib/libc/gen/disklabel.c b/lib/libc/gen/disklabel.c
index 1bd3c6b3be4..8b81c83f10a 100644
--- a/lib/libc/gen/disklabel.c
+++ b/lib/libc/gen/disklabel.c
@@ -32,7 +32,7 @@
*/
#if defined(LIBC_SCCS) && !defined(lint)
-static char rcsid[] = "$OpenBSD: disklabel.c,v 1.2 1996/08/19 08:22:24 tholo Exp $";
+static char rcsid[] = "$OpenBSD: disklabel.c,v 1.3 1996/09/15 09:30:58 tholo Exp $";
#endif /* LIBC_SCCS and not lint */
#include <sys/param.h>
@@ -48,7 +48,6 @@ static char rcsid[] = "$OpenBSD: disklabel.c,v 1.2 1996/08/19 08:22:24 tholo Exp
#include <string.h>
#include <unistd.h>
-static void error __P((int));
static int gettype __P((char *, char **));
struct disklabel *
@@ -173,17 +172,3 @@ gettype(t, names)
return (atoi(t));
return (0);
}
-
-static void
-error(err)
- int err;
-{
- char *p;
-
- (void)write(STDERR_FILENO, "disktab: ", 9);
- (void)write(STDERR_FILENO, _PATH_DISKTAB, sizeof(_PATH_DISKTAB) - 1);
- (void)write(STDERR_FILENO, ": ", 2);
- p = strerror(err);
- (void)write(STDERR_FILENO, p, strlen(p));
- (void)write(STDERR_FILENO, "\n", 1);
-}
diff --git a/lib/libc/gen/errlist.c b/lib/libc/gen/errlist.c
index 12f2b4e82f3..64e598425ad 100644
--- a/lib/libc/gen/errlist.c
+++ b/lib/libc/gen/errlist.c
@@ -32,10 +32,15 @@
*/
#if defined(LIBC_SCCS) && !defined(lint)
-static char *rcsid = "$OpenBSD: errlist.c,v 1.2 1996/08/19 08:22:32 tholo Exp $";
+static char *rcsid = "$OpenBSD: errlist.c,v 1.3 1996/09/15 09:30:59 tholo Exp $";
#endif /* LIBC_SCCS and not lint */
-const char *const _sys_errlist[] = {
+#ifdef lint
+char *
+#else
+const char *const
+#endif
+ _sys_errlist[] = {
"Undefined error: 0", /* 0 - ENOERROR */
"Operation not permitted", /* 1 - EPERM */
"No such file or directory", /* 2 - ENOENT */
diff --git a/lib/libc/gen/getcap.c b/lib/libc/gen/getcap.c
index 42c71917d70..332af9697ec 100644
--- a/lib/libc/gen/getcap.c
+++ b/lib/libc/gen/getcap.c
@@ -35,7 +35,7 @@
*/
#if defined(LIBC_SCCS) && !defined(lint)
-static char rcsid[] = "$OpenBSD: getcap.c,v 1.2 1996/08/19 08:23:10 tholo Exp $";
+static char rcsid[] = "$OpenBSD: getcap.c,v 1.3 1996/09/15 09:31:00 tholo Exp $";
#endif /* LIBC_SCCS and not lint */
#include <sys/types.h>
@@ -192,7 +192,6 @@ getent(cap, len, db_array, fd, name, depth, nfield)
int fd, depth;
{
DB *capdbp;
- DBT key, data;
register char *r_end, *rp, **db_p;
int myfd, eof, foundit, retval, clen;
char *record, *cbuf;
@@ -539,8 +538,6 @@ cdbget(capdbp, bp, name)
char **bp, *name;
{
DBT key, data;
- char *buf;
- int st;
key.data = name;
key.size = strlen(name);
@@ -648,7 +645,7 @@ cgetnext(bp, db_array)
char **db_array;
{
size_t len;
- int status, i, done;
+ int status, done;
char *cp, *line, *rp, *np, buf[BSIZE], nbuf[BSIZE];
u_int dummy;
@@ -705,7 +702,6 @@ cgetnext(bp, db_array)
/*
* Line points to a name line.
*/
- i = 0;
done = 0;
np = nbuf;
for (;;) {
diff --git a/lib/libc/gen/getgrouplist.c b/lib/libc/gen/getgrouplist.c
index cfcdba77be4..ae44c99cfe1 100644
--- a/lib/libc/gen/getgrouplist.c
+++ b/lib/libc/gen/getgrouplist.c
@@ -32,7 +32,7 @@
*/
#if defined(LIBC_SCCS) && !defined(lint)
-static char rcsid[] = "$OpenBSD: getgrouplist.c,v 1.3 1996/08/19 08:23:32 tholo Exp $";
+static char rcsid[] = "$OpenBSD: getgrouplist.c,v 1.4 1996/09/15 09:31:01 tholo Exp $";
#endif /* LIBC_SCCS and not lint */
/*
@@ -50,7 +50,6 @@ getgrouplist(uname, agroup, groups, grpcnt)
int *grpcnt;
{
register struct group *grp;
- register struct passwd *pw;
register int i, ngroups;
int ret, maxgroups;
diff --git a/lib/libc/gen/getpwent.c b/lib/libc/gen/getpwent.c
index 4c4ca6b763c..dc7d07cc809 100644
--- a/lib/libc/gen/getpwent.c
+++ b/lib/libc/gen/getpwent.c
@@ -33,7 +33,7 @@
*/
#if defined(LIBC_SCCS) && !defined(lint)
-static char rcsid[] = "$OpenBSD: getpwent.c,v 1.3 1996/08/19 08:24:02 tholo Exp $";
+static char rcsid[] = "$OpenBSD: getpwent.c,v 1.4 1996/09/15 09:31:02 tholo Exp $";
#endif /* LIBC_SCCS and not lint */
#include <sys/param.h>
@@ -258,7 +258,6 @@ getpwent()
DBT key;
char bf[sizeof(_pw_keynum) + 1];
#ifdef YP
- char *cp;
static char *name = (char *)NULL;
const char *user, *host, *dom;
int has_yppw;
@@ -594,8 +593,6 @@ pwnam_netgrp:
break;
}
break;
-
- continue;
}
if(strcmp(_pw_passwd.pw_name, name) == 0) {
if (!_pw_stayopen) {
@@ -781,8 +778,6 @@ pwuid_netgrp:
break;
}
break;
-
- continue;
}
if( _pw_passwd.pw_uid == uid) {
if (!_pw_stayopen) {
diff --git a/lib/libc/gen/getttyent.c b/lib/libc/gen/getttyent.c
index 014bdfbaf74..1ec45a1e52f 100644
--- a/lib/libc/gen/getttyent.c
+++ b/lib/libc/gen/getttyent.c
@@ -32,7 +32,7 @@
*/
#if defined(LIBC_SCCS) && !defined(lint)
-static char rcsid[] = "$OpenBSD: getttyent.c,v 1.2 1996/08/19 08:24:10 tholo Exp $";
+static char rcsid[] = "$OpenBSD: getttyent.c,v 1.3 1996/09/15 09:31:03 tholo Exp $";
#endif /* LIBC_SCCS and not lint */
#include <ttyent.h>
@@ -43,6 +43,9 @@ static char rcsid[] = "$OpenBSD: getttyent.c,v 1.2 1996/08/19 08:24:10 tholo Exp
static char zapchar;
static FILE *tf;
+static char *skip __P((char *));
+static char *value __P((char *));
+
struct ttyent *
getttynam(tty)
const char *tty;
@@ -65,7 +68,6 @@ getttyent()
register char *p;
#define MAXLINELENGTH 200
static char line[MAXLINELENGTH];
- static char *skip(), *value();
if (!tf && !setttyent())
return (NULL);
diff --git a/lib/libc/gen/nlist.c b/lib/libc/gen/nlist.c
index 453cb048689..1c1ac0014c5 100644
--- a/lib/libc/gen/nlist.c
+++ b/lib/libc/gen/nlist.c
@@ -32,7 +32,7 @@
*/
#if defined(LIBC_SCCS) && !defined(lint)
-static char rcsid[] = "$OpenBSD: nlist.c,v 1.14 1996/08/19 08:25:09 tholo Exp $";
+static char rcsid[] = "$OpenBSD: nlist.c,v 1.15 1996/09/15 09:31:04 tholo Exp $";
#endif /* LIBC_SCCS and not lint */
#include <sys/types.h>
@@ -314,7 +314,7 @@ __elf_fdnlist(fd, list)
/* mmap section header table */
shdr = (Elf32_Shdr *)mmap(NULL, (size_t)shdr_size,
- PROT_READ, 0, fd, ehdr.e_shoff);
+ PROT_READ, 0, fd, (off_t) ehdr.e_shoff);
if (shdr == (Elf32_Shdr *)-1)
return (-1);
@@ -349,7 +349,7 @@ __elf_fdnlist(fd, list)
* making the memory allocation permanent as with malloc/free
* (i.e., munmap will return it to the system).
*/
- strtab = mmap(NULL, (size_t)symstrsize, PROT_READ, 0, fd, symstroff);
+ strtab = mmap(NULL, (size_t)symstrsize, PROT_READ, 0, fd, (off_t) symstroff);
if (strtab == (char *)-1)
return (-1);
/*
@@ -376,7 +376,7 @@ __elf_fdnlist(fd, list)
if (symoff == 0)
goto done;
- if (lseek(fd, symoff, SEEK_SET) == -1) {
+ if (lseek(fd, (off_t) symoff, SEEK_SET) == -1) {
nent = -1;
goto done;
}
@@ -473,7 +473,6 @@ nlist(name, list)
struct nlist *list;
{
int fd, n;
- int i;
fd = open(name, O_RDONLY, 0);
if (fd < 0)
diff --git a/lib/libc/gen/sleep.c b/lib/libc/gen/sleep.c
index 8ed5f37d6de..cf389ee10c8 100644
--- a/lib/libc/gen/sleep.c
+++ b/lib/libc/gen/sleep.c
@@ -32,13 +32,14 @@
*/
#if defined(LIBC_SCCS) && !defined(lint)
-static char rcsid[] = "$OpenBSD: sleep.c,v 1.4 1996/08/19 08:26:20 tholo Exp $";
+static char rcsid[] = "$OpenBSD: sleep.c,v 1.5 1996/09/15 09:31:05 tholo Exp $";
#endif /* LIBC_SCCS and not lint */
#include <sys/time.h>
#include <signal.h>
#include <unistd.h>
+static void sleephandler __P((int));
static volatile int ringring;
unsigned int
@@ -49,7 +50,6 @@ sleep(seconds)
struct sigaction act, oact;
struct timeval diff;
sigset_t set, oset;
- static void sleephandler();
if (!seconds)
return 0;
@@ -119,8 +119,10 @@ sleep(seconds)
return (itv.it_value.tv_sec);
}
+/* ARGSUSED */
static void
-sleephandler()
+sleephandler(sig)
+ int sig;
{
ringring = 1;
}
diff --git a/lib/libc/gen/sysconf.c b/lib/libc/gen/sysconf.c
index 3f14c9a7769..49bd847aeff 100644
--- a/lib/libc/gen/sysconf.c
+++ b/lib/libc/gen/sysconf.c
@@ -35,7 +35,7 @@
*/
#if defined(LIBC_SCCS) && !defined(lint)
-static char rcsid[] = "$OpenBSD: sysconf.c,v 1.2 1996/08/19 08:26:24 tholo Exp $";
+static char rcsid[] = "$OpenBSD: sysconf.c,v 1.3 1996/09/15 09:31:06 tholo Exp $";
#endif /* LIBC_SCCS and not lint */
#include <sys/param.h>
@@ -62,7 +62,6 @@ long
sysconf(name)
int name;
{
- struct clockinfo clk;
struct rlimit rl;
size_t len;
int mib[2], value;
diff --git a/lib/libc/gen/ttyname.c b/lib/libc/gen/ttyname.c
index 7fe01255296..1d01f7b6294 100644
--- a/lib/libc/gen/ttyname.c
+++ b/lib/libc/gen/ttyname.c
@@ -32,7 +32,7 @@
*/
#if defined(LIBC_SCCS) && !defined(lint)
-static char rcsid[] = "$OpenBSD: ttyname.c,v 1.2 1996/08/19 08:27:02 tholo Exp $";
+static char rcsid[] = "$OpenBSD: ttyname.c,v 1.3 1996/09/15 09:31:07 tholo Exp $";
#endif /* LIBC_SCCS and not lint */
#include <sys/types.h>
@@ -85,6 +85,7 @@ ttyname(fd)
return (oldttyname(fd, &sb));
}
+/* ARGSUSED */
static char *
oldttyname(fd, sb)
int fd;
diff --git a/lib/libc/gen/ualarm.c b/lib/libc/gen/ualarm.c
index 28939019ed3..02f760d4db9 100644
--- a/lib/libc/gen/ualarm.c
+++ b/lib/libc/gen/ualarm.c
@@ -32,7 +32,7 @@
*/
#if defined(LIBC_SCCS) && !defined(lint)
-static char rcsid[] = "$OpenBSD: ualarm.c,v 1.2 1996/08/19 08:27:08 tholo Exp $";
+static char rcsid[] = "$OpenBSD: ualarm.c,v 1.3 1996/09/15 09:31:08 tholo Exp $";
#endif /* LIBC_SCCS and not lint */
#include <sys/time.h>
@@ -45,7 +45,7 @@ static char rcsid[] = "$OpenBSD: ualarm.c,v 1.2 1996/08/19 08:27:08 tholo Exp $"
* If ``reload'' is non-zero, keep generating SIGALRM
* every ``reload'' microseconds after the first signal.
*/
-unsigned
+u_int
ualarm(usecs, reload)
register unsigned usecs;
register unsigned reload;
@@ -61,5 +61,5 @@ ualarm(usecs, reload)
if (setitimer(ITIMER_REAL, &new, &old) == 0)
return (old.it_value.tv_sec * USPS + old.it_value.tv_usec);
/* else */
- return (-1);
+ return ((u_int)-1);
}
diff --git a/lib/libc/gen/uname.c b/lib/libc/gen/uname.c
index ef58fcad34a..3111805e82f 100644
--- a/lib/libc/gen/uname.c
+++ b/lib/libc/gen/uname.c
@@ -32,7 +32,7 @@
*/
#if defined(LIBC_SCCS) && !defined(lint)
-static char rcsid[] = "$OpenBSD: uname.c,v 1.4 1996/08/19 08:27:12 tholo Exp $";
+static char rcsid[] = "$OpenBSD: uname.c,v 1.5 1996/09/15 09:31:09 tholo Exp $";
#endif /* LIBC_SCCS and not lint */
#include <sys/param.h>
@@ -45,7 +45,6 @@ uname(name)
{
int mib[2], rval;
size_t len;
- char *p;
rval = 0;
diff --git a/lib/libc/gen/unvis.c b/lib/libc/gen/unvis.c
index dd74922b36b..e6eabd334e0 100644
--- a/lib/libc/gen/unvis.c
+++ b/lib/libc/gen/unvis.c
@@ -32,7 +32,7 @@
*/
#if defined(LIBC_SCCS) && !defined(lint)
-static char rcsid[] = "$OpenBSD: unvis.c,v 1.3 1996/08/19 08:27:16 tholo Exp $";
+static char rcsid[] = "$OpenBSD: unvis.c,v 1.4 1996/09/15 09:31:10 tholo Exp $";
#endif /* LIBC_SCCS and not lint */
#include <sys/types.h>
@@ -97,7 +97,7 @@ unvis(cp, c, astate, flag)
*astate = S_OCTAL2;
return (0);
case 'M':
- *cp = 0200;
+ *cp = (char) 0200;
*astate = S_META;
return (0);
case '^':
diff --git a/lib/libc/gen/usleep.c b/lib/libc/gen/usleep.c
index 9746f2cfb73..6aedc44de26 100644
--- a/lib/libc/gen/usleep.c
+++ b/lib/libc/gen/usleep.c
@@ -32,7 +32,7 @@
*/
#if defined(LIBC_SCCS) && !defined(lint)
-static char rcsid[] = "$OpenBSD: usleep.c,v 1.3 1996/08/19 08:27:19 tholo Exp $";
+static char rcsid[] = "$OpenBSD: usleep.c,v 1.4 1996/09/15 09:31:11 tholo Exp $";
#endif /* LIBC_SCCS and not lint */
#include <sys/time.h>
@@ -41,6 +41,7 @@ static char rcsid[] = "$OpenBSD: usleep.c,v 1.3 1996/08/19 08:27:19 tholo Exp $"
#define TICK 10000 /* system clock resolution in microseconds */
+static void sleephandler __P((int));
static volatile int ringring;
void
@@ -50,7 +51,6 @@ usleep(useconds)
struct itimerval itv, oitv;
struct sigaction act, oact;
sigset_t set, oset;
- static void sleephandler();
if (!useconds)
return;
@@ -108,8 +108,10 @@ usleep(useconds)
(void) setitimer(ITIMER_REAL, &oitv, NULL);
}
+/* ARGSUSED */
static void
-sleephandler()
+sleephandler(sig)
+ int sig;
{
ringring = 1;
}