_dir = opendir(dir->i_srcpath);
if (!_dir) {
erofs_err("failed to opendir at %s: %s",
- dir->i_srcpath, erofs_strerror(errno));
+ dir->i_srcpath, erofs_strerror(-errno));
return -errno;
}
#ifdef HAVE_POSIX_FADVISE
if (posix_fadvise(fd, 0, 0, POSIX_FADV_SEQUENTIAL))
erofs_warn("failed to fadvise: %s, ignored.",
- erofs_strerror(errno));
+ erofs_strerror(-errno));
#endif
}
ios->bufsize = 16384;
_dir = opendir(path);
if (!_dir) {
erofs_err("failed to opendir at %s: %s",
- path, erofs_strerror(errno));
+ path, erofs_strerror(-errno));
return -errno;
}