1
0
mirror of https://git.FreeBSD.org/src.git synced 2025-01-25 16:13:17 +00:00

ANSIfy and constify.

Sponsored by:	DARPA, NAI Labs
This commit is contained in:
Dag-Erling Smørgrav 2002-02-05 06:49:11 +00:00
parent 576da32600
commit 93deb2ae12
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=90233
5 changed files with 46 additions and 50 deletions

View File

@ -66,12 +66,14 @@ static const char rcsid[] =
extern char *tempname;
static pid_t editpid = -1;
static int lockfd;
char *mppath = _PATH_PWD;
char *masterpasswd = _PATH_MASTERPASSWD;
static char _default_editor[] = _PATH_VI;
char mppath[] = _PATH_PWD;
char masterpasswd[] = _PATH_MASTERPASSWD;
void pw_cont(int);
void
pw_cont(sig)
int sig;
pw_cont(int sig)
{
if (editpid != -1)
@ -79,7 +81,7 @@ pw_cont(sig)
}
void
pw_init()
pw_init(void)
{
struct rlimit rlim;
@ -109,7 +111,7 @@ pw_init()
}
int
pw_lock()
pw_lock(void)
{
/*
* If the master password file doesn't exist, the system is hosed.
@ -142,7 +144,7 @@ pw_lock()
}
int
pw_tmp()
pw_tmp(void)
{
static char path[MAXPATHLEN];
int fd;
@ -163,8 +165,7 @@ pw_tmp()
}
int
pw_mkdb(username)
char *username;
pw_mkdb(const char *username)
{
int pstat;
pid_t pid;
@ -190,14 +191,13 @@ char *username;
}
void
pw_edit(notsetuid)
int notsetuid;
pw_edit(int notsetuid)
{
int pstat;
char *p, *editor;
if (!(editor = getenv("EDITOR")))
editor = _PATH_VI;
editor = _default_editor;
if ((p = strrchr(editor, '/')))
++p;
else
@ -228,7 +228,7 @@ pw_edit(notsetuid)
}
void
pw_prompt()
pw_prompt(void)
{
int c, first;
@ -242,14 +242,12 @@ pw_prompt()
}
void
pw_error(name, err, eval)
char *name;
int err, eval;
pw_error(const char *name, int error, int eval)
{
#ifdef YP
extern int _use_yp;
#endif /* YP */
if (err) {
if (error) {
if (name != NULL)
warn("%s", name);
else

View File

@ -4,5 +4,6 @@
PROG= vipw
MAN= vipw.8
SRCS= pw_util.c vipw.c
WARNS?= 4
.include <bsd.prog.mk>

View File

@ -66,12 +66,14 @@ static const char rcsid[] =
extern char *tempname;
static pid_t editpid = -1;
static int lockfd;
char *mppath = _PATH_PWD;
char *masterpasswd = _PATH_MASTERPASSWD;
static char _default_editor[] = _PATH_VI;
char mppath[] = _PATH_PWD;
char masterpasswd[] = _PATH_MASTERPASSWD;
void pw_cont(int);
void
pw_cont(sig)
int sig;
pw_cont(int sig)
{
if (editpid != -1)
@ -79,7 +81,7 @@ pw_cont(sig)
}
void
pw_init()
pw_init(void)
{
struct rlimit rlim;
@ -109,7 +111,7 @@ pw_init()
}
int
pw_lock()
pw_lock(void)
{
/*
* If the master password file doesn't exist, the system is hosed.
@ -142,7 +144,7 @@ pw_lock()
}
int
pw_tmp()
pw_tmp(void)
{
static char path[MAXPATHLEN];
int fd;
@ -163,8 +165,7 @@ pw_tmp()
}
int
pw_mkdb(username)
char *username;
pw_mkdb(const char *username)
{
int pstat;
pid_t pid;
@ -190,14 +191,13 @@ char *username;
}
void
pw_edit(notsetuid)
int notsetuid;
pw_edit(int notsetuid)
{
int pstat;
char *p, *editor;
if (!(editor = getenv("EDITOR")))
editor = _PATH_VI;
editor = _default_editor;
if ((p = strrchr(editor, '/')))
++p;
else
@ -228,7 +228,7 @@ pw_edit(notsetuid)
}
void
pw_prompt()
pw_prompt(void)
{
int c, first;
@ -242,14 +242,12 @@ pw_prompt()
}
void
pw_error(name, err, eval)
char *name;
int err, eval;
pw_error(const char *name, int error, int eval)
{
#ifdef YP
extern int _use_yp;
#endif /* YP */
if (err) {
if (error) {
if (name != NULL)
warn("%s", name);
else

View File

@ -31,12 +31,14 @@
* SUCH DAMAGE.
*
* @(#)pw_util.h 8.2 (Berkeley) 4/1/94
*
* $FreeBSD$
*/
void pw_edit __P((int));
void pw_error __P((char *, int, int));
void pw_init __P((void));
int pw_lock __P((void));
int pw_mkdb __P((char *));
void pw_prompt __P((void));
int pw_tmp __P((void));
void pw_edit(int);
void pw_error(const char *, int, int);
void pw_init(void);
int pw_lock(void);
int pw_mkdb(const char *);
void pw_prompt(void);
int pw_tmp(void);

View File

@ -61,13 +61,11 @@ extern char *mppath;
extern char *masterpasswd;
char *tempname;
void copyfile __P((int, int));
static void usage __P((void));
static void copyfile(int, int);
static void usage(void);
int
main(argc, argv)
int argc;
char *argv[];
main(int argc, char *argv[])
{
int pfd, tfd;
struct stat begin, end;
@ -125,9 +123,8 @@ main(argc, argv)
exit(0);
}
void
copyfile(from, to)
int from, to;
static void
copyfile(int from, int to)
{
int nr, nw, off;
char buf[8*1024];
@ -141,7 +138,7 @@ copyfile(from, to)
}
static void
usage()
usage(void)
{
(void)fprintf(stderr, "usage: vipw [ -d directory ]\n");