prepare_ls_row);
if (ret < 0)
goto out;
- ret = opts->num_patterns? -E_NO_MATCH : 1;
+ ret = opts->num_patterns? -E_NO_MATCH : 0;
if (!opts->num_matching_paths) {
PARA_NOTICE_LOG("no match, ret: %d\n", ret);
goto out;
ret = 1;
out:
ls_output->data = b.buf;
+ PARA_NOTICE_LOG("ls_outoute.data: %p\n", ls_output->data);
ls_output->size = b.size;
free(opts->data);
free(opts->data_ptr);
opts.num_patterns = argc - i;
ret = send_option_arg_callback_request(&query, opts.num_patterns,
argv + i, com_ls_callback, &ls_output);
- if (ret >= 0 && ls_output.data) {
- send_buffer(fd, (char *)ls_output.data);
+ if (ret > 0) {
+ ret = send_buffer(fd, (char *)ls_output.data);
free(ls_output.data);
}
return ret;