From 80393f53cb1a1b54314bc2224f95e0b07b0c32db Mon Sep 17 00:00:00 2001 From: Krzysztof Opasiak Date: Fri, 26 Sep 2014 17:12:57 +0200 Subject: [PATCH] libusbgx: Don't print errno when it has not been directly set Replace ERRORNO() macro with ERROR(). Difference betwen them is that ERRORNO() prints also standard error string based on errno value. This variable should not be accessed when called function doesn't directly set it. Signed-off-by: Krzysztof Opasiak --- src/usbg.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/usbg.c b/src/usbg.c index 6e0ce6f..7640dda 100644 --- a/src/usbg.c +++ b/src/usbg.c @@ -1291,7 +1291,7 @@ static int usbg_init_state(char *path, usbg_state *s) ret = usbg_parse_gadgets(path, s); if (ret != USBG_SUCCESS) - ERRORNO("unable to parse %s\n", path); + ERROR("unable to parse %s\n", path); return ret; } @@ -1330,7 +1330,7 @@ int usbg_init(const char *configfs_path, usbg_state **state) ret = usbg_init_state(path, s); if (ret != USBG_SUCCESS) { - ERRORNO("couldn't init gadget state\n"); + ERROR("couldn't init gadget state\n"); usbg_free_state(s); goto out; } @@ -2070,7 +2070,7 @@ int usbg_create_function(usbg_gadget *g, usbg_function_type type, *f = usbg_allocate_function(fpath, type, instance, g); func = *f; if (!func) { - ERRORNO("allocating function\n"); + ERROR("allocating function\n"); ret = USBG_ERROR_NO_MEM; goto out; } @@ -2130,7 +2130,7 @@ int usbg_create_config(usbg_gadget *g, int id, const char *label, *c = usbg_allocate_config(cpath, label, id, g); conf = *c; if (!conf) { - ERRORNO("allocating configuration\n"); + ERROR("allocating configuration\n"); ret = USBG_ERROR_NO_MEM; goto out; } -- 2.7.4