From fe8d9de65e7aa5c2609ef4e4582f5689f0ea2ec8 Mon Sep 17 00:00:00 2001 From: Stéphane Raimbault Date: Wed, 25 Mar 2009 14:27:42 +0100 Subject: [PATCH] Enhanced error message for RTU open (serial) --- modbus/modbus.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modbus/modbus.c b/modbus/modbus.c index 781be99..19b70b4 100644 --- a/modbus/modbus.c +++ b/modbus/modbus.c @@ -1388,8 +1388,8 @@ static int modbus_connect_rtu(modbus_param_t *mb_param) mb_param->fd = open(mb_param->device, O_RDWR | O_NOCTTY | O_NDELAY); if (mb_param->fd < 0) { perror("open"); - printf("ERROR Can't open the device %s (errno %d)\n", - mb_param->device, errno); + printf("ERROR Can't open the device %s (%s)\n", + mb_param->device, strerror(errno)); return -1; } -- libgit2 0.21.4