fix linux mkpath permissions

This commit is contained in:
2019-10-03 23:54:07 +02:00
parent 96f8cb72d2
commit c872d73dd7

View File

@@ -10,7 +10,7 @@
static App app;
glm::vec2 g_cursor_pos;
int mkpath(const std::string& dir, mode_t mode = ALLPERMS)
int mkpath(const std::string& dir, mode_t mode = DEFFILEMODE)
{
struct stat sb;
@@ -25,6 +25,7 @@ int mkpath(const std::string& dir, mode_t mode = ALLPERMS)
mkpath(dirname(strdupa(dir.c_str())), mode);
int ret = mkdir(dir.c_str(), mode);
chmod(dir.c_str(), S_IRWXU);
if (ret != 0)
LOG("mkdir failed with error %d on %s", errno, dir.c_str());
return ret;
@@ -107,6 +108,8 @@ int main(int argc, char** args)
printf("Vendor: %s\n", glGetString(GL_VENDOR));
glfwShowWindow(wnd);
umask(0);
App::I = &app;
app.initLog();
app.create();