ext2simg: fix same_file() with symlinks
Fix same_file() to use stat() instead of lstat() when checking the
paths, so that symlinks are dereferenced. This is needed to be
consistent with how the paths are actually accessed later. Otherwise,
not all cases where the input and output file are the same are detected.
Also just use the stat() result to check whether the output file exists,
instead of using a separate call to access().
Fixes: db6f320912cf ("AOSP: android: add the ext2simg tool")
Signed-off-by: Eric Biggers <email@example.com>
1 file changed