- warning("error opening directory %s: %s",
- iter->base.path.buf, strerror(errno));
+ warning_errno("error opening directory '%s'",
+ iter->base.path.buf);
- warning("error reading directory %s: %s",
- iter->base.path.buf, strerror(errno));
+ warning_errno("error reading directory '%s'",
+ iter->base.path.buf);
- warning("error closing directory %s: %s",
- iter->base.path.buf, strerror(errno));
+ warning_errno("error closing directory '%s'",
+ iter->base.path.buf);
strbuf_addstr(&iter->base.path, de->d_name);
if (lstat(iter->base.path.buf, &iter->base.st) < 0) {
if (errno != ENOENT)
strbuf_addstr(&iter->base.path, de->d_name);
if (lstat(iter->base.path.buf, &iter->base.st) < 0) {
if (errno != ENOENT)
- warning("error closing directory %s: %s",
- iter->base.path.buf, strerror(errno));
+ errno = saved_errno;
+ warning_errno("error closing directory '%s'",
+ iter->base.path.buf);