Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Check chdir return code.

  • Loading branch information...
commit 616b14d2f2bf04d35d7edb3633b91c8bf75f915b 1 parent a6edb01
@freddy77 authored
Showing with 3 additions and 2 deletions.
  1. +3 −2 fillextfs.c
View
5 fillextfs.c
@@ -1130,10 +1130,11 @@ add2fs_from_dir(filesystem *fs, ext2_ino_t this_nod, int squash_uids, int squash
break;
case S_IFDIR:
nod = mkdir_fs(fs, this_nod, name, mode, uid, gid, ctime, mtime);
- if(chdir(dent->d_name) < 0)
+ if (chdir(dent->d_name) < 0)
perror_msg_and_die(name);
add2fs_from_dir(fs, nod, squash_uids, squash_perms, fs_timestamp);
- chdir("..");
+ if (chdir("..") < 0)
+ perror_msg_and_die(name);
break;
default:
error_msg("ignoring entry %s", name);
Please sign in to comment.
Something went wrong with that request. Please try again.