| 306 | |
| 307 | private: |
| 308 | static int init(const PathName& directory, const Guid& guid) |
| 309 | { |
| 310 | #ifdef WIN_NT |
| 311 | const mode_t ACCESS_MODE = DEFAULT_OPEN_MODE; |
| 312 | #else |
| 313 | const mode_t ACCESS_MODE = 0664; |
| 314 | #endif |
| 315 | char guidStr[GUID_BUFF_SIZE]; |
| 316 | GuidToString(guidStr, &guid); |
| 317 | |
| 318 | const PathName filename = directory + guidStr; |
| 319 | |
| 320 | const int fd = os_utils::open(filename.c_str(), |
| 321 | O_CREAT | O_RDWR | O_BINARY, ACCESS_MODE); |
| 322 | |
| 323 | if (fd < 0) |
| 324 | raiseError("Control file %s open failed (error: %d)", filename.c_str(), ERRNO); |
| 325 | |
| 326 | return fd; |
| 327 | } |
| 328 | |
| 329 | void flush() |
| 330 | { |
no test coverage detected