| 360 | } |
| 361 | |
| 362 | static bool application_regular_db_exists(const char *project) { |
| 363 | const char *cache = cbm_resolve_cache_dir(); |
| 364 | if (!cache || !project || !project[0]) { |
| 365 | return false; |
| 366 | } |
| 367 | char path[APPLICATION_PATH_CAP]; |
| 368 | int written = snprintf(path, sizeof(path), "%s/%s.db", cache, project); |
| 369 | if (written <= 0 || (size_t)written >= sizeof(path)) { |
| 370 | return false; |
| 371 | } |
| 372 | struct stat status; |
| 373 | return stat(path, &status) == 0 && S_ISREG(status.st_mode); |
| 374 | } |
| 375 | |
| 376 | static cbm_daemon_application_watch_t *application_find_watch_locked( |
| 377 | cbm_daemon_application_t *application, const char *project) { |
no test coverage detected