Make ancestor directory DIR, whose last file name component is COMPONENT, with options OPTIONS. Assume the working directory is COMPONENT's parent. */
| 363 | COMPONENT, with options OPTIONS. Assume the working directory is |
| 364 | COMPONENT's parent. */ |
| 365 | static int |
| 366 | make_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. */ |
| 382 | static int |
nothing calls this directly
no test coverage detected