| 898 | } |
| 899 | |
| 900 | dev_t getDeviceId(std::string path) { |
| 901 | struct stat statInfo; |
| 902 | |
| 903 | while (true) { |
| 904 | int returnValue = stat(path.c_str(), &statInfo); |
| 905 | if (!returnValue) |
| 906 | break; |
| 907 | |
| 908 | if (errno == ENOENT) { |
| 909 | path = parentDirectory(path); |
| 910 | } else { |
| 911 | TraceEvent(SevError, "GetDeviceIdError").detail("Path", path).GetLastError(); |
| 912 | throw platform_error(); |
| 913 | } |
| 914 | } |
| 915 | |
| 916 | return statInfo.st_dev; |
| 917 | } |
| 918 | |
| 919 | #endif |
| 920 |
no test coverage detected