[CONTAINER_FORMAT_AU] = &container_parser_au,
[CONTAINER_FORMAT_VOC] = &container_parser_voc,
};
+ int fd;
const struct container_parser *parser;
unsigned int size;
int i;
// Open a target descriptor.
if (!strcmp(path, "-")) {
- cntr->fd = fileno(stdin);
+ fd = fileno(stdin);
} else {
- cntr->fd = open(path, O_RDONLY);
- if (cntr->fd < 0)
+ fd = open(path, O_RDONLY);
+ if (fd < 0)
return -errno;
}
+ cntr->fd = fd;
cntr->stdio = (cntr->fd == fileno(stdin));
if (cntr->stdio) {
[CONTAINER_FORMAT_VOC] = &container_builder_voc,
[CONTAINER_FORMAT_RAW] = &container_builder_raw,
};
+ int fd;
const struct container_builder *builder;
int err;
if (path == NULL || *path == '\0')
return -EINVAL;
if (!strcmp(path, "-")) {
- cntr->fd = fileno(stdout);
+ fd = fileno(stdout);
} else {
- cntr->fd = open(path, O_RDWR | O_CREAT | O_TRUNC, 0644);
- if (cntr->fd < 0)
+ fd = open(path, O_RDWR | O_CREAT | O_TRUNC, 0644);
+ if (fd < 0)
return -errno;
}
+ cntr->fd = fd;
cntr->stdio = (cntr->fd == fileno(stdout));
if (cntr->stdio) {