Improve __msc_check_stop_status() 97/240097/5
authorhj kim <backto.kim@samsung.com>
Mon, 3 Aug 2020 08:14:53 +0000 (17:14 +0900)
committerhj kim <backto.kim@samsung.com>
Tue, 11 Aug 2020 03:17:15 +0000 (03:17 +0000)
Change-Id: I321f838d0ba624d47848c4df27d66db97a4851f3

src/scanner-v2/media-scanner-scan-v2.c

index a76c1bd..f5d6c46 100644 (file)
@@ -157,10 +157,8 @@ static int __msc_check_stop_status(int scan_type, const char *start_path, int pi
        int ret = MS_MEDIA_ERR_NONE;
 
        /*check poweroff status*/
-       if (_msc_is_power_off()) {
-               ret = MS_MEDIA_ERR_SCANNER_FORCE_STOP;
-               goto END;
-       }
+       if (_msc_is_power_off())
+               return MS_MEDIA_ERR_SCANNER_FORCE_STOP;
 
        if (scan_type == MS_MSG_DIRECTORY_SCANNING || scan_type == MS_MSG_DIRECTORY_SCANNING_NON_RECURSIVE) {
                g_mutex_lock(&scan_req_mutex2);
@@ -205,7 +203,7 @@ static int __msc_check_stop_status(int scan_type, const char *start_path, int pi
 
                g_mutex_unlock(&blocked_mutex2);
        }
-END:
+
        return ret;
 }