ret = send_option_arg_callback_request(&query, cc->argc - i,
cc->argv + i, com_touch_callback, afs_cb_result_handler, cc);
if (ret < 0)
- sc_send_va_buffer(&cc->scc, "%s\n", para_strerror(-ret));
+ send_strerror(cc, -ret);
return ret;
}
ret = send_option_arg_callback_request(&query, cc->argc - i,
cc->argv + i, com_rm_callback, afs_cb_result_handler, cc);
if (ret < 0)
- sc_send_va_buffer(&cc->scc, "%s\n", para_strerror(-ret));
+ send_strerror(cc, -ret);
return ret;
}
ret = send_option_arg_callback_request(&options, cc->argc - i,
cc->argv + i, com_cpsi_callback, afs_cb_result_handler, cc);
if (ret < 0)
- sc_send_va_buffer(&cc->scc, "%s\n", para_strerror(-ret));
+ send_strerror(cc, -ret);
return ret;
}
}
ret = send_option_arg_callback_request(&options, cc->argc - i, cc->argv + i,
com_lsatt_callback, afs_cb_result_handler, cc);
+
if (!ret) {
if (cc->argc > 1)
ret = sc_send_va_buffer(&cc->scc, "no matches\n");
} else if (ret < 0)
- sc_send_va_buffer(&cc->scc, "%s\n", para_strerror(-ret));
+ send_strerror(cc, -ret);
return ret;
}
ret = send_standard_callback_request(cc->argc - 1, cc->argv + 1,
com_addatt_callback, afs_cb_result_handler, cc);
if (ret < 0)
- sc_send_va_buffer(&cc->scc, "%s\n", para_strerror(-ret));
+ send_strerror(cc, -ret);
return ret;
}
ret = send_standard_callback_request(cc->argc - 1, cc->argv + 1,
com_mvatt_callback, afs_cb_result_handler, cc);
if (ret < 0)
- sc_send_va_buffer(&cc->scc, "%s\n", para_strerror(-ret));
+ send_strerror(cc, -ret);
return ret;
}
ret = send_standard_callback_request(cc->argc - 1, cc->argv + 1,
com_rmatt_callback, afs_cb_result_handler, cc);
if (ret < 0)
- sc_send_va_buffer(&cc->scc, "%s\n", para_strerror(-ret));
+ send_strerror(cc, -ret);
return ret;
}
return send_sb(scc, msg, ret, band, false);
}
+int send_strerror(struct command_context *cc, int err)
+{
+ return sc_send_va_buffer(&cc->scc, "%s\n", para_strerror(err));
+}
+
/**
* Send a sideband packet through a blocking file descriptor.
*
if (ret >= 0)
goto out;
err_out:
- sc_send_va_buffer(&cc->scc, "%s\n", para_strerror(-ret));
+ send_strerror(cc, -ret);
net_err:
PARA_NOTICE_LOG("%s\n", para_strerror(-ret));
out:
int band, bool dont_free);
__printf_3_4 int send_sb_va(struct stream_cipher_context *scc, int band,
const char *fmt, ...);
+int send_strerror(struct command_context *cc, int err);
int recv_sb(struct stream_cipher_context *scc,
enum sb_designator expected_band,
size_t max_size, struct iovec *result);