From 3025375cc647d888f092d4fe7d6ca2311aaecd3e Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Sun, 9 Dec 2012 13:12:34 -0600 Subject: [PATCH] fix logic in openpty case --- .../applications/mod_spandsp/mod_spandsp_modem.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/src/mod/applications/mod_spandsp/mod_spandsp_modem.c b/src/mod/applications/mod_spandsp/mod_spandsp_modem.c index 142f932b4d..8e1c925b8b 100644 --- a/src/mod/applications/mod_spandsp/mod_spandsp_modem.c +++ b/src/mod/applications/mod_spandsp/mod_spandsp_modem.c @@ -230,15 +230,13 @@ switch_status_t modem_init(modem_t *modem, modem_control_handler_t control_handl #if USE_OPENPTY if (openpty(&modem->master, &modem->slave, NULL, NULL, NULL)) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Fatal error: failed to initialize pty\n"); + status = SWITCH_STATUS_FALSE; + goto end; + } - if (modem->master < 0) { - switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Fatal error: failed to initialize pty\n"); - status = SWITCH_STATUS_FALSE; - goto end; - } - - modem->stty = ttyname(modem->slave); - } + modem->stty = ttyname(modem->slave); + #else #ifdef WIN32 modem->slot = 4+globals.NEXT_ID++; /* need work here we start at COM4 for now*/