fix linux mkpath permissions
This commit is contained in:
@@ -10,7 +10,7 @@
|
|||||||
static App app;
|
static App app;
|
||||||
glm::vec2 g_cursor_pos;
|
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;
|
struct stat sb;
|
||||||
|
|
||||||
@@ -25,6 +25,7 @@ int mkpath(const std::string& dir, mode_t mode = ALLPERMS)
|
|||||||
mkpath(dirname(strdupa(dir.c_str())), mode);
|
mkpath(dirname(strdupa(dir.c_str())), mode);
|
||||||
|
|
||||||
int ret = mkdir(dir.c_str(), mode);
|
int ret = mkdir(dir.c_str(), mode);
|
||||||
|
chmod(dir.c_str(), S_IRWXU);
|
||||||
if (ret != 0)
|
if (ret != 0)
|
||||||
LOG("mkdir failed with error %d on %s", errno, dir.c_str());
|
LOG("mkdir failed with error %d on %s", errno, dir.c_str());
|
||||||
return ret;
|
return ret;
|
||||||
@@ -107,6 +108,8 @@ int main(int argc, char** args)
|
|||||||
printf("Vendor: %s\n", glGetString(GL_VENDOR));
|
printf("Vendor: %s\n", glGetString(GL_VENDOR));
|
||||||
glfwShowWindow(wnd);
|
glfwShowWindow(wnd);
|
||||||
|
|
||||||
|
umask(0);
|
||||||
|
|
||||||
App::I = &app;
|
App::I = &app;
|
||||||
app.initLog();
|
app.initLog();
|
||||||
app.create();
|
app.create();
|
||||||
|
|||||||
Reference in New Issue
Block a user