Fix incorrect error message 56/149956/3
authorAlexander Aksenov <a.aksenov@samsung.com>
Wed, 13 Sep 2017 18:20:30 +0000 (21:20 +0300)
committerAlexander Aksenov <a.aksenov@samsung.com>
Fri, 22 Sep 2017 08:22:56 +0000 (08:22 +0000)
Change-Id: Id67cb9a9692c977a8fdee23d972aa7a3709ade5a
Signed-off-by: Alexander Aksenov <a.aksenov@samsung.com>
helper/dahelper.c
helper/got_patching.c

index 84e264d..3373beb 100755 (executable)
@@ -187,7 +187,7 @@ int add_binary(char *path)
 
        if (!SLIST_EMPTY(&gTraceInfo.bins_info.bins_list) &&
                (_find_binary_no_lock(real_path) != NULL)) {
-               ret = -EALREADY;
+               ret = EALREADY;
                goto free_real_path;
        }
 
index 1d87529..4fba87a 100644 (file)
@@ -125,7 +125,7 @@ static void _process_target_bins(char *bins_data, size_t avail_size)
 
                /* TODO Think about removing binaries */
                ret = add_binary(path);
-               if (ret != 0)
+               if (ret < 0)
                        PRINTERR("Adding failed, error code %d", ret);
                /* add_binary() allocates new buffer with realpath(), so this
                 * path should be freed */