From: Martin Ling Date: Mon, 25 Nov 2013 11:34:42 +0000 (+0000) Subject: Fix SET_FAIL macro. X-Git-Tag: libserialport-0.1.0~50 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=aac4d7f292e011e73a1bc04d089a43af5a40a1cf;p=libserialport.git Fix SET_FAIL macro. --- 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)