Fix mode change notification errors accepted/tizen/unified/20200324.101516 submit/tizen/20200324.035544
authorJinWang An <jinwang.an@samsung.com>
Tue, 24 Mar 2020 03:52:38 +0000 (12:52 +0900)
committerYoungjae Shin <yj99.shin@samsung.com>
Tue, 24 Mar 2020 03:55:02 +0000 (12:55 +0900)
client/mdsc_noti_mode.c

index 368e86328d87c9339948b876446e369573915047..0e36160aca19133ffd25abe83216ffa5d19222fd 100644 (file)
@@ -34,9 +34,9 @@ static void _mutex_lock(pthread_mutex_t *mutex)
 
 static void _mutex_unlock(pthread_mutex_t *mutex)
 {
-       int ret = pthread_mutex_lock(mutex);
+       int ret = pthread_mutex_unlock(mutex);
        if (0 != ret)
-               ERR("pthread_mutex_lock() Fail(%d)", errno);
+               ERR("pthread_mutex_unlock() Fail(%d)", errno);
 }
 
 static void _on_changed_mode(mdsDbus *mdsc_dbus, const char *mode, int state, gpointer user_data)
@@ -60,7 +60,8 @@ static void _on_changed_mode(mdsDbus *mdsc_dbus, const char *mode, int state, gp
        }
        _mutex_unlock(&handle->noti_mutex);
 
-       for (; 0 <= i; i--) {
+       length = i;
+       for (i = 0; i < length; i++) {
                if (cb_list[i].cb)
                        cb_list[i].cb(mode, state, cb_list[i].user_data);
        }