Modify the comparing statement for storing local irk 20/116120/1
authorDoHyun Pyun <dh79.pyun@samsung.com>
Thu, 23 Feb 2017 04:29:20 +0000 (13:29 +0900)
committerDoHyun Pyun <dh79.pyun@samsung.com>
Thu, 23 Feb 2017 05:19:06 +0000 (14:19 +0900)
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: Id49650ddb2e718fc9054963c8eac5ec785e35ad9
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;