diff options
author | David Oberhollenzer <david.oberhollenzer@sigma-star.at> | 2019-06-10 00:28:55 +0200 |
---|---|---|
committer | David Oberhollenzer <david.oberhollenzer@sigma-star.at> | 2019-06-10 00:28:55 +0200 |
commit | dfcb5d93c6fb3d5c1c933275622d938e83da6a70 (patch) | |
tree | b82ac96ae5e89d7f00c0547b8117c9101808a14f /include | |
parent | 781716c240da330d57f27bf22f48017f9132a489 (diff) |
gensquashfs: do pushd/popd when needed instead of chdir
This commit replaces the chdir to the input directory with pushd/popd
when building the fstree and again when packing files.
This simplifies handling of other file paths given on the command line
that have to be accessed and are relative to the original working
directories.
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
Diffstat (limited to 'include')
-rw-r--r-- | include/fstree.h | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/include/fstree.h b/include/fstree.h index 33fa8b8..3c9e2af 100644 --- a/include/fstree.h +++ b/include/fstree.h @@ -222,7 +222,10 @@ void fstree_xattr_deduplicate(fstree_t *fs); Parses the file format accepted by gensquashfs and produce a file system tree from it. File input paths are interpreted as relative to the given root dir. If rootdir is NULL, use the path where the input file is as root - dir. The function actually chdirs into the root dir. + dir. + + This function tries to temporarily change the working directory, so if it + fails, the current working directory is undefined. On failure, an error report with filename and line number is written to stderr. |