Lines Matching refs:state
917 struct rest_state *state = arg;
918 FTS *fts = state->fts;
925 if (state->parallel)
926 pthread_mutex_lock(&state->mutex);
928 if (state->ftsent_first) {
929 ftsent = state->ftsent_first;
930 state->ftsent_first = NULL;
938 if (state->flags.set_xdev &&
939 ftsent->fts_statp->st_dev != state->dev_num)
948 state->error = -1;
949 state->abort = true;
981 if (state->sfsb.f_type == SYSFS_MAGIC &&
993 if (state->setrestorecondigest) {
998 state->error) &&
999 !state->ignore_digest) {
1007 if (new_node && !state->error) {
1008 if (!state->current) {
1009 state->current = new_node;
1010 state->head = state->current;
1012 state->current->next = new_node;
1013 state->current = new_node;
1018 if (state->flags.skipelx && is_in_skip_elx(ftsent->fts_path)) {
1050 state->error = -1;
1051 state->abort = true;
1056 if (state->parallel)
1057 pthread_mutex_unlock(&state->mutex);
1059 error = restorecon_sb(ent_path, &ent_st, &state->flags,
1062 if (state->parallel) {
1063 pthread_mutex_lock(&state->mutex);
1064 if (state->abort)
1070 if (state->flags.abort_on_error) {
1071 state->error = error;
1072 state->abort = true;
1075 if (state->flags.count_errors)
1076 state->skipped_errors++;
1078 state->error = error;
1085 if (!state->saved_errno)
1086 state->saved_errno = errno;
1088 if (state->parallel)
1089 pthread_mutex_unlock(&state->mutex);
1097 struct rest_state state;
1099 state.flags.nochange = (restorecon_flags &
1101 state.flags.verbose = (restorecon_flags &
1103 state.flags.progress = (restorecon_flags &
1105 state.flags.mass_relabel = (restorecon_flags &
1107 state.flags.recurse = (restorecon_flags &
1109 state.flags.set_specctx = (restorecon_flags &
1111 state.flags.userealpath = (restorecon_flags &
1113 state.flags.set_xdev = (restorecon_flags &
1115 state.flags.add_assoc = (restorecon_flags &
1117 state.flags.abort_on_error = (restorecon_flags &
1119 state.flags.syslog_changes = (restorecon_flags &
1121 state.flags.log_matches = (restorecon_flags &
1123 state.flags.ignore_noent = (restorecon_flags &
1125 state.flags.warnonnomatch = true;
1126 state.flags.conflicterror = (restorecon_flags &
1130 state.ignore_digest = (restorecon_flags &
1132 state.flags.count_errors = (restorecon_flags &
1134 state.flags.skipelx = (restorecon_flags &
1136 state.setrestorecondigest = true;
1138 state.head = NULL;
1139 state.current = NULL;
1140 state.abort = false;
1141 state.error = 0;
1142 state.skipped_errors = 0;
1143 state.saved_errno = 0;
1151 if (state.flags.verbose && state.flags.progress)
1152 state.flags.verbose = false;
1165 state.setrestorecondigest = false;
1189 if (state.flags.userealpath) {
1200 if (state.flags.ignore_noent && errno == ENOENT) {
1216 if (state.flags.ignore_noent && errno == ENOENT) {
1241 if (state.flags.ignore_noent && errno == ENOENT) {
1256 state.setrestorecondigest = false;
1258 if (!state.flags.recurse) {
1264 error = restorecon_sb(pathname, &sb, &state.flags, true);
1269 memset(&state.sfsb, 0, sizeof(state.sfsb));
1270 if (!S_ISLNK(sb.st_mode) && statfs(pathname, &state.sfsb) < 0) {
1279 if (state.sfsb.f_type == RAMFS_MAGIC || state.sfsb.f_type == TMPFS_MAGIC ||
1280 state.sfsb.f_type == SYSFS_MAGIC)
1281 state.setrestorecondigest = false;
1283 if (state.flags.set_xdev)
1288 state.fts = fts_open(paths, fts_flags, NULL);
1289 if (!state.fts)
1292 state.ftsent_first = fts_read(state.fts);
1293 if (!state.ftsent_first)
1305 state.dev_num = state.ftsent_first->fts_statp->st_dev;
1313 state.parallel = false;
1314 selinux_restorecon_thread(&state);
1320 pthread_mutex_init(&state.mutex, NULL);
1326 state.parallel = true;
1333 selinux_restorecon_thread, &state)) {
1346 selinux_restorecon_thread(&state);
1357 pthread_mutex_destroy(&state.mutex);
1360 error = state.error;
1361 if (state.saved_errno)
1370 if (state.setrestorecondigest && !state.flags.nochange && !error &&
1371 state.skipped_errors == 0) {
1372 current = state.head;
1386 skipped_errors = state.skipped_errors;
1389 if (state.flags.progress && state.flags.mass_relabel)
1392 (void) fts_close(state.fts);
1393 errno = state.saved_errno;
1395 if (state.flags.add_assoc) {
1396 if (state.flags.verbose)
1403 current = state.head;