]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
make compiler stop complaining
authorKen Rice <krice@freeswitch.org>
Tue, 27 Mar 2012 16:06:31 +0000 (11:06 -0500)
committerKen Rice <krice@freeswitch.org>
Tue, 27 Mar 2012 18:58:27 +0000 (13:58 -0500)
libs/esl/ivrd.c

index 2a2a607202d876976e32c67a9539c6037e423c42..66f6908d5d16c1ccbea7b66c8fbb6e4d508ba95f 100644 (file)
@@ -54,8 +54,11 @@ static void mycallback(esl_socket_t server_sock, esl_socket_t client_sock, struc
        }
 
        /* hotwire the socket to STDIN/STDOUT */
-       dup2(client_sock, STDIN_FILENO);
-       dup2(client_sock, STDOUT_FILENO);
+       if (!(dup2(client_sock, STDIN_FILENO)) && !(dup2(client_sock, STDOUT_FILENO))){
+               esl_disconnect(&handle);
+               esl_log(ESL_LOG_ERROR, "Socket Error hotwiring socket to STDIN/STDOUT!\n");
+               return;
+       }
 
        system(path);
        esl_disconnect(&handle);