Mark some functions as static.
Don't declare vmd_reload() in vmd.h, do it in vmd.c.
Don't declare main() - we don't have to.
Don't declare vmd_control_run() - it doesn't exist.
Sort declarations by function name.
Index: vmd.c
===================================================================
RCS file: /cvs/src/usr.sbin/vmd/vmd.c,v
retrieving revision 1.25
diff -u -p -r1.25 vmd.c
--- vmd.c 11 Dec 2015 10:16:53 -0000 1.25
+++ vmd.c 1 Jan 2016 14:44:29 -0000
@@ -36,15 +36,14 @@
#include "proc.h"
#include "vmd.h"
-__dead void usage(void);
+static __dead void usage(void);
-int main(int, char **);
-int vmd_configure(void);
-void vmd_sighdlr(int sig, short event, void *arg);
-void vmd_shutdown(void);
-int vmd_control_run(void);
-int vmd_dispatch_control(int, struct privsep_proc *, struct imsg *);
-int vmd_dispatch_vmm(int, struct privsep_proc *, struct imsg *);
+static int vmd_configure(void);
+static int vmd_dispatch_control(int, struct privsep_proc *, struct imsg
*);
+static int vmd_dispatch_vmm(int, struct privsep_proc *, struct imsg *);
+static void vmd_reload(int, const char *);
+static void vmd_shutdown(void);
+static void vmd_sighdlr(int sig, short event, void *arg);
struct vmd *env;
@@ -53,7 +52,7 @@ static struct privsep_proc procs[] = {
{ "vmm", PROC_VMM, vmd_dispatch_vmm, vmm },
};
-int
+static int
vmd_dispatch_control(int fd, struct privsep_proc *p, struct imsg *imsg)
{
struct privsep *ps = p->p_ps;
@@ -132,7 +131,7 @@ vmd_dispatch_control(int fd, struct priv
return (0);
}
-int
+static int
vmd_dispatch_vmm(int fd, struct privsep_proc *p, struct imsg *imsg)
{
struct vmop_result vmr;
@@ -206,7 +205,7 @@ vmd_dispatch_vmm(int fd, struct privsep_
return (0);
}
-void
+static void
vmd_sighdlr(int sig, short event, void *arg)
{
struct privsep *ps = arg;
@@ -285,7 +284,7 @@ vmd_sighdlr(int sig, short event, void *
}
}
-__dead void
+static __dead void
usage(void)
{
extern char *__progname;
@@ -406,7 +405,7 @@ main(int argc, char **argv)
return (0);
}
-int
+static int
vmd_configure(void)
{
/*
@@ -435,7 +434,7 @@ vmd_configure(void)
return (0);
}
-void
+static void
vmd_reload(int reset, const char *filename)
{
/* Switch back to the default config file */
@@ -453,7 +452,7 @@ vmd_reload(int reset, const char *filena
}
}
-void
+static void
vmd_shutdown(void)
{
proc_kill(&env->vmd_ps);
Index: vmd.h
===================================================================
RCS file: /cvs/src/usr.sbin/vmd/vmd.h,v
retrieving revision 1.16
diff -u -p -r1.16 vmd.h
--- vmd.h 11 Dec 2015 10:16:53 -0000 1.16
+++ vmd.h 1 Jan 2016 14:44:29 -0000
@@ -105,7 +105,6 @@ struct vmd {
};
/* vmd.c */
-void vmd_reload(int, const char *);
struct vmd_vm *vm_getbyvmid(uint32_t);
struct vmd_vm *vm_getbyid(uint32_t);
struct vmd_vm *vm_getbyname(const char *);
--
Michal Mazurek