MCPcopy Create free account
hub / github.com/dmtcp/dmtcp / safeMkdir

Method safeMkdir

src/util_exec.cpp:112–126  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

110}
111
112int
113Util::safeMkdir(const char *pathname, mode_t mode)
114{
115 // If it exists and we can give it the right permissions, do it.
116 chmod(pathname, 0700);
117 if (isdir0700(pathname)) {
118 return 0;
119 }
120
121 // else start over
122 unlink(pathname);
123 rmdir(pathname); // Maybe it was an empty directory
124 mkdir(pathname, 0700);
125 return isdir0700(pathname);
126}
127
128int
129Util::safeSystem(const char *command)

Callers

nothing calls this directly

Calls 1

isdir0700Function · 0.85

Tested by

no test coverage detected