summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--usr.sbin/amd/amd/afs_ops.c8
-rw-r--r--usr.sbin/amd/amd/amd.c14
-rw-r--r--usr.sbin/amd/amd/nfs_ops.c6
-rw-r--r--usr.sbin/amd/amd/nfs_start.c4
-rw-r--r--usr.sbin/amd/amd/sched.c16
-rw-r--r--usr.sbin/amd/amd/util.c14
-rw-r--r--usr.sbin/amd/amd/xutil.c8
-rw-r--r--usr.sbin/amd/include/am.h6
-rw-r--r--usr.sbin/amd/include/config.h4
9 files changed, 41 insertions, 39 deletions
diff --git a/usr.sbin/amd/amd/afs_ops.c b/usr.sbin/amd/amd/afs_ops.c
index 894c1bfcff1..1d33b1b798b 100644
--- a/usr.sbin/amd/amd/afs_ops.c
+++ b/usr.sbin/amd/amd/afs_ops.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: afs_ops.c,v 1.3 2001/03/02 06:22:01 deraadt Exp $ */
+/* $OpenBSD: afs_ops.c,v 1.4 2002/05/26 02:49:50 deraadt Exp $ */
/*
* Copyright (c) 1990 Jan-Simon Pendry
@@ -176,9 +176,11 @@ char *opts;
#define SHORT_MOUNT_NAME
#endif /* HOSTNAMESZ */
#ifdef SHORT_MOUNT_NAME
- sprintf(fs_hostname, "amd:%d", foreground ? mypid : getppid());
+ sprintf(fs_hostname, "amd:%ld",
+ foreground ? (long)mypid : (long)getppid());
#else
- sprintf(fs_hostname, "pid%d@%s:%s", foreground ? mypid : getppid(), hostname, dir);
+ sprintf(fs_hostname, "pid%ld@%s:%s",
+ foreground ? (long)mypid : (long)getppid(), hostname, dir);
#endif /* SHORT_MOUNT_NAME */
nfs_args.hostname = fs_hostname;
nfs_args.flags |= NFSMNT_HOSTNAME;
diff --git a/usr.sbin/amd/amd/amd.c b/usr.sbin/amd/amd/amd.c
index 53b62d68749..9c4e49d054d 100644
--- a/usr.sbin/amd/amd/amd.c
+++ b/usr.sbin/amd/amd/amd.c
@@ -36,7 +36,7 @@
* SUCH DAMAGE.
*
* from: @(#)amd.c 8.1 (Berkeley) 6/6/93
- * $Id: amd.c,v 1.4 2002/05/25 07:37:19 deraadt Exp $
+ * $Id: amd.c,v 1.5 2002/05/26 02:49:50 deraadt Exp $
*/
#ifndef lint
@@ -76,7 +76,7 @@ char *arch = ARCH_REP; /* Name of current architecture */
char *endian = ARCH_ENDIAN; /* Big or Little endian */
char *wire;
int foreground = 1; /* This is the top-level server */
-int mypid; /* Current process id */
+pid_t mypid; /* Current process id */
int immediate_abort; /* Should close-down unmounts be retried */
struct in_addr myipaddr; /* (An) IP address of this host */
serv_state amd_state;
@@ -145,16 +145,16 @@ int sig;
exit(0);
}
-static int daemon_mode(P_void)
+static pid_t daemon_mode(P_void)
{
- int bgpid;
+ pid_t bgpid;
signal(SIGQUIT, parent_exit);
bgpid = background();
if (bgpid != 0) {
if (print_pid) {
- printf("%d\n", bgpid);
+ printf("%ld\n", (long)bgpid);
fflush(stdout);
}
/*
@@ -197,7 +197,7 @@ int argc;
char *argv[];
{
char *domdot;
- int ppid = 0;
+ pid_t ppid = 0;
int error;
/*
@@ -323,7 +323,7 @@ char *argv[];
#endif /* DEBUG */
ppid = daemon_mode();
- sprintf(pid_fsname, "%s:(pid%d)", hostname, mypid);
+ sprintf(pid_fsname, "%s:(pid%ld)", hostname, (long)mypid);
do_mapc_reload = clocktime() + ONE_HOUR;
diff --git a/usr.sbin/amd/amd/nfs_ops.c b/usr.sbin/amd/amd/nfs_ops.c
index 257526959ee..2d357dfb296 100644
--- a/usr.sbin/amd/amd/nfs_ops.c
+++ b/usr.sbin/amd/amd/nfs_ops.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: nfs_ops.c,v 1.9 2002/02/13 22:32:33 deraadt Exp $ */
+/* $OpenBSD: nfs_ops.c,v 1.10 2002/05/26 02:49:50 deraadt Exp $ */
/*-
* Copyright (c) 1990 Jan-Simon Pendry
@@ -40,7 +40,7 @@
#ifndef lint
/*static char sccsid[] = "from: @(#)nfs_ops.c 8.1 (Berkeley) 6/6/93";*/
-static char *rcsid = "$OpenBSD: nfs_ops.c,v 1.9 2002/02/13 22:32:33 deraadt Exp $";
+static char *rcsid = "$OpenBSD: nfs_ops.c,v 1.10 2002/05/26 02:49:50 deraadt Exp $";
#endif /* not lint */
#include "am.h"
@@ -811,7 +811,7 @@ am_node *mp;
if (mp->am_parent && mp->am_parent->am_path &&
STREQ(mp->am_parent->am_mnt->mf_ops->fs_type, "direct")) {
struct stat stb;
- int pid;
+ pid_t pid;
if ((pid = background()) == 0) {
if (lstat(mp->am_parent->am_path, &stb) < 0) {
plog(XLOG_ERROR, "lstat(%s) after unmount: %m", mp->am_parent->am_path);
diff --git a/usr.sbin/amd/amd/nfs_start.c b/usr.sbin/amd/amd/nfs_start.c
index 24198b0ba52..9f0bb1b2f33 100644
--- a/usr.sbin/amd/amd/nfs_start.c
+++ b/usr.sbin/amd/amd/nfs_start.c
@@ -36,7 +36,7 @@
* SUCH DAMAGE.
*
* from: @(#)nfs_start.c 8.1 (Berkeley) 6/6/93
- * $Id: nfs_start.c,v 1.6 2001/09/05 23:24:21 millert Exp $
+ * $Id: nfs_start.c,v 1.7 2002/05/26 02:49:50 deraadt Exp $
*/
#include "am.h"
@@ -382,7 +382,7 @@ void unregister_amq(P_void)
}
int mount_automounter(ppid)
-int ppid;
+pid_t ppid;
{
int so = socket(AF_INET, SOCK_DGRAM, 0);
SVCXPRT *amqp;
diff --git a/usr.sbin/amd/amd/sched.c b/usr.sbin/amd/amd/sched.c
index 64328aa6a7d..541d5ea3b84 100644
--- a/usr.sbin/amd/amd/sched.c
+++ b/usr.sbin/amd/amd/sched.c
@@ -36,7 +36,7 @@
* SUCH DAMAGE.
*
* from: @(#)sched.c 8.1 (Berkeley) 6/6/93
- * $Id: sched.c,v 1.4 2001/09/04 23:35:59 millert Exp $
+ * $Id: sched.c,v 1.5 2002/05/26 02:49:50 deraadt Exp $
*/
/*
@@ -53,7 +53,7 @@ extern int select_intr_valid;
typedef struct pjob pjob;
struct pjob {
qelem hdr; /* Linked list */
- int pid; /* Process ID of job */
+ pid_t pid; /* Process ID of job */
cb_fun cb_fun; /* Callback function */
voidp cb_closure; /* Closure for callback */
union wait w; /* Status filled in by sigchld */
@@ -205,7 +205,7 @@ int sig;
{
union wait w;
int save_errno = errno;
- int pid;
+ pid_t pid;
#ifdef SYS5_SIGNALS
if ((pid = wait(&w)) > 0) {
@@ -215,12 +215,12 @@ int sig;
pjob *p, *p2;
if (WIFSIGNALED(w))
- plog(XLOG_ERROR, "Process %d exited with signal %d",
- pid, w.w_termsig);
+ plog(XLOG_ERROR, "Process %d exited with signal %ld",
+ (long)pid, w.w_termsig);
#ifdef DEBUG
else
- dlog("Process %d exited with status %d",
- pid, w.w_retcode);
+ dlog("Process %d exited with status %ld",
+ (long)pid, w.w_retcode);
#endif /* DEBUG */
for (p = FIRST(pjob, &proc_wait_list);
@@ -234,7 +234,7 @@ int sig;
}
#ifdef DEBUG
- if (p) ; else dlog("can't locate task block for pid %d", pid);
+ if (p) ; else dlog("can't locate task block for pid %ld", (long)pid);
#endif /* DEBUG */
}
diff --git a/usr.sbin/amd/amd/util.c b/usr.sbin/amd/amd/util.c
index 6d97f228b6d..48946e61e94 100644
--- a/usr.sbin/amd/amd/util.c
+++ b/usr.sbin/amd/amd/util.c
@@ -36,7 +36,7 @@
* SUCH DAMAGE.
*
* from: @(#)util.c 8.1 (Berkeley) 6/6/93
- * $Id: util.c,v 1.4 2001/03/02 06:22:05 deraadt Exp $
+ * $Id: util.c,v 1.5 2002/05/26 02:49:50 deraadt Exp $
*/
/*
@@ -495,10 +495,10 @@ am_node *mp;
*
* TODO: Need a better strategy for handling errors
*/
-static int dofork(P_void);
-static int dofork()
+static pid_t dofork(P_void);
+static pid_t dofork()
{
- int pid;
+ pid_t pid;
top:
pid = fork();
@@ -515,10 +515,10 @@ top:
return pid;
}
-int background(P_void);
-int background()
+pid_t background(P_void);
+pid_t background()
{
- int pid = dofork();
+ pid_t pid = dofork();
if (pid == 0) {
#ifdef DEBUG
dlog("backgrounded");
diff --git a/usr.sbin/amd/amd/xutil.c b/usr.sbin/amd/amd/xutil.c
index f5e6c1dec99..445bc20879d 100644
--- a/usr.sbin/amd/amd/xutil.c
+++ b/usr.sbin/amd/amd/xutil.c
@@ -36,7 +36,7 @@
* SUCH DAMAGE.
*
* from: @(#)xutil.c 8.1 (Berkeley) 6/6/93
- * $Id: xutil.c,v 1.5 2002/05/25 07:37:19 deraadt Exp $
+ * $Id: xutil.c,v 1.6 2002/05/26 02:49:50 deraadt Exp $
*/
#include "config.h"
@@ -158,7 +158,7 @@ extern struct mallinfo __mallinfo;
if (orig_mem_bytes == 0)
mem_bytes = orig_mem_bytes = __mallinfo.uordbytes;
else {
- fprintf(logfp, "%s[%d]: ", __progname, mypid);
+ fprintf(logfp, "%s[%ld]: ", __progname, (long)mypid);
if (mem_bytes < __mallinfo.uordbytes) {
fprintf(logfp, "ALLOC: %d bytes",
__mallinfo.uordbytes - mem_bytes);
@@ -249,14 +249,14 @@ extern char **gargv;
case XLOG_STATS: sev = "stats:"; break;
default: sev = "hmm: "; break;
}
- fprintf(logfp, "%15.15s %s %s[%d]/%s ",
+ fprintf(logfp, "%15.15s %s %s[%ld]/%s ",
last_ctime+4, hostname,
#if defined(DEBUG) && defined(PARANOID)
gargv[0],
#else
__progname,
#endif /* defined(DEBUG) && defined(PARANOID) */
- mypid,
+ (long)mypid,
sev);
}
diff --git a/usr.sbin/amd/include/am.h b/usr.sbin/amd/include/am.h
index 48ed7bfa256..56952692865 100644
--- a/usr.sbin/amd/include/am.h
+++ b/usr.sbin/amd/include/am.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: am.h,v 1.3 1997/01/31 14:42:18 graichen Exp $ */
+/* $OpenBSD: am.h,v 1.4 2002/05/26 02:49:50 deraadt Exp $ */
/*
* Copyright (c) 1990 Jan-Simon Pendry
@@ -222,7 +222,7 @@ typedef struct mnt_map mnt_map;
extern int atoi P((Const char *)); /* C */
extern void am_mounted P((am_node*));
extern void am_unmounted P((am_node*));
-extern int background(P_void);
+extern pid_t background(P_void);
extern int bind_resv_port P((int, unsigned short*));
extern int compute_mount_flags P((struct mntent *));
extern int softclock(P_void);
@@ -279,7 +279,7 @@ extern int mkdirs P((char*, int));
extern void mk_fattr P((am_node*, int));
extern void mnt_free P((struct mntent*));
extern int mount_auto_node P((char*, voidp));
-extern int mount_automounter P((int));
+extern int mount_automounter P((pid_t));
extern int mount_exported(P_void);
extern int mount_fs P((struct mntent*, int, caddr_t, int, MTYPE_TYPE));
/*extern int mount_nfs_fh P((struct fhstatus*, char*, char*, char*, mntfs*));*/
diff --git a/usr.sbin/amd/include/config.h b/usr.sbin/amd/include/config.h
index e85ad924d49..94dae3c9147 100644
--- a/usr.sbin/amd/include/config.h
+++ b/usr.sbin/amd/include/config.h
@@ -36,7 +36,7 @@
* SUCH DAMAGE.
*
* from: @(#)config.h 8.1 (Berkeley) 6/6/93
- * $Id: config.h,v 1.1 1995/10/18 08:47:21 deraadt Exp $
+ * $Id: config.h,v 1.2 2002/05/26 02:49:50 deraadt Exp $
*/
/*
@@ -82,7 +82,7 @@ extern time_t clock_valid; /* Clock needs recalculating */
extern char *progname; /* "amd"|"mmd" */
extern char hostname[]; /* "kiska" */
-extern int mypid; /* Current process id */
+extern pid_t mypid; /* Current process id */
#ifdef HAS_SYSLOG
extern int syslogging; /* Really using syslog */