Signed-off-by: David Sterba <dsterba@suse.com>
retval = 1; /* failure */
res = test_isdir(dst);
+ if (res < 0 && res != -ENOENT) {
+ error("cannot access %s: %s", dst, strerror(-res));
+ goto out;
+ }
if (res >= 0) {
error("target path already exists: %s", dst);
goto out;
}
res = test_isdir(dst);
+ if (res < 0 && res != -ENOENT) {
+ error("cannot access %s: %s", dst, strerror(-res));
+ goto out;
+ }
if (res == 0) {
error("'%s' exists and it is not a directory", dst);
goto out;