init: fix /tmp permissions on zram
[project/procd.git] / initd / zram.c
index 4dc1d2e..9fab794 100644 (file)
@@ -44,7 +44,7 @@ proc_meminfo(void)
        fclose(fp);
 
        if (val > KB(32))
        fclose(fp);
 
        if (val > KB(32))
-               val = KB(16);
+               val = KB(32);
 
        return val;
 }
 
        return val;
 }
@@ -124,5 +124,11 @@ mount_zram_on_tmp(void)
 
        LOG("Using up to %ld kB of RAM as ZRAM storage on /mnt\n", zramsize);
 
 
        LOG("Using up to %ld kB of RAM as ZRAM storage on /mnt\n", zramsize);
 
+       ret = chmod("/tmp", 01777);
+       if (ret < 0) {
+               ERROR("Can't set /tmp mode to 1777: %s\n", strerror(errno));
+               return errno;
+       }
+
        return 0;
 }
        return 0;
 }