Minor cleanup, mostly unused vars and missing #includes.
This commit is contained in:
parent
24249ac14f
commit
8b10240709
@ -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)
|
||||
|
@ -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;
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -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;
|
||||
{
|
||||
|
@ -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);
|
||||
|
@ -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
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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>
|
||||
|
@ -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];
|
||||
|
||||
/*
|
||||
|
@ -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)
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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>
|
||||
|
||||
|
@ -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>
|
||||
|
@ -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;
|
||||
{
|
||||
|
@ -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) \
|
||||
|
@ -62,7 +62,6 @@ long
|
||||
sysconf(name)
|
||||
int name;
|
||||
{
|
||||
struct clockinfo clk;
|
||||
struct rlimit rl;
|
||||
size_t len;
|
||||
int mib[2], value;
|
||||
|
@ -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)
|
||||
|
@ -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];
|
||||
|
@ -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 */
|
||||
|
Loading…
x
Reference in New Issue
Block a user