aboutsummaryrefslogtreecommitdiffstats
path: root/src/main.c
diff options
context:
space:
mode:
authorRafael G. Martins <rafael@rafaelmartins.eng.br>2015-10-11 22:22:27 -0300
committerRafael G. Martins <rafael@rafaelmartins.eng.br>2015-10-11 22:22:27 -0300
commit9aec1f36e80af5c06cb690bda125c628e26e5601 (patch)
tree4a3d379c8bf0a19732e6727ff05c6291d2ec424f /src/main.c
parentcadc1a67e613ad9071ac7b37bd41cefa042eacab (diff)
downloadblogc-9aec1f36e80af5c06cb690bda125c628e26e5601.tar.gz
blogc-9aec1f36e80af5c06cb690bda125c628e26e5601.tar.bz2
blogc-9aec1f36e80af5c06cb690bda125c628e26e5601.zip
main: no need to honor umask manually
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c9
1 files changed, 1 insertions, 8 deletions
diff --git a/src/main.c b/src/main.c
index 1847163..3b2a9ef 100644
--- a/src/main.c
+++ b/src/main.c
@@ -70,14 +70,7 @@ blogc_print_usage(void)
static void
blogc_mkdir_recursive(const char *filename)
{
-#if defined(HAVE_SYS_STAT_H) && defined(HAVE_SYS_TYPES_H)
- // honor umask if possible
- mode_t m = umask(0);
- umask(m);
- mode_t mode = (S_IRWXU | S_IRWXG | S_IRWXO) & ~m;
-#endif
char *fname = b_strdup(filename);
-
for (char *tmp = fname; *tmp != '\0'; tmp++) {
if (*tmp != '/' && *tmp != '\\')
continue;
@@ -85,7 +78,7 @@ blogc_mkdir_recursive(const char *filename)
char bkp = *tmp;
*tmp = '\0';
if ((strlen(fname) > 0) &&
- (-1 == mkdir(fname, mode)) &&
+ (-1 == mkdir(fname, 0777)) &&
(errno != EEXIST))
{
fprintf(stderr, "blogc: error: failed to create output "