| 467 | } |
| 468 | |
| 469 | File |
| 470 | MakeUniqueTempFile(std::string const& base) |
| 471 | { |
| 472 | auto const tmpStr = base + util::DIR_SEP + "usfile-XXXXXX"; |
| 473 | std::vector<char> tmpChars(tmpStr.c_str(), tmpStr.c_str() + tmpStr.length() + 1); |
| 474 | |
| 475 | errno = 0; |
| 476 | int fd = mkstemps_compat(tmpChars.data(), 0); |
| 477 | if (fd < 0) |
| 478 | throw std::runtime_error(util::GetLastCErrorStr()); |
| 479 | |
| 480 | return File(fd, tmpChars.data()); |
| 481 | } |
| 482 | |
| 483 | Bundle |
| 484 | GetBundle(std::string const& bsn, BundleContext context) |
no test coverage detected