static void __msc_check_pvr_svc(void)
{
- if (ms_is_support_pvr()) {
- MS_DBG_ERR("Waiting PVR service");
- while (!_msc_is_power_off()) {
- FILE* file = fopen("/run/pvr_ready", "rb");
-
- if (file != NULL) {
- fclose(file);
- MS_DBG_WARN("PVR service is ready");
- break;
- } else {
- sleep(1);
- }
- }
+ if (!ms_is_support_pvr())
+ return;
+
+ MS_DBG_ERR("Waiting PVR service");
+ while (!_msc_is_power_off()) {
+ if (g_file_test("/run/pvr_ready", G_FILE_TEST_EXISTS))
+ break;
+
+ sleep(1);
}
+
+ MS_DBG_WARN("PVR service is ready");
}
gpointer msc_storage_scan_thread(gpointer data)