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

Function cp_option_init

src/cp.c:882–932  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

880}
881
882static void
883cp_option_init (struct cp_options *x)
884{
885 cp_options_default (x);
886 x->copy_as_regular = true;
887 x->dereference = DEREF_UNDEFINED;
888 x->unlink_dest_before_opening = false;
889 x->unlink_dest_after_failed_open = false;
890 x->hard_link = false;
891 x->interactive = I_UNSPECIFIED;
892 x->move_mode = false;
893 x->install_mode = false;
894 x->one_file_system = false;
895 x->reflink_mode = REFLINK_AUTO;
896
897 x->preserve_ownership = false;
898 x->preserve_links = false;
899 x->preserve_mode = false;
900 x->preserve_timestamps = false;
901 x->explicit_no_preserve_mode = false;
902 x->preserve_security_context = false; /* -a or --preserve=context. */
903 x->require_preserve_context = false; /* --preserve=context. */
904 x->set_security_context = NULL; /* -Z, set sys default context. */
905 x->preserve_xattr = false;
906 x->reduce_diagnostics = false;
907 x->require_preserve_xattr = false;
908
909 x->data_copy_required = true;
910 x->require_preserve = false;
911 x->recursive = false;
912 x->sparse_mode = SPARSE_AUTO;
913 x->symbolic_link = false;
914 x->set_mode = false;
915 x->mode = 0;
916
917 /* Not used. */
918 x->stdin_tty = false;
919
920 x->update = UPDATE_ALL;
921 x->verbose = false;
922 x->keep_directory_symlink = false;
923
924 /* By default, refuse to open a dangling destination symlink, because
925 in general one cannot do that safely, give the current semantics of
926 open's O_EXCL flag, (which POSIX doesn't even allow cp to use, btw).
927 But POSIX requires it. */
928 x->open_dangling_dest_symlink = getenv ("POSIXLY_CORRECT") != NULL;
929
930 x->dest_info = NULL;
931 x->src_info = NULL;
932}
933
934/* Given a string, ARG, containing a comma-separated list of arguments
935 to the --preserve option, set the appropriate fields of X to ON_OFF. */

Callers 1

mainFunction · 0.70

Calls 1

cp_options_defaultFunction · 0.85

Tested by

no test coverage detected