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

Function cp_option_init

src/mv.c:120–161  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

118}
119
120static void
121cp_option_init (struct cp_options *x)
122{
123 bool selinux_enabled = (0 < is_selinux_enabled ());
124
125 cp_options_default (x);
126 x->copy_as_regular = false; /* FIXME: maybe make this an option */
127 x->reflink_mode = REFLINK_AUTO;
128 x->dereference = DEREF_NEVER;
129 x->unlink_dest_before_opening = false;
130 x->unlink_dest_after_failed_open = false;
131 x->hard_link = false;
132 x->interactive = I_UNSPECIFIED;
133 x->move_mode = true;
134 x->install_mode = false;
135 x->one_file_system = false;
136 x->preserve_ownership = true;
137 x->preserve_links = true;
138 x->preserve_mode = true;
139 x->preserve_timestamps = true;
140 x->explicit_no_preserve_mode= false;
141 x->preserve_security_context = selinux_enabled;
142 x->set_security_context = NULL;
143 x->reduce_diagnostics = false;
144 x->data_copy_required = true;
145 x->require_preserve = false; /* FIXME: maybe make this an option */
146 x->require_preserve_context = false;
147 x->preserve_xattr = true;
148 x->require_preserve_xattr = false;
149 x->recursive = true;
150 x->sparse_mode = SPARSE_AUTO; /* FIXME: maybe make this an option */
151 x->symbolic_link = false;
152 x->set_mode = false;
153 x->mode = 0;
154 x->stdin_tty = isatty (STDIN_FILENO);
155
156 x->open_dangling_dest_symlink = false;
157 x->update = UPDATE_ALL;
158 x->verbose = false;
159 x->dest_info = NULL;
160 x->src_info = NULL;
161}
162
163/* Move SOURCE onto DEST aka DEST_DIRFD+DEST_RELNAME.
164 Handle cross-file-system moves.

Callers 1

mainFunction · 0.70

Calls 1

cp_options_defaultFunction · 0.85

Tested by

no test coverage detected