static int master_output(struct auth_master_connection *conn)
{
- int ret;
-
- if ((ret = o_stream_flush(conn->output)) < 0) {
+ if (o_stream_flush(conn->output) < 0) {
/* transmit error, probably master died */
auth_master_connection_destroy(&conn);
return 1;
struct auth_stream_reply *reply)
{
const char **fields, *extra_fields;
- unsigned int src, dest;
+ unsigned int src;
bool seen_pass = FALSE;
if (auth_stream_is_empty(request->extra_fields))
}
fields = t_strsplit(extra_fields, "\t");
- for (src = dest = 0; fields[src] != NULL; src++) {
+ for (src = 0; fields[src] != NULL; src++) {
if (strncmp(fields[src], "userdb_", 7) != 0) {
if (!seen_pass && strncmp(fields[src], "pass=", 5) == 0)
seen_pass = TRUE;
static bool listen_has_port(const char *str)
{
- const char *p, *const *addrs;
+ const char *const *addrs;
- if ((p = strchr(str, ':')) == NULL)
+ if (strchr(str, ':') == NULL)
return FALSE;
addrs = t_strsplit_spaces(str, ", ");
{
string_t *str;
const char *key, *value;
- int ret;
str = t_str_new(256);
o_stream_cork(conn->output);
o_stream_unset_flush_callback(conn->output);
str_truncate(str, 0);
- if ((ret = dict_iterate_deinit(&conn->iter_ctx)) < 0)
+ if (dict_iterate_deinit(&conn->iter_ctx) < 0)
str_append_c(str, DICT_PROTOCOL_REPLY_FAIL);
str_append_c(str, '\n');
o_stream_send(conn->output, str_data(str), str_len(str));
break;
}
case MAIL_TRANSACTION_UID_UPDATE: {
- const struct mail_transaction_uid_update *rec = data, *end;
+ const struct mail_transaction_uid_update *rec, *end;
end = CONST_PTR_OFFSET(data, size);
for (rec = data; rec < end; rec++) {
break;
}
case MAIL_TRANSACTION_MODSEQ_UPDATE: {
- const struct mail_transaction_modseq_update *rec = data, *end;
+ const struct mail_transaction_modseq_update *rec, *end;
end = CONST_PTR_OFFSET(data, size);
for (rec = data; rec < end; rec++) {
struct client *client = cmd->client;
struct mailbox *mailbox = client->mailbox;
struct mail_storage *storage;
- int ret;
if (!client_verify_open_mailbox(cmd))
return TRUE;
client->mailbox = NULL;
storage = mailbox_get_storage(mailbox);
- if ((ret = imap_expunge(mailbox, NULL)) < 0)
+ if (imap_expunge(mailbox, NULL) < 0)
client_send_untagged_storage_error(client, storage);
if (mailbox_sync(mailbox, 0) < 0)
client_send_untagged_storage_error(client, storage);
const struct mailbox_info *info;
struct mail_namespace *ns;
enum mailbox_info_flags flags;
- string_t *str, *name_str;
+ string_t *str;
const char *name;
int ret = 0;
str = t_str_new(256);
- name_str = t_str_new(256);
while ((info = mailbox_list_iter_next(ctx->list_iter)) != NULL) {
name = info->name;
flags = info->flags;
const ARRAY_TYPE(seq_range) *seqset,
const ARRAY_TYPE(seq_range) *uidset)
{
- const struct seq_range *seq_range, *uid_range;
+ const struct seq_range *uid_range;
struct seq_range_iter seq_iter;
- unsigned int i, seq_count, uid_count, diff, n = 0;
+ unsigned int i, uid_count, diff, n = 0;
uint32_t seq;
/* change all n:m ranges to n,m and store the results */
- seq_range = array_get(seqset, &seq_count);
uid_range = array_get(uidset, &uid_count);
seq_range_array_iter_init(&seq_iter, seqset);
static bool cmd_select_continue(struct client_command_context *cmd)
{
struct imap_select_context *ctx = cmd->context;
- int ret;
- if ((ret = imap_fetch_more(ctx->fetch_ctx)) == 0) {
+ if (imap_fetch_more(ctx->fetch_ctx) == 0) {
/* unfinished */
return FALSE;
}
client_send_command_error(cmd, "Sort list ends with REVERSE.");
return -1;
}
- program[pos++] = MAIL_SORT_END;
+ program[pos] = MAIL_SORT_END;
if (args->type != IMAP_ARG_EOL) {
client_send_command_error(cmd,
{
struct client *client = cmd->client;
struct mailbox *mailbox = client->mailbox;
- struct mail_storage *storage;
if (!client_verify_open_mailbox(cmd))
return TRUE;
i_assert(client->mailbox_change_lock == NULL);
client->mailbox = NULL;
- storage = mailbox_get_storage(mailbox);
mailbox_free(&mailbox);
client_update_mailbox_flags(client, NULL);
if (ret > 0 && size >= 5 && memcmp(data, "From ", 5) == 0) {
/* skip until the first LF */
i_stream_skip(input, 5);
- while ((ret = i_stream_read_data(input, &data, &size, 0)) > 0) {
+ while (i_stream_read_data(input, &data, &size, 0) > 0) {
for (i = 0; i < size; i++) {
if (data[i] == '\n')
break;
*dest++ = *pattern++;
}
}
- *dest++ = '\0';
+ *dest = '\0';
return ret;
}
struct mail_cache *cache = ctx->cache;
int ret;
- if ((ret = mail_cache_transaction_lock(ctx)) <= 0) {
+ if (mail_cache_transaction_lock(ctx) <= 0) {
if (MAIL_CACHE_IS_UNUSABLE(cache))
return -1;
return 0;
/* need to add it */
- if ((ret = mail_cache_transaction_lock(ctx)) <= 0)
+ if (mail_cache_transaction_lock(ctx) <= 0)
return -1;
}
sync_ext_reorder(map, ext_map_idx, old_record_size);
} else if (modified) {
/* header size changed. recreate index file. */
- map = mail_index_sync_get_atomic_map(ctx);
+ (void)mail_index_sync_get_atomic_map(ctx);
}
}
const struct mail_index_ext_header *ext_hdr,
uint32_t *ext_map_idx_r)
{
- struct mail_index_map *map = ctx->view->map;
+ struct mail_index_map *map;
const struct mail_index_ext *ext;
buffer_t *hdr_buf;
uint32_t ext_map_idx;
int mail_index_sync_ext_reset(struct mail_index_sync_map_ctx *ctx,
const struct mail_transaction_ext_reset *u)
{
- struct mail_index_map *map = ctx->view->map;
+ struct mail_index_map *map;
struct mail_index_ext_header *ext_hdr;
struct mail_index_ext *ext;
static void
sync_expunge(struct mail_index_sync_map_ctx *ctx, uint32_t uid1, uint32_t uid2)
{
- struct mail_index_map *map = ctx->view->map;
+ struct mail_index_map *map;
struct mail_index_record *rec;
uint32_t seq_count, seq, seq1, seq2;
break;
}
case MAIL_TRANSACTION_EXT_HDR_UPDATE: {
- const struct mail_transaction_ext_hdr_update *rec = data;
+ const struct mail_transaction_ext_hdr_update *rec;
unsigned int i;
for (i = 0; i < hdr->size; ) {
break;
}
case MAIL_TRANSACTION_EXT_HDR_UPDATE32: {
- const struct mail_transaction_ext_hdr_update32 *rec = data;
+ const struct mail_transaction_ext_hdr_update32 *rec;
unsigned int i;
for (i = 0; i < hdr->size; ) {
break;
}
- rec = data;
end = CONST_PTR_OFFSET(data, hdr->size);
for (rec = data; rec < end; rec++) {
ret = mail_index_sync_ext_atomic_inc(ctx, rec);
break;
}
case MAIL_TRANSACTION_UID_UPDATE: {
- const struct mail_transaction_uid_update *rec = data, *end;
+ const struct mail_transaction_uid_update *rec, *end;
end = CONST_PTR_OFFSET(data, hdr->size);
for (rec = data; rec < end; rec++)
enum mail_index_view_sync_flags flags)
{
struct mail_index_view_sync_ctx *ctx;
- struct mail_index_map *map;
+ struct mail_index_map *tmp_map;
unsigned int expunge_count = 0;
bool reset, sync_expunges, have_expunges;
int ret;
ctx->sync_map_update = TRUE;
if (view->map->refcount > 1) {
- map = mail_index_map_clone(view->map);
+ tmp_map = mail_index_map_clone(view->map);
mail_index_unmap(&view->map);
- view->map = map;
- } else {
- map = view->map;
+ view->map = tmp_map;
}
if (sync_expunges) {
return;
keyword_idx_map = array_get(&map->keyword_idx_map, &keyword_count);
- for (i = 0, idx = 0; i < record_size; i++) {
+ for (i = 0; i < record_size; i++) {
/* first do the quick check to see if there's keywords at all */
if (data[i] == 0)
continue;
*cur_modseq += 1;
break;
case MAIL_TRANSACTION_MODSEQ_UPDATE: {
- const struct mail_transaction_modseq_update *rec = data, *end;
+ const struct mail_transaction_modseq_update *rec, *end;
end = CONST_PTR_OFFSET(data, trans_size - sizeof(*hdr));
for (rec = data; rec < end; rec++) {
const unsigned char *data;
const char *return_path;
size_t size;
- int ret;
if (mail_get_stream(ctx->src_mail, NULL, NULL, &input) < 0)
return -1;
N_ELEMENTS(hide_headers),
null_header_filter_callback, NULL);
- while ((ret = i_stream_read_data(input, &data, &size, 0)) > 0) {
+ while (i_stream_read_data(input, &data, &size, 0) > 0) {
if (fwrite(data, size, 1, f) == 0)
break;
i_stream_skip(input, size);
size_t pos, start_pos, ret;
/* =?charset?Q|B?text?= */
- start_pos = pos = 0;
+ start_pos = 0;
for (pos = 0; pos + 1 < size; ) {
if (data[pos] != '=' || data[pos+1] != '?') {
pos++;
{
struct message_header_line *line = &ctx->line;
const unsigned char *msg;
- size_t i, size, startpos, colon_pos, parse_size, value_pos;
+ size_t i, size, startpos, colon_pos, parse_size;
int ret;
bool continued, continues, last_no_newline, last_crlf;
bool no_newline, crlf_newline;
buffer_append_c(ctx->value_buf, '\r');
buffer_append_c(ctx->value_buf, '\n');
}
- value_pos = ctx->value_buf->used;
if ((ctx->flags & MESSAGE_HEADER_PARSER_FLAG_CLEAN_ONELINE) &&
line->value_len > 0 && line->value[0] != ' ' &&
IS_LWSP(line->value[0])) {
unsigned int output_len = strlen(output);
const unsigned char *data;
size_t size;
- ssize_t ret;
test_begin("i_stream_create_header_filter()");
istream = test_istream_create(input);
i_stream_skip(filter, size);
i_stream_seek(filter, 0);
- while ((ret = i_stream_read(filter)) > 0) ;
+ while (i_stream_read(filter) > 0) ;
data = i_stream_get_data(filter, &size);
test_assert(size == output_len && memcmp(data, output, size) == 0);
cydir_save_alloc(struct mailbox_transaction_context *t)
{
struct cydir_mailbox *mbox = (struct cydir_mailbox *)t->box;
- struct cydir_save_context *ctx =
- (struct cydir_save_context *)t->save_ctx;
+ struct cydir_save_context *ctx;
i_assert((t->flags & MAILBOX_TRANSACTION_FLAG_EXTERNAL) != 0);
orig_offset = input->v_offset;
while ((ret = i_stream_read_data(input, &data, &size, 0)) > 0) {
pre_offset = (uoff_t)-1;
- post_offset = (uoff_t)-1;
if (str_find_more(pre_ctx, data, size)) {
pre_offset = input->v_offset +
str_find_get_match_end_pos(pre_ctx) -
int dbox_file_fix(struct dbox_file *file, uoff_t start_offset)
{
struct ostream *output;
- const char *dir, *fname, *temp_path, *broken_path;
+ const char *dir, *p, *temp_path, *broken_path;
bool deleted;
int fd, ret;
i_assert(dbox_file_is_open(file));
- fname = strrchr(file->cur_path, '/');
- i_assert(fname != NULL);
- dir = t_strdup_until(file->cur_path, fname);
- fname++;
+ p = strrchr(file->cur_path, '/');
+ i_assert(p != NULL);
+ dir = t_strdup_until(file->cur_path, p);
temp_path = t_strdup_printf("%s/%s", dir, dbox_generate_tmp_filename());
fd = file->storage->v.file_create_fd(file, temp_path, FALSE);
void mdbox_file_unrefed(struct dbox_file *file)
{
struct mdbox_file *mfile = (struct mdbox_file *)file;
- struct mdbox_file *const *files, *oldest_file;
+ struct mdbox_file *oldest_file;
unsigned int i, count;
/* don't cache metadata seeks while file isn't being referenced */
mfile->close_time = ioloop_time;
if (mfile->file_id != 0) {
- files = array_get(&mfile->storage->open_files, &count);
+ count = array_count(&mfile->storage->open_files);
if (!file->deleted && count <= MDBOX_MAX_OPEN_UNUSED_FILES) {
/* we can leave this file open for now */
mdbox_file_close_later(mfile);
{
struct index_mail *mail = (struct index_mail *)_mail;
struct message_block block;
- int ret;
- while ((ret = message_parser_parse_next_block(mail->data.parser_ctx,
- &block)) > 0) {
+ while (message_parser_parse_next_block(mail->data.parser_ctx,
+ &block) > 0) {
if (block.size != 0)
continue;
pointers though. */
new_first_invalid = new_count + 1 +
THREAD_INVALID_MSGID_STR_IDX_SKIP_COUNT;
- i = cache->first_invalid_msgid_str_idx;
for (i = 0; i < invalid_count; i++) {
node = array_idx_modifiable(&new_nodes, new_first_invalid + i);
*node = old_nodes[cache->first_invalid_msgid_str_idx + i];
return &ctx->ctx;
}
-struct maildir_filename *
-maildir_save_add(struct mail_save_context *_ctx, const char *base_fname,
- bool preserve_filename)
+void maildir_save_add(struct mail_save_context *_ctx, const char *base_fname,
+ bool preserve_filename)
{
struct maildir_save_context *ctx = (struct maildir_save_context *)_ctx;
struct maildir_filename *mf;
ctx->input = input;
ctx->cur_dest_mail = _ctx->dest_mail;
}
- return mf;
}
static bool
int maildir_save_begin(struct mail_save_context *_ctx, struct istream *input)
{
struct maildir_save_context *ctx = (struct maildir_save_context *)_ctx;
- struct maildir_filename *mf;
T_BEGIN {
/* create a new file in tmp/ directory */
ctx->input = i_stream_create_crlf(input);
else
ctx->input = i_stream_create_lf(input);
- mf = maildir_save_add(_ctx, fname, fname == _ctx->guid);
+ maildir_save_add(_ctx, fname, fname == _ctx->guid);
}
} T_END;
{
struct maildir_filename *mf;
bool newdir, new_changed, cur_changed;
- int ret = 0;
+ int ret;
*last_mf_r = NULL;
- ret = 0;
new_changed = cur_changed = FALSE;
for (mf = ctx->files; mf != NULL; mf = mf->next) {
T_BEGIN {
void maildir_save_add_conflict(struct mailbox_transaction_context *t,
uint32_t old_uid, uint32_t new_uid);
-struct maildir_filename *
-maildir_save_add(struct mail_save_context *_ctx, const char *base_fname,
- bool preserve_filename);
+void maildir_save_add(struct mail_save_context *_ctx, const char *base_fname,
+ bool preserve_filename);
const char *maildir_save_file_get_path(struct mailbox_transaction_context *t,
uint32_t seq);
unsigned int i = 0, move_count = 0;
time_t now;
int ret = 1;
- bool move_new, check_touch, dir_changed = FALSE;
+ bool move_new, dir_changed = FALSE;
path = new_dir ? ctx->new_dir : ctx->cur_dir;
for (i = 0;; i++) {
if (dp->d_name[0] == '.')
continue;
- check_touch = FALSE;
flags = 0;
if (move_new) {
str_truncate(src, 0);
static void maildir_sync_update_next_uid(struct maildir_mailbox *mbox)
{
const struct mail_index_header *hdr;
- uint32_t uid_validity, next_uid;
+ uint32_t uid_validity;
hdr = mail_index_get_header(mbox->box.view);
if (hdr->uid_validity == 0)
return;
uid_validity = maildir_uidlist_get_uid_validity(mbox->uidlist);
- next_uid = maildir_uidlist_get_next_uid(mbox->uidlist);
-
if (uid_validity == hdr->uid_validity || uid_validity == 0) {
/* make sure uidlist's next_uid is at least as large as
index file's. typically this happens only if uidlist gets
stream->skip = 0;
stream->buffer = NULL;
- ret = 0;
do {
buf = i_stream_get_data(stream->parent, &pos);
if (pos > 1 && stream->istream.v_offset + pos >
static int mbox_lock_flock(struct mbox_lock_context *ctx, int lock_type,
time_t max_wait_time)
{
- time_t now, last_notify;
+ time_t now;
unsigned int next_alarm;
if (mbox_file_open_latest(ctx, lock_type) < 0)
alarm(I_MIN(max_wait_time - now, 5));
}
- last_notify = 0;
while (flock(ctx->mbox->mbox_fd, lock_type) < 0) {
if (errno != EINTR) {
if (errno == EWOULDBLOCK && max_wait_time == 0) {
static int mbox_lock_lockf(struct mbox_lock_context *ctx, int lock_type,
time_t max_wait_time)
{
- time_t now, last_notify;
+ time_t now;
unsigned int next_alarm;
if (mbox_file_open_latest(ctx, lock_type) < 0)
lock_type = F_LOCK;
}
- last_notify = 0;
while (lockf(ctx->mbox->mbox_fd, lock_type, 0) < 0) {
if (errno != EINTR) {
if ((errno == EACCES || errno == EAGAIN) &&
if ((flags & flags_list[i].flag) != 0)
str_append_c(str, flags_list[i].chr);
}
- flags ^= MBOX_NONRECENT_KLUDGE;
}
static void mbox_save_append_flag_headers(string_t *str, enum mail_flags flags)
/* @UNSAFE */
data = buffer_get_space_unsafe(ctx->header, pos, need);
- for (i = 0, need = 0; flags_list[i].chr != 0; i++) {
+ for (i = 0; flags_list[i].chr != 0; i++) {
if ((ctx->mail.flags & flags_list[i].flag) != 0)
*data++ = flags_list[i].chr;
}
static void mbox_sync_add_missing_headers(struct mbox_sync_mail_context *ctx)
{
- size_t old_hdr_size, new_hdr_size, startpos;
+ size_t new_hdr_size, startpos;
- old_hdr_size = ctx->body_offset - ctx->hdr_offset;
new_hdr_size = str_len(ctx->header);
-
if (new_hdr_size > 0 &&
str_data(ctx->header)[new_hdr_size-1] != '\n') {
/* broken header - doesn't end with \n. fix it. */
const char *newname, bool rename_children)
{
struct mail_storage *oldstorage;
- const char *oldpath, *newpath, *alt_oldpath, *alt_newpath, *root_path;
+ const char *oldpath, *newpath, *alt_newpath, *root_path;
const char *p, *origin;
enum mailbox_list_path_type path_type, alt_path_type;
struct stat st;
oldpath = mailbox_list_get_path(oldlist, oldname, path_type);
newpath = mailbox_list_get_path(newlist, newname, path_type);
- alt_oldpath = mailbox_list_get_path(oldlist, oldname, alt_path_type);
alt_newpath = mailbox_list_get_path(newlist, newname, alt_path_type);
root_path = mailbox_list_get_path(oldlist, NULL,
const char **error_r)
{
struct setting_parser_context *set_parser = user->set_parser;
- const char *const *str, *p, *line, *key;
+ const char *const *str, *line, *key;
unsigned int i, count;
bool mail_debug;
int ret = 0;
}
#endif
} else T_BEGIN {
- if ((p = strchr(str[i], '=')) == NULL)
+ if (strchr(str[i], '=') == NULL)
line = t_strconcat(str[i], "=yes", NULL);
else
line = str[i];
mail_storage_service_init_log(struct master_service *service,
struct mail_storage_service_user *user)
{
- const struct mail_user_settings *user_set;
-
- user_set = master_service_settings_get_others(service)[0];
T_BEGIN {
string_t *str;
{
struct termios old_tio, tio;
bool restore_tio = FALSE;
- ssize_t ret;
size_t pos;
char ch;
int fd;
/* read the password */
pos = 0;
- while ((ret = read(fd, &ch, 1)) > 0) {
+ while (read(fd, &ch, 1) > 0) {
if (pos >= buf_size-1)
break;
if (ch == '\n' || ch == '\r')
/* set the last byte */
if (size > 0) {
- mask = 0;
for (i = 0, mask = 0; i < size; i++)
mask |= 1 << i;
*bits &= ~mask;
lock_info.wait_usecs += lock_info.wait_usecs/2;
}
dotlock_wait(&lock_info);
- do_wait = FALSE;
}
ret = check_lock(now, &lock_info);
break;
}
- do_wait = TRUE;
if (last_notify != now && set->callback != NULL) {
last_notify = now;
change_secs = now - lock_info.last_change;
}
}
+ do_wait = TRUE;
now = time(NULL);
} while (now < max_wait_time);
int home_try_expand(const char **_path)
{
const char *path = *_path;
- const char *home, *p, *orig_path;
+ const char *home, *p;
struct passwd *pw;
if (path == NULL || *path != '~')
return 0;
- orig_path = path++;
+ path++;
if (*path == '/' || *path == '\0') {
home = getenv("HOME");
if (*path != '\0') path++;
tee_streams_skip(tstream->tee);
ret = i_stream_read(input);
if (ret <= 0) {
- data = i_stream_get_data(input, &size);
+ (void)i_stream_get_data(input, &size);
if (ret == -2 && stream->skip != 0) {
/* someone else is holding the data,
wait for it */
/* somewhere in the middle, array is sorted so find it with
binary search */
- idx = 0; left_idx = 0; right_idx = count;
+ left_idx = 0; right_idx = count;
while (left_idx < right_idx) {
idx = (left_idx + right_idx) / 2;
size_t start = 0, i = 0;
while (i < src_size) {
- start = i;
for (; i < src_size; i++) {
if (src_c[i] == '\\')
break;
size_t start = 0, i = 0;
while (i < src_size) {
- start = i;
for (; i < src_size; i++) {
if (src_c[i] == '\001')
break;
dstsize--;
}
- *dest++ = '\0';
+ *dest = '\0';
return *src == '\0' ? 0 : -1;
}
static void client_auth_input(struct client *client)
{
- int ret;
-
- if ((ret = client->v.auth_parse_response(client)) <= 0)
+ if (client->v.auth_parse_response(client) <= 0)
return;
client_set_auth_waiting(client);
static const char *ssl_last_error(void)
{
- unsigned long err, err2;
+ unsigned long err;
const char *data;
int flags;
err = ERR_get_error_line_data(NULL, NULL, &data, &flags);
- while (err != 0 && (err2 = ERR_peek_error()) != 0) {
+ while (err != 0 && ERR_peek_error() != 0) {
i_error("SSL: Stacked error: %s",
ssl_err2str(err, data, flags));
err = ERR_get_error();
}
i_assert(child_process_env_idx <
sizeof(child_process_env) / sizeof(child_process_env[0]));
- child_process_env[child_process_env_idx++] = NULL;
+ child_process_env[child_process_env_idx] = NULL;
/* create service structures from settings. if there are any errors in
service configuration we'll catch it here. */
/* first child */
node->children.data = i_malloc(new_size);
trie->node_alloc_size += new_size;
- children = NODE_CHILDREN_NODES(node);
} else {
old_size = NODE_CHILDREN_ALLOC_SIZE(old_child_count);
if (old_size != new_size) {
const char **error_r)
{
struct mailbox *box;
- struct mail_storage *storage;
enum mail_error error;
box = mailbox_alloc(list, name, MAILBOX_FLAG_KEEP_RECENT |
}
/* try creating and re-opening it. */
- storage = mail_namespace_get_default_storage(list->ns);
if (mailbox_create(box, NULL, FALSE) < 0 ||
mailbox_open(box) < 0) {
*error_r = mail_storage_get_last_error(mailbox_get_storage(box),
static int client_output(struct client *client)
{
- int ret;
-
- if ((ret = o_stream_flush(client->output)) < 0) {
+ if (o_stream_flush(client->output) < 0) {
client_destroy(client, NULL);
return 1;
}
{
struct dotlock *dotlock;
unsigned int timeout;
- pid_t pid, parent_pid;
+ pid_t pid;
int fd[2], ret;
char c;
" - SIGTERM will release the lock.\n");
return 1;
}
- parent_pid = getpid();
if (pipe(fd) != 0) {
fprintf(stderr, "pipe() failed: %s", strerror(errno));
return 1;