Use hc_path_create() for additional write checks on startup

This commit is contained in:
jsteube
2017-01-28 00:08:12 +01:00
parent 322862f8dc
commit 2d2eadd2f6
3 changed files with 57 additions and 0 deletions

View File

@@ -242,6 +242,17 @@ bool hc_path_write (const char *path)
return true;
}
bool hc_path_create (const char *path)
{
if (hc_path_exist (path) == true) return false;
if (creat (path, O_CREAT) == -1) return false;
unlink (path);
return true;
}
void setup_environment_variables ()
{
char *compute = getenv ("COMPUTE");