Diff of /upnphttp.c [862f6b] .. [3995cb] Maximize Restore

  Switch to side-by-side view

--- a/upnphttp.c
+++ b/upnphttp.c
@@ -78,6 +78,7 @@
 #include "tivo_utils.h"
 #include "tivo_commands.h"
 #include "clients.h"
+#include "process.h"
 
 #include "sendfile.h"
 
@@ -1574,8 +1575,8 @@
 
 #if USE_FORK
 	pid_t newpid = 0;
-	newpid = fork();
-	if( newpid )
+	newpid = process_fork();
+	if( newpid > 0 )
 	{
 		CloseSocket_upnphttp(h);
 		goto resized_error;
@@ -1716,7 +1717,7 @@
 resized_error:
 	sqlite3_free_table(result);
 #if USE_FORK
-	if( !newpid )
+	if( newpid == 0 )
 		_exit(0);
 #endif
 }
@@ -1809,8 +1810,8 @@
 		sqlite3_free_table(result);
 	}
 #if USE_FORK
-	newpid = fork();
-	if( newpid )
+	newpid = process_fork();
+	if( newpid > 0 )
 	{
 		CloseSocket_upnphttp(h);
 		goto error;
@@ -1951,7 +1952,7 @@
 	CloseSocket_upnphttp(h);
 error:
 #if USE_FORK
-	if( !newpid )
+	if( newpid == 0 )
 		_exit(0);
 #endif
 	return;