Commit 83509b42eb0d9305920c90a4fe005decdc152a5d
Committed by
Stéphane Raimbault
1 parent
136a1880
Properly check TIOCSRS485 define.
Showing
1 changed file
with
2 additions
and
2 deletions
src/modbus-rtu.c
| @@ -31,7 +31,7 @@ | @@ -31,7 +31,7 @@ | ||
| 31 | #include "modbus-rtu.h" | 31 | #include "modbus-rtu.h" |
| 32 | #include "modbus-rtu-private.h" | 32 | #include "modbus-rtu-private.h" |
| 33 | 33 | ||
| 34 | -#if defined(HAVE_DECL_TIOCSRS485) | 34 | +#if HAVE_DECL_TIOCSRS485 |
| 35 | #include <sys/ioctl.h> | 35 | #include <sys/ioctl.h> |
| 36 | #include <linux/serial.h> | 36 | #include <linux/serial.h> |
| 37 | #endif | 37 | #endif |
| @@ -708,7 +708,7 @@ static int _modbus_rtu_connect(modbus_t *ctx) | @@ -708,7 +708,7 @@ static int _modbus_rtu_connect(modbus_t *ctx) | ||
| 708 | int modbus_rtu_set_serial_mode(modbus_t *ctx, int mode) | 708 | int modbus_rtu_set_serial_mode(modbus_t *ctx, int mode) |
| 709 | { | 709 | { |
| 710 | if (ctx->backend->backend_type == _MODBUS_BACKEND_TYPE_RTU) { | 710 | if (ctx->backend->backend_type == _MODBUS_BACKEND_TYPE_RTU) { |
| 711 | -#if defined(HAVE_DECL_TIOCSRS485) | 711 | +#if HAVE_DECL_TIOCSRS485 |
| 712 | modbus_rtu_t *ctx_rtu = ctx->backend_data; | 712 | modbus_rtu_t *ctx_rtu = ctx->backend_data; |
| 713 | struct serial_rs485 rs485conf; | 713 | struct serial_rs485 rs485conf; |
| 714 | memset(&rs485conf, 0x0, sizeof(struct serial_rs485)); | 714 | memset(&rs485conf, 0x0, sizeof(struct serial_rs485)); |