move unixDie() so it is generally available

pull/114/head
bert hubert 2020-04-26 12:24:45 +02:00
parent d1a5925af6
commit 71203b6bc8
3 changed files with 6 additions and 5 deletions

View File

@ -26,11 +26,6 @@ using namespace std;
extern const char* g_gitHash;
void unixDie(const std::string& str)
{
throw std::runtime_error(str+string(": ")+string(strerror(errno)));
}
time_t parseTime(std::string_view in)
{
time_t now=time(0);

View File

@ -351,3 +351,8 @@ size_t writen2(int fd, const void *buf, size_t count)
return count;
}
void unixDie(const std::string& reason)
{
throw std::runtime_error(reason+": "+strerror(errno));
}

View File

@ -78,3 +78,4 @@ double utcFromGPS(int wn, double tow);
std::string makeHexDump(const std::string& str);
size_t writen2(int fd, const void *buf, size_t count);
void unixDie(const std::string& reason);