Commit b4753f7ec45cf4324f84a00aebc4fdcb1ff5c1cb
1 parent
d8aa5a42
Returns -1 on invalid mode in modbus_rtu_set_rts
Showing
1 changed file
with
3 additions
and
0 deletions
src/modbus-rtu.c
| @@ -985,6 +985,9 @@ int modbus_rtu_set_rts(modbus_t *ctx, int mode) | @@ -985,6 +985,9 @@ int modbus_rtu_set_rts(modbus_t *ctx, int mode) | ||
| 985 | _modbus_rtu_ioctl_rts(ctx->s, ctx_rtu->rts != MODBUS_RTU_RTS_UP); | 985 | _modbus_rtu_ioctl_rts(ctx->s, ctx_rtu->rts != MODBUS_RTU_RTS_UP); |
| 986 | 986 | ||
| 987 | return 0; | 987 | return 0; |
| 988 | + } else { | ||
| 989 | + errno = EINVAL; | ||
| 990 | + return -1; | ||
| 988 | } | 991 | } |
| 989 | #else | 992 | #else |
| 990 | if (ctx->debug) { | 993 | if (ctx->debug) { |