| 90 | #endif |
| 91 | |
| 92 | static bool ipc_path_fs_magic(const char *path, unsigned long *magic_out) { |
| 93 | #ifdef CBM_ENABLE_TEST_SEAMS |
| 94 | if (g_ipc_fs_magic_override_active) { |
| 95 | *magic_out = g_ipc_fs_magic_override; |
| 96 | return true; |
| 97 | } |
| 98 | #endif |
| 99 | #if defined(__linux__) |
| 100 | struct statfs status; |
| 101 | if (statfs(path, &status) != 0) { |
| 102 | return false; |
| 103 | } |
| 104 | /* f_type is a signed word on some ABIs; the magics are 32-bit. */ |
| 105 | *magic_out = (unsigned long)status.f_type & 0xFFFFFFFFUL; |
| 106 | return true; |
| 107 | #else |
| 108 | (void)path; |
| 109 | (void)magic_out; |
| 110 | return false; |
| 111 | #endif |
| 112 | } |
| 113 | |
| 114 | bool cbm_daemon_ipc_warn_if_network_cache_root(const char *cache_root) { |
| 115 | unsigned long magic = 0; |
no test coverage detected