Modify the comparing statement for storing local irk 09/116109/3 accepted/tizen/common/20170303.090649 accepted/tizen/ivi/20170302.121731 accepted/tizen/mobile/20170302.121420 accepted/tizen/tv/20170302.121528 accepted/tizen/unified/20170309.035126 accepted/tizen/wearable/20170302.121638 submit/tizen/20170302.014914 submit/tizen_unified/20170308.100411
authorDoHyun Pyun <dh79.pyun@samsung.com>
Thu, 23 Feb 2017 04:29:20 +0000 (13:29 +0900)
committerPyun DoHyun <dh79.pyun@samsung.com>
Thu, 23 Feb 2017 04:47:32 +0000 (20:47 -0800)
store_local_irk function's return type is bool. It can't return the
negative value. So the error logic will not work.

Change-Id: Idbf919de8db1ed56054a6d6fbe862d3315364c37
Signed-off-by: DoHyun Pyun <dh79.pyun@samsung.com>
src/adapter.c

index 82bfa36..ae4d2f8 100644 (file)
@@ -12878,7 +12878,7 @@ static bool load_local_irk(struct btd_adapter *adapter)
 
        if (access(LOCAL_IRK_DIRNAME"/"LOCAL_IRK_FILENAME, F_OK) < 0) {
                adapter->local_irk = generate_irk();
-               if (store_local_irk(adapter) < 0) {
+               if (store_local_irk(adapter) == false) {
                        error("Cannot store Local IRK");
                        g_free(adapter->local_irk);
                        return false;