diff --git a/dbutil.c b/dbutil.c
index 97d72779a795c0ea061b029ed8f09197f4666a86..044388aee345297ea0962f57c6d74ecdb68ce250 100644
--- a/dbutil.c
+++ b/dbutil.c
@@ -443,7 +443,7 @@ int spawn_command(void(*exec_fn)(void *user_data), void *exec_data,
 		return DROPBEAR_FAILURE;
 	}
 
-#ifndef HAVE_FORK
+#ifdef USE_VFORK
 	pid = vfork();
 #else
 	pid = fork();
diff --git a/scp.c b/scp.c
index 6911ca291a56287fa96af4643d83a549cb20f9c7..529498e4383e7113df97d387e0f06d20b34a9a27 100644
--- a/scp.c
+++ b/scp.c
@@ -130,7 +130,7 @@ do_local_cmd(arglist *a)
 			fprintf(stderr, " %s", a->list[i]);
 		fprintf(stderr, "\n");
 	}
-#ifndef HAVE_FORK
+#ifdef USE_VFORK
 	pid = vfork();
 #else
 	pid = fork();
@@ -141,7 +141,7 @@ do_local_cmd(arglist *a)
 	if (pid == 0) {
 		execvp(a->list[0], a->list);
 		perror(a->list[0]);
-#ifndef HAVE_FORK
+#ifdef USE_VFORK
 		_exit(1);
 #else
 		exit(1);
@@ -210,12 +210,12 @@ do_cmd(char *host, char *remuser, char *cmd, int *fdin, int *fdout, int argc)
 
 	/* uClinux needs to build the args here before vforking,
 	   otherwise we do it later on. */
-#ifndef HAVE_FORK
+#ifdef USE_VFORK
 	arg_setup(host, remuser, cmd);
 #endif
 
 	/* Fork a child to execute the command on the remote host using ssh. */
-#ifndef HAVE_FORK
+#ifdef USE_VFORK
 	do_cmd_pid = vfork();
 #else
 	do_cmd_pid = fork();
@@ -230,13 +230,13 @@ do_cmd(char *host, char *remuser, char *cmd, int *fdin, int *fdout, int argc)
 		close(pin[0]);
 		close(pout[1]);
 
-#ifndef HAVE_FORK
+#ifdef USE_VFORK
 		arg_setup(host, remuser, cmd);
 #endif
 
 		execvp(ssh_program, args.list);
 		perror(ssh_program);
-#ifndef HAVE_FORK
+#ifdef USE_VFORK
 		_exit(1);
 #else
 		exit(1);
@@ -245,7 +245,7 @@ do_cmd(char *host, char *remuser, char *cmd, int *fdin, int *fdout, int argc)
 		fatal("fork: %s", strerror(errno));
 	}
 
-#ifndef HAVE_FORK
+#ifdef USE_VFORK
 	/* clean up command */
 	/* pop cmd */
 	xfree(args.list[args.num-1]);
diff --git a/session.h b/session.h
index ea59bca189cfe2809f128a65c9bc72b4790c50a0..941dcb9ae16130170586be155fd1cda8f8bf95d5 100644
--- a/session.h
+++ b/session.h
@@ -218,7 +218,7 @@ struct serversession {
 	/* The resolved remote address, used for lastlog etc */
 	char *remotehost;
 
-#ifndef HAVE_FORK
+#ifdef USE_VFORK
 	pid_t server_pid;
 #endif
 
diff --git a/svr-chansession.c b/svr-chansession.c
index 198dbe6eb3be63f6d985bea78538e73871b747ec..f31d9f0c940c931743400c58ecc5d38e64c95ab9 100644
--- a/svr-chansession.c
+++ b/svr-chansession.c
@@ -658,7 +658,7 @@ static int sessioncommand(struct Channel *channel, struct ChanSess *chansess,
 
 	/* uClinux will vfork(), so there'll be a race as 
 	connection_string is freed below. */
-#ifdef HAVE_FORK
+#ifndef USE_VFORK
 	chansess->connection_string = make_connection_string();
 #endif
 
@@ -670,7 +670,7 @@ static int sessioncommand(struct Channel *channel, struct ChanSess *chansess,
 		ret = ptycommand(channel, chansess);
 	}
 
-#ifdef HAVE_FORK	
+#ifndef USE_VFORK
 	m_free(chansess->connection_string);
 #endif
 
@@ -745,7 +745,7 @@ static int ptycommand(struct Channel *channel, struct ChanSess *chansess) {
 		return DROPBEAR_FAILURE;
 	}
 	
-#ifndef HAVE_FORK
+#ifdef USE_VFORK
 	pid = vfork();
 #else
 	pid = fork();
@@ -865,7 +865,7 @@ static void execchild(void *user_data) {
 
 	/* with uClinux we'll have vfork()ed, so don't want to overwrite the
 	 * hostkey. can't think of a workaround to clear it */
-#ifdef HAVE_FORK
+#ifndef USE_VFORK
 	/* wipe the hostkey */
 	sign_key_free(svr_opts.hostkey);
 	svr_opts.hostkey = NULL;
diff --git a/svr-session.c b/svr-session.c
index 7703a8fc2f80a2461ee6d13f3238e4ea610f233f..ac73dab80503eb6574d75bff35ab7d1b0518a02b 100644
--- a/svr-session.c
+++ b/svr-session.c
@@ -84,7 +84,7 @@ void svr_session(int sock, int childpipe) {
 
 	/* Initialise server specific parts of the session */
 	svr_ses.childpipe = childpipe;
-#ifndef HAVE_FORK
+#ifdef USE_VFORK
 	svr_ses.server_pid = getpid();
 #endif
 	svr_authinitialise();
@@ -157,12 +157,10 @@ void svr_dropbear_exit(int exitcode, const char* format, va_list param) {
 
 	_dropbear_log(LOG_INFO, fmtbuf, param);
 
-#ifndef HAVE_FORK
-	/* only the main server process should cleanup - we don't want
+#ifdef USE_VFORK
+	/* For uclinux only the main server process should cleanup - we don't want
 	 * forked children doing that */
 	if (svr_ses.server_pid == getpid())
-#else
-	if (1)
 #endif
 	{
 		/* free potential public key options */
diff --git a/sysoptions.h b/sysoptions.h
index 283229e9b3abe6533f9fcced74c26db0aa6f9d7d..ee5ff3679d5f6c5201b3510b0814c9bb99370666 100644
--- a/sysoptions.h
+++ b/sysoptions.h
@@ -216,4 +216,10 @@
 #define IS_DROPBEAR_SERVER 0
 #define IS_DROPBEAR_CLIENT 0
 
-#endif
+#endif /* neither DROPBEAR_SERVER nor DROPBEAR_CLIENT */
+
+#ifndef HAVE_FORK
+#define USE_VFORK
+#endif  /* don't HAVE_FORK */
+
+/* no include guard for this file */