Currently we reset errno, shortly to be followed by an fcntl() and
gzdopen() calls. Both of those should set errno on failure and preserve
it on success.
Just leave errno as-is, we shouldn't be changing it in this context.
Reference: https://github.com/kmod-project/kmod/issues/244
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Link: https://github.com/kmod-project/kmod/pull/346
Signed-off-by: Lucas De Marchi <lucas.de.marchi@gmail.com>
return -EINVAL;
}
- errno = 0;
gzfd = fcntl(file->fd, F_DUPFD_CLOEXEC, 3);
if (gzfd < 0)
return -errno;