From aac4d7f292e011e73a1bc04d089a43af5a40a1cf Mon Sep 17 00:00:00 2001 From: Martin Ling Date: Mon, 25 Nov 2013 11:34:42 +0000 Subject: [PATCH] Fix SET_FAIL macro. --- serialport.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/serialport.c b/serialport.c index fd42034..bb5e90a 100644 --- a/serialport.c +++ b/serialport.c @@ -154,7 +154,7 @@ void (*sp_debug_handler)(const char *format, ...) = sp_default_debug_handler; #define RETURN_FAIL(msg) do { DEBUG_FAIL(msg); return SP_ERR_FAIL; } while (0) #define RETURN_VALUE(fmt, x) do { DEBUG("%s returning " fmt, __func__, x); return x; } while (0) #define SET_ERROR(val, err, msg) do { DEBUG_ERROR(err, msg); val = err; } while (0) -#define SET_FAIL(val, msg) do { DEBUG_FAIL(msg); val = err; } while (0) +#define SET_FAIL(val, msg) do { DEBUG_FAIL(msg); val = SP_ERR_FAIL; } while (0) #define TRACE(fmt, ...) DEBUG("%s(" fmt ") called", __func__, ##__VA_ARGS__) #define TRY(x) do { int ret = x; if (ret != SP_OK) RETURN_CODEVAL(ret); } while (0)