mkdir(1): umask() is now in place
This commit is contained in:
parent
6247f23d73
commit
5eaafe2a15
@ -1,5 +1,6 @@
|
|||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
#include <err.h>
|
||||||
|
|
||||||
int main(int argc, char **argv) {
|
int main(int argc, char **argv) {
|
||||||
if (argc <= 1) {
|
if (argc <= 1) {
|
||||||
@ -11,9 +12,9 @@ int main(int argc, char **argv) {
|
|||||||
int ores;
|
int ores;
|
||||||
|
|
||||||
for (int i = 1; i < argc; ++i) {
|
for (int i = 1; i < argc; ++i) {
|
||||||
ores = mkdir(argv[i], 0755);
|
ores = mkdir(argv[i], 0777);
|
||||||
if (ores != 0) {
|
if (ores != 0) {
|
||||||
perror(argv[i]);
|
warn("mkdir(%s)", argv[i]);
|
||||||
}
|
}
|
||||||
res += ores;
|
res += ores;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user