while (count > 0) {
ssize_t loaded = xread(fd, p, count);
- if (loaded <= 0)
- return total ? total : loaded;
+ if (loaded < 0)
+ return -1;
+ if (loaded == 0)
+ return total;
count -= loaded;
p += loaded;
total += loaded;
if (!template[0])
template = origtemplate;
- nonrelative_template = make_nonrelative_path(template);
+ nonrelative_template = absolute_path(template);
errno = saved_errno;
die_errno("Unable to create temporary file '%s'",
nonrelative_template);
if (!template[0])
template = origtemplate;
- nonrelative_template = make_nonrelative_path(template);
+ nonrelative_template = absolute_path(template);
errno = saved_errno;
die_errno("Unable to create temporary file '%s'",
nonrelative_template);