Skip to content

Commit

Permalink
Check chdir return code.
Browse files Browse the repository at this point in the history
  • Loading branch information
Frediano Ziglio committed Feb 10, 2014
1 parent a6edb01 commit 616b14d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions fillextfs.c
Expand Up @@ -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);
Expand Down

0 comments on commit 616b14d

Please sign in to comment.