diff scp.c @ 667:fc7ae88e63b3

Rename HAVE_FORK to USE_VFORK It makes it a bit more obvious why there's a test there since HAVE_FORK is the normal case.
author Matt Johnston <matt@ucc.asn.au>
date Mon, 09 Apr 2012 20:35:13 +0800
parents 0ad95abf8d3c
children 6c35ff40e496
line wrap: on
line diff
--- a/scp.c	Sun Apr 08 01:50:52 2012 -0400
+++ b/scp.c	Mon Apr 09 20:35:13 2012 +0800
@@ -130,7 +130,7 @@
 			fprintf(stderr, " %s", a->list[i]);
 		fprintf(stderr, "\n");
 	}
-#ifndef HAVE_FORK
+#ifdef USE_VFORK
 	pid = vfork();
 #else
 	pid = fork();
@@ -141,7 +141,7 @@
 	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 @@
 
 	/* 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 @@
 		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 @@
 		fatal("fork: %s", strerror(errno));
 	}
 
-#ifndef HAVE_FORK
+#ifdef USE_VFORK
 	/* clean up command */
 	/* pop cmd */
 	xfree(args.list[args.num-1]);