diff --git a/runit/runit_lib.c b/runit/runit_lib.c
index ee69429..181d438 100644
--- a/runit/runit_lib.c
+++ b/runit/runit_lib.c
@@ -34,6 +34,7 @@
 #include "libbb.h"
 #include "runit_lib.h"
 
+#if 0
 /*** buffer.c ***/
 
 void buffer_init(buffer *s,int (*op)(int fd,char *buf,unsigned len),int fd,char *buf,unsigned len)
@@ -231,6 +232,7 @@
 {
 	return write(fd,buf,len);
 }
+#endif
 
 
 /*** byte_chr.c ***/
@@ -288,12 +290,14 @@
 }
 
 
+#if 0
 /*** fifo.c ***/
 
 int fifo_make(const char *fn,int mode)
 {
-	return mkfifo(fn,mode);
+	return mkfifo(fn, mode);
 }
+#endif
 
 
 /*** fmt_ptime.c ***/
@@ -489,7 +493,7 @@
 
 /* XXX: breaks tai encapsulation */
 
-int taia_less(const struct taia *t,const struct taia *u)
+int taia_less(const struct taia *t, const struct taia *u)
 {
 	if (t->sec.x < u->sec.x) return 1;
 	if (t->sec.x > u->sec.x) return 0;
@@ -537,7 +541,7 @@
 
 /* XXX: breaks tai encapsulation */
 
-void taia_sub(struct taia *t,const struct taia *u,const struct taia *v)
+void taia_sub(struct taia *t, const struct taia *u, const struct taia *v)
 {
 	unsigned long unano = u->nano;
 	unsigned long uatto = u->atto;
@@ -560,7 +564,7 @@
 
 /* XXX: breaks tai encapsulation */
 
-void taia_uint(struct taia *t,unsigned s)
+void taia_uint(struct taia *t, unsigned s)
 {
 	t->sec.x = s;
 	t->nano = 0;
@@ -874,6 +878,7 @@
 }
 
 
+#if 0
 /*** prot.c ***/
 
 int prot_gid(int gid)
@@ -887,6 +892,7 @@
 {
 	return setuid(uid);
 }
+#endif
 
 
 /*** readclose.c ***/
@@ -910,6 +916,7 @@
 }
 #endif
 
+#if 0
 /*** scan_ulong.c ***/
 
 unsigned scan_ulong(const char *s,unsigned long *u)
@@ -924,6 +931,7 @@
 	*u = result;
 	return pos;
 }
+#endif
 
 
 #ifdef UNUSED
@@ -956,23 +964,23 @@
 {
 	sigset_t ss;
 	sigemptyset(&ss);
-	sigaddset(&ss,sig);
-	sigprocmask(SIG_BLOCK,&ss,(sigset_t *) 0);
+	sigaddset(&ss, sig);
+	sigprocmask(SIG_BLOCK, &ss, NULL);
 }
 
 void sig_unblock(int sig)
 {
 	sigset_t ss;
 	sigemptyset(&ss);
-	sigaddset(&ss,sig);
-	sigprocmask(SIG_UNBLOCK,&ss,(sigset_t *) 0);
+	sigaddset(&ss, sig);
+	sigprocmask(SIG_UNBLOCK, &ss, NULL);
 }
 
 void sig_blocknone(void)
 {
 	sigset_t ss;
 	sigemptyset(&ss);
-	sigprocmask(SIG_SETMASK,&ss,(sigset_t *) 0);
+	sigprocmask(SIG_SETMASK, &ss, NULL);
 }
 
 
@@ -984,7 +992,7 @@
 	sa.sa_handler = f;
 	sa.sa_flags = 0;
 	sigemptyset(&sa.sa_mask);
-	sigaction(sig,&sa,(struct sigaction *) 0);
+	sigaction(sig,&sa, NULL);
 }
 
 
diff --git a/runit/runit_lib.h b/runit/runit_lib.h
index f594f8f..ea4b331 100644
--- a/runit/runit_lib.h
+++ b/runit/runit_lib.h
@@ -27,6 +27,7 @@
 
 /*** buffer.h ***/
 
+#if 0
 typedef struct buffer {
 	char *x;
 	unsigned p;
@@ -35,17 +36,17 @@
 	int (*op)(int fd,char *buf,unsigned len);
 } buffer;
 
-#define BUFFER_INIT(op,fd,buf,len) { (buf), 0, (len), (fd), (op) }
-#define BUFFER_INSIZE 8192
+//#define BUFFER_INIT(op,fd,buf,len) { (buf), 0, (len), (fd), (op) }
+//#define BUFFER_INSIZE 8192
 #define BUFFER_OUTSIZE 8192
 
 extern void buffer_init(buffer *,int (*)(int fd,char *buf,unsigned len),int,char *,unsigned);
 
 extern int buffer_flush(buffer *);
-extern int buffer_put(buffer *,const char *,unsigned);
+//extern int buffer_put(buffer *,const char *,unsigned);
 extern int buffer_putalign(buffer *,const char *,unsigned);
 extern int buffer_putflush(buffer *,const char *,unsigned);
-extern int buffer_puts(buffer *,const char *);
+//extern int buffer_puts(buffer *,const char *);
 extern int buffer_putsalign(buffer *,const char *);
 extern int buffer_putsflush(buffer *,const char *);
 
@@ -77,6 +78,7 @@
 /* Actually, int buffer_unixwrite(int,const char *,unsigned),
 	 but that 'const' will produce warnings... oh well */
 extern int buffer_unixwrite(int,char *,unsigned);
+#endif
 
 
 /*** byte.h ***/
@@ -102,7 +104,7 @@
 
 /*** fifo.h ***/
 
-extern int fifo_make(const char *,int);
+//extern int fifo_make(const char *,int);
 
 
 /*** fmt.h ***/
@@ -292,9 +294,9 @@
 
 /*** pathexec.h ***/
 
-extern void pathexec_run(const char *,char *const *,char *const *);
-extern int pathexec_env(const char *,const char *);
-extern void pathexec(char **);
+//extern void pathexec_run(const char *,char *const *,char *const *);
+//extern int pathexec_env(const char *,const char *);
+//extern void pathexec(char **);
 
 
 /*** pmatch.h ***/
@@ -304,8 +306,8 @@
 
 /*** prot.h ***/
 
-extern int prot_gid(int);
-extern int prot_uid(int);
+//extern int prot_gid(int);
+//extern int prot_uid(int);
 
 
 /*** readclose.h ***/
@@ -345,14 +347,14 @@
 
 /*** seek.h ***/
 
-typedef unsigned long seek_pos;
+//typedef unsigned long seek_pos;
 
-extern seek_pos seek_cur(int);
+//extern seek_pos seek_cur(int);
 
 //extern int seek_set(int,seek_pos);
-extern int seek_end(int);
+//extern int seek_end(int);
 
-extern int seek_trunc(int,seek_pos);
+//extern int seek_trunc(int,seek_pos);
 
 //#define seek_begin(fd) (seek_set((fd),(seek_pos) 0))
 
@@ -368,8 +370,8 @@
 //extern int sig_term;
 
 extern void sig_catch(int,void (*)(int));
-#define sig_ignore(s) (sig_catch((s),SIG_IGN))
-#define sig_uncatch(s) (sig_catch((s),SIG_DFL))
+#define sig_ignore(s) (sig_catch((s), SIG_IGN))
+#define sig_uncatch(s) (sig_catch((s), SIG_DFL))
 
 extern void sig_block(int);
 extern void sig_unblock(int);
@@ -383,8 +385,8 @@
 
 extern unsigned str_chr(const char *,int);  /* never returns NULL */
 
-#define str_diff(s,t) strcmp((s),(t))
-#define str_equal(s,t) (!strcmp((s),(t)))
+#define str_diff(s,t) strcmp((s), (t))
+#define str_equal(s,t) (!strcmp((s), (t)))
 
 
 /*** wait.h ***/
diff --git a/runit/runsv.c b/runit/runsv.c
index 24a51f2..018a80e 100644
--- a/runit/runsv.c
+++ b/runit/runsv.c
@@ -486,25 +486,25 @@
 		coe(svd[1].fdlock);
 	}
 
-	fifo_make("log/supervise/control"+4, 0600);
+	mkfifo("log/supervise/control"+4, 0600);
 	svd[0].fdcontrol = xopen("log/supervise/control"+4, O_RDONLY|O_NDELAY);
 	coe(svd[0].fdcontrol);
 	svd[0].fdcontrolwrite = xopen("log/supervise/control"+4, O_WRONLY|O_NDELAY);
 	coe(svd[0].fdcontrolwrite);
 	update_status(&svd[0]);
 	if (haslog) {
-		fifo_make("log/supervise/control", 0600);
+		mkfifo("log/supervise/control", 0600);
 		svd[1].fdcontrol = xopen("log/supervise/control", O_RDONLY|O_NDELAY);
 		coe(svd[1].fdcontrol);
 		svd[1].fdcontrolwrite = xopen("log/supervise/control", O_WRONLY|O_NDELAY);
 		coe(svd[1].fdcontrolwrite);
 		update_status(&svd[1]);
 	}
-	fifo_make("log/supervise/ok"+4, 0600);
+	mkfifo("log/supervise/ok"+4, 0600);
 	fd = xopen("log/supervise/ok"+4, O_RDONLY|O_NDELAY);
 	coe(fd);
 	if (haslog) {
-		fifo_make("log/supervise/ok", 0600);
+		mkfifo("log/supervise/ok", 0600);
 		fd = xopen("log/supervise/ok", O_RDONLY|O_NDELAY);
 		coe(fd);
 	}
diff --git a/runit/runsvdir.c b/runit/runsvdir.c
index 41581a8..22f2a05 100644
--- a/runit/runsvdir.c
+++ b/runit/runsvdir.c
@@ -69,7 +69,7 @@
 
 		prog[0] = "runsv";
 		prog[1] = name;
-		prog[2] = 0;
+		prog[2] = NULL;
 		sig_uncatch(SIGHUP);
 		sig_uncatch(SIGTERM);
 		if (pgrp) setsid();
