diff options
author | Simon Wilks <sjwilks@gmail.com> | 2012-11-22 12:48:52 +0100 |
---|---|---|
committer | Simon Wilks <sjwilks@gmail.com> | 2012-11-22 12:48:52 +0100 |
commit | cc7952ea94f30b62be70486f42b47bcffee7f8eb (patch) | |
tree | ca0fb262fe104732698d0f4f2094998772a8d306 /apps/hott_telemetry | |
parent | c296ffb7083678b6760aca9f179067830669af1e (diff) | |
download | px4-firmware-cc7952ea94f30b62be70486f42b47bcffee7f8eb.tar.gz px4-firmware-cc7952ea94f30b62be70486f42b47bcffee7f8eb.tar.bz2 px4-firmware-cc7952ea94f30b62be70486f42b47bcffee7f8eb.zip |
Messaging cleanup.
Diffstat (limited to 'apps/hott_telemetry')
-rw-r--r-- | apps/hott_telemetry/hott_telemetry_main.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/apps/hott_telemetry/hott_telemetry_main.c b/apps/hott_telemetry/hott_telemetry_main.c index 25830f20f..515779cb5 100644 --- a/apps/hott_telemetry/hott_telemetry_main.c +++ b/apps/hott_telemetry/hott_telemetry_main.c @@ -115,8 +115,8 @@ static int open_uart(const char *uart_name, struct termios *uart_config_original int termios_state; /* Back up the original uart configuration to restore it after exit */ + char msg[80]; if ((termios_state = tcgetattr(uart, uart_config_original)) < 0) { - char msg[80]; sprintf(msg, "Error getting baudrate / termios config for %s: %d\n", uart_name, termios_state); close(uart); FATAL_MSG(msg); @@ -130,14 +130,13 @@ static int open_uart(const char *uart_name, struct termios *uart_config_original /* Set baud rate */ if (cfsetispeed(&uart_config, speed) < 0 || cfsetospeed(&uart_config, speed) < 0) { - char msg[80]; - sprintf(msg, "Error setting baudrate / termios config for %s: %d (cfsetispeed, cfsetospeed)\n", uart_name, termios_state); + sprintf(msg, "Error setting baudrate / termios config for %s: %d (cfsetispeed, cfsetospeed)\n", + uart_name, termios_state); close(uart); FATAL_MSG(msg); } if ((termios_state = tcsetattr(uart, TCSANOW, &uart_config)) < 0) { - char msg[80]; sprintf(msg, "Error setting baudrate / termios config for %s (tcsetattr)\n", uart_name); close(uart); FATAL_MSG(msg); |