ret = get_afsi_object_of_row(row, &obj);
if (ret < 0) {
- para_printf(&tad->pb, "%s: %s\n", name, para_strerror(-ret));
+ para_printf(&tad->pb, "cannot touch %s\n", name);
return ret;
}
ret = load_afsi(&old_afsi, &obj);
if (ret < 0) {
- para_printf(&tad->pb, "%s: %s\n", name, para_strerror(-ret));
+ para_printf(&tad->pb, "cannot touch %s\n", name);
return ret;
}
new_afsi = old_afsi;
if (tad.cto->flags & TOUCH_FLAG_FNM_PATHNAME)
pmd.fnmatch_flags |= FNM_PATHNAME;
ret = for_each_matching_row(&pmd);
- if (ret < 0)
- para_printf(&tad.pb, "%s\n", para_strerror(-ret));
- else if (pmd.num_matches == 0)
- para_printf(&tad.pb, "no matches\n");
+ if (ret >= 0 && pmd.num_matches == 0)
+ ret = -E_NO_MATCH;
flush_and_free_pb(&tad.pb);
- return 0;
+ return ret;
}
int com_touch(struct command_context *cc)
}
if (i >= cc->argc)
return -E_AFT_SYNTAX;
- ret = send_option_arg_callback_request(&query, cc->argc - i,
+ return send_option_arg_callback_request(&query, cc->argc - i,
cc->argv + i, com_touch_callback, afs_cb_result_handler, cc);
- if (ret < 0)
- send_strerror(cc, -ret);
- return ret;
}
/** Flags for com_rm(). */