summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorphk <phk@FreeBSD.org>1995-10-22 14:37:11 +0000
committerphk <phk@FreeBSD.org>1995-10-22 14:37:11 +0000
commit5e221828f83731c9f6083e6ce9703c1251dba05a (patch)
tree021e4f00408640702c262fd5f8dc2c167a2c2c73
parent6a09eeb50d1e12bcfae0a9e782727c535dc609f5 (diff)
downloadFreeBSD-src-5e221828f83731c9f6083e6ce9703c1251dba05a.zip
FreeBSD-src-5e221828f83731c9f6083e6ce9703c1251dba05a.tar.gz
Minor cleanup, mostly unused vars and missing #includes.
-rw-r--r--lib/libc/gen/confstr.c1
-rw-r--r--lib/libc/gen/crypt.c19
-rw-r--r--lib/libc/gen/disklabel.c16
-rw-r--r--lib/libc/gen/fstab.c17
-rw-r--r--lib/libc/gen/getcap.c3
-rw-r--r--lib/libc/gen/getgrent.c6
-rw-r--r--lib/libc/gen/getgrouplist.c1
-rw-r--r--lib/libc/gen/getpass.c2
-rw-r--r--lib/libc/gen/getpwent.c2
-rw-r--r--lib/libc/gen/initgroups.c1
-rw-r--r--lib/libc/gen/nlist.c2
-rw-r--r--lib/libc/gen/psignal.c2
-rw-r--r--lib/libc/gen/pwcache.c1
-rw-r--r--lib/libc/gen/setmode.c6
-rw-r--r--lib/libc/gen/sleep.c2
-rw-r--r--lib/libc/gen/sysconf.c1
-rw-r--r--lib/libc/gen/sysctl.c1
-rw-r--r--lib/libc/gen/syslog.c4
-rw-r--r--lib/libc/gen/usleep.c2
19 files changed, 46 insertions, 43 deletions
diff --git a/lib/libc/gen/confstr.c b/lib/libc/gen/confstr.c
index cc4df53..0a7078e 100644
--- a/lib/libc/gen/confstr.c
+++ b/lib/libc/gen/confstr.c
@@ -42,6 +42,7 @@ static char sccsid[] = "@(#)confstr.c 8.1 (Berkeley) 6/4/93";
#include <paths.h>
#include <stdlib.h>
#include <unistd.h>
+#include <string.h>
size_t
confstr(name, buf, len)
diff --git a/lib/libc/gen/crypt.c b/lib/libc/gen/crypt.c
index 1ffb736..c1417b8 100644
--- a/lib/libc/gen/crypt.c
+++ b/lib/libc/gen/crypt.c
@@ -36,11 +36,12 @@
#if defined(LIBC_SCCS) && !defined(lint)
/* from static char sccsid[] = "@(#)crypt.c 5.11 (Berkeley) 6/25/91"; */
-static char rcsid[] = "$Header: /home/ncvs/src/lib/libc/gen/crypt.c,v 1.2 1994/08/22 20:38:00 csgr Exp $";
+static char rcsid[] = "$Header: /home/ncvs/src/lib/libc/gen/crypt.c,v 1.3 1995/05/30 05:40:10 rgrimes Exp $";
#endif /* LIBC_SCCS and not lint */
#include <unistd.h>
#include <stdio.h>
+#include <string.h>
/*
* UNIX password, and DES, encryption.
@@ -49,6 +50,10 @@ static char rcsid[] = "$Header: /home/ncvs/src/lib/libc/gen/crypt.c,v 1.2 1994/0
* encryption, make sure you've got libcrypt.a around.
*/
+__warn_references(des_setkey,
+ "WARNING! des_setkey(3) not present in the system!");
+
+int
des_setkey(key)
register const char *key;
{
@@ -56,6 +61,10 @@ des_setkey(key)
return (0);
}
+__warn_references(des_cipher,
+ "WARNING! des_cipher(3) not present in the system!");
+
+int
des_cipher(in, out, salt, num_iter)
const char *in;
char *out;
@@ -67,6 +76,10 @@ des_cipher(in, out, salt, num_iter)
return (0);
}
+__warn_references(setkey,
+ "WARNING! setkey(3) not present in the system!");
+
+int
setkey(key)
register const char *key;
{
@@ -74,6 +87,10 @@ setkey(key)
return (0);
}
+__warn_references(encrypt,
+ "WARNING! encrypt(3) not present in the system!");
+
+int
encrypt(block, flag)
register char *block;
int flag;
diff --git a/lib/libc/gen/disklabel.c b/lib/libc/gen/disklabel.c
index cc4c3df..883607b 100644
--- a/lib/libc/gen/disklabel.c
+++ b/lib/libc/gen/disklabel.c
@@ -46,8 +46,8 @@ static char sccsid[] = "@(#)disklabel.c 8.1 (Berkeley) 6/4/93";
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
+#include <ctype.h>
-static int error __P((int));
static int gettype __P((char *, char **));
struct disklabel *
@@ -167,17 +167,3 @@ gettype(t, names)
return (atoi(t));
return (0);
}
-
-static int
-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/fstab.c b/lib/libc/gen/fstab.c
index 47ad477..a526068 100644
--- a/lib/libc/gen/fstab.c
+++ b/lib/libc/gen/fstab.c
@@ -46,10 +46,10 @@ static FILE *_fs_fp;
static struct fstab _fs_fstab;
static int LineNo = 0;
-static error __P((int));
-static fstabscan __P((void));
+static void error __P((int));
+static int fstabscan __P((void));
-static
+static int
fstabscan()
{
char *cp, *p;
@@ -77,9 +77,9 @@ fstabscan()
_fs_fstab.fs_vfstype =
strcmp(_fs_fstab.fs_type, FSTAB_SW) ?
"ufs" : "swap";
- if (cp = strsep(&p, ":\n")) {
+ if ((cp = strsep(&p, ":\n")) != NULL) {
_fs_fstab.fs_freq = atoi(cp);
- if (cp = strsep(&p, ":\n")) {
+ if ((cp = strsep(&p, ":\n")) != NULL) {
_fs_fstab.fs_passno = atoi(cp);
return(1);
}
@@ -157,7 +157,7 @@ bad: /* no way to distinguish between EOF and syntax error */
struct fstab *
getfsent()
{
- if (!_fs_fp && !setfsent() || !fstabscan())
+ if ((!_fs_fp && !setfsent()) || !fstabscan())
return((struct fstab *)NULL);
return(&_fs_fstab);
}
@@ -184,6 +184,7 @@ getfsfile(name)
return((struct fstab *)NULL);
}
+int
setfsent()
{
if (_fs_fp) {
@@ -191,7 +192,7 @@ setfsent()
LineNo = 0;
return(1);
}
- if (_fs_fp = fopen(_PATH_FSTAB, "r")) {
+ if ((_fs_fp = fopen(_PATH_FSTAB, "r")) != NULL) {
LineNo = 0;
return(1);
}
@@ -208,7 +209,7 @@ endfsent()
}
}
-static
+static void
error(err)
int err;
{
diff --git a/lib/libc/gen/getcap.c b/lib/libc/gen/getcap.c
index 6bb4450..93d1952 100644
--- a/lib/libc/gen/getcap.c
+++ b/lib/libc/gen/getcap.c
@@ -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;
@@ -542,8 +541,6 @@ cdbget(capdbp, bp, name)
char **bp, *name;
{
DBT key, data;
- char *buf;
- int st;
key.data = name;
key.size = strlen(name);
diff --git a/lib/libc/gen/getgrent.c b/lib/libc/gen/getgrent.c
index 9ba9a71..6451dc9 100644
--- a/lib/libc/gen/getgrent.c
+++ b/lib/libc/gen/getgrent.c
@@ -163,7 +163,7 @@ start_gr()
char *line;
size_t linelen;
_gr_yp_enabled = 0;
- while(line = fgetln(_gr_fp, &linelen)) {
+ while((line = fgetln(_gr_fp, &linelen)) != NULL) {
if(line[0] == '+') {
if(line[1] && !_gr_yp_enabled) {
_gr_yp_enabled = 1;
@@ -301,6 +301,7 @@ grscan(search, gid, name)
return(1);
}
/* NOTREACHED */
+ return (0);
}
#ifdef YP
@@ -425,7 +426,8 @@ unpack:
strcpy(resultbuf, result);
free(result);
- if(result = strchr(resultbuf, '\n')) *result = '\0';
+ if((result = strchr(resultbuf, '\n')) != NULL)
+ *result = '\0';
if (_gr_breakout_yp(gr, resultbuf))
return(1);
else
diff --git a/lib/libc/gen/getgrouplist.c b/lib/libc/gen/getgrouplist.c
index 10c4df7..c65e1fa 100644
--- a/lib/libc/gen/getgrouplist.c
+++ b/lib/libc/gen/getgrouplist.c
@@ -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/getpass.c b/lib/libc/gen/getpass.c
index f6391a1..d1b3835 100644
--- a/lib/libc/gen/getpass.c
+++ b/lib/libc/gen/getpass.c
@@ -36,7 +36,7 @@ static char sccsid[] = "@(#)getpass.c 8.1 (Berkeley) 6/4/93";
#endif /* LIBC_SCCS and not lint */
#include <sys/termios.h>
-#include <sys/signal.h>
+#include <signal.h>
#include <paths.h>
#include <pwd.h>
diff --git a/lib/libc/gen/getpwent.c b/lib/libc/gen/getpwent.c
index 6dfd1ed..a3e32ad 100644
--- a/lib/libc/gen/getpwent.c
+++ b/lib/libc/gen/getpwent.c
@@ -547,7 +547,7 @@ char *user;
static int
_pw_breakout_yp(struct passwd *pw, char *res, int master)
{
- char *s, *c, *result;
+ char *s, *result;
static char resbuf[YPMAXRECORD+2];
/*
diff --git a/lib/libc/gen/initgroups.c b/lib/libc/gen/initgroups.c
index d427539..da64187 100644
--- a/lib/libc/gen/initgroups.c
+++ b/lib/libc/gen/initgroups.c
@@ -38,6 +38,7 @@ static char sccsid[] = "@(#)initgroups.c 8.1 (Berkeley) 6/4/93";
#include <sys/param.h>
#include <stdio.h>
+#include <err.h>
int
initgroups(uname, agroup)
diff --git a/lib/libc/gen/nlist.c b/lib/libc/gen/nlist.c
index 9993dca..cbece18 100644
--- a/lib/libc/gen/nlist.c
+++ b/lib/libc/gen/nlist.c
@@ -73,8 +73,6 @@ __fdnlist(fd, list)
register off_t stroff, symoff;
register u_long symsize;
register int nent;
- size_t strsize;
- struct nlist nbuf[1024];
struct exec * exec;
struct stat st;
diff --git a/lib/libc/gen/psignal.c b/lib/libc/gen/psignal.c
index 51491b4..b7e7ab6 100644
--- a/lib/libc/gen/psignal.c
+++ b/lib/libc/gen/psignal.c
@@ -39,7 +39,7 @@ static char sccsid[] = "@(#)psignal.c 8.1 (Berkeley) 6/4/93";
* Print the name of the signal indicated
* along with the supplied message.
*/
-#include <sys/signal.h>
+#include <signal.h>
#include <string.h>
#include <unistd.h>
diff --git a/lib/libc/gen/pwcache.c b/lib/libc/gen/pwcache.c
index 1dcbf5d..7c266c1 100644
--- a/lib/libc/gen/pwcache.c
+++ b/lib/libc/gen/pwcache.c
@@ -38,6 +38,7 @@ static char sccsid[] = "@(#)pwcache.c 8.1 (Berkeley) 6/4/93";
#include <sys/types.h>
#include <grp.h>
+#include <string.h>
#include <pwd.h>
#include <stdio.h>
#include <utmp.h>
diff --git a/lib/libc/gen/setmode.c b/lib/libc/gen/setmode.c
index 2190b4e..c69d775 100644
--- a/lib/libc/gen/setmode.c
+++ b/lib/libc/gen/setmode.c
@@ -67,7 +67,7 @@ typedef struct bitcmd {
#define CMD2_UBITS 0x10
static BITCMD *addcmd __P((BITCMD *, int, int, int, u_int));
-static int compress_mode __P((BITCMD *));
+static void compress_mode __P((BITCMD *));
#ifdef SETMODE_DEBUG
static void dumpmode __P((BITCMD *));
#endif
@@ -172,7 +172,7 @@ setmode(p)
BITCMD *set, *saveset, *endset;
sigset_t sigset, sigoset;
mode_t mask;
- int equalopdone, permXbits, setlen;
+ int equalopdone=0, permXbits, setlen;
if (!*p)
return (NULL);
@@ -402,7 +402,7 @@ dumpmode(set)
* 'g' and 'o' commands continue to be separate. They could probably be
* compacted, but it's not worth the effort.
*/
-static int
+static void
compress_mode(set)
register BITCMD *set;
{
diff --git a/lib/libc/gen/sleep.c b/lib/libc/gen/sleep.c
index 3c0b8fa..98d997d 100644
--- a/lib/libc/gen/sleep.c
+++ b/lib/libc/gen/sleep.c
@@ -36,7 +36,7 @@ static char sccsid[] = "@(#)sleep.c 8.1 (Berkeley) 6/4/93";
#endif /* LIBC_SCCS and not lint */
#include <sys/time.h>
-#include <sys/signal.h>
+#include <signal.h>
#include <unistd.h>
#define setvec(vec, a) \
diff --git a/lib/libc/gen/sysconf.c b/lib/libc/gen/sysconf.c
index 2994505..7df2f51 100644
--- a/lib/libc/gen/sysconf.c
+++ b/lib/libc/gen/sysconf.c
@@ -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/sysctl.c b/lib/libc/gen/sysctl.c
index f67a533..cb7448a 100644
--- a/lib/libc/gen/sysctl.c
+++ b/lib/libc/gen/sysctl.c
@@ -43,6 +43,7 @@ static char sccsid[] = "@(#)sysctl.c 8.2 (Berkeley) 1/4/94";
#include <paths.h>
#include <stdio.h>
#include <unistd.h>
+#include <string.h>
int
sysctl(name, namelen, oldp, oldlenp, newp, newlen)
diff --git a/lib/libc/gen/syslog.c b/lib/libc/gen/syslog.c
index 60c3333..1ef9a66 100644
--- a/lib/libc/gen/syslog.c
+++ b/lib/libc/gen/syslog.c
@@ -36,7 +36,7 @@
static char sccsid[] = "From: @(#)syslog.c 8.4 (Berkeley) 3/18/94";
*/
static const char rcsid[] =
- "$Id$";
+ "$Id: syslog.c,v 1.6 1995/10/21 07:05:01 peter Exp $";
#endif /* LIBC_SCCS and not lint */
#include <sys/types.h>
@@ -132,7 +132,7 @@ vsyslog(pri, fmt, ap)
va_list ap;
{
register int cnt;
- register char ch, *p, *t;
+ register char ch, *p;
time_t now;
int fd, saved_errno;
char *stdp, tbuf[2048], fmt_cpy[1024];
diff --git a/lib/libc/gen/usleep.c b/lib/libc/gen/usleep.c
index 9127bfc..3f4a7f5 100644
--- a/lib/libc/gen/usleep.c
+++ b/lib/libc/gen/usleep.c
@@ -36,7 +36,7 @@ static char sccsid[] = "@(#)usleep.c 8.1 (Berkeley) 6/4/93";
#endif /* LIBC_SCCS and not lint */
#include <sys/time.h>
-#include <sys/signal.h>
+#include <signal.h>
#include <unistd.h>
#define TICK 10000 /* system clock resolution in microseconds */
OpenPOWER on IntegriCloud