MCPcopy Create free account
hub / github.com/coreutils/coreutils / make_ancestor

Function make_ancestor

src/install.c:365–379  ·  view source on GitHub ↗

Make ancestor directory DIR, whose last file name component is COMPONENT, with options OPTIONS. Assume the working directory is COMPONENT's parent. */

Source from the content-addressed store, hash-verified

363 COMPONENT, with options OPTIONS. Assume the working directory is
364 COMPONENT's parent. */
365static int
366make_ancestor (char const *dir, char const *component, void *options)
367{
368 struct cp_options const *x = options;
369 if (x->set_security_context
370 && defaultcon (x->set_security_context, component, S_IFDIR) < 0
371 && ! ignorable_ctx_err (errno))
372 error (0, errno, _("failed to set default creation context for %s"),
373 quoteaf (dir));
374
375 int r = mkdir (component, DEFAULT_MODE);
376 if (r == 0)
377 announce_mkdir (dir, options);
378 return r;
379}
380
381/* Process a command-line file name, for the -d option. */
382static int

Callers

nothing calls this directly

Calls 3

ignorable_ctx_errFunction · 0.85
defaultconFunction · 0.70
announce_mkdirFunction · 0.70

Tested by

no test coverage detected