aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnthony G. Basile <blueness@gentoo.org>2019-04-14 14:39:44 -0400
committerAnthony G. Basile <blueness@gentoo.org>2019-04-14 14:40:01 -0400
commit920955039276dba6059cd281b1f0c17c8218c60e (patch)
tree5bb78123e630ccdc90516f64a98cb21f759e2dcb
parentinstall-xattr: report any errors by "stat" (diff)
downloadelfix-920955039276dba6059cd281b1f0c17c8218c60e.tar.gz
elfix-920955039276dba6059cd281b1f0c17c8218c60e.tar.bz2
elfix-920955039276dba6059cd281b1f0c17c8218c60e.zip
install-xattr: address compiler warnings, bug #682110
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
-rw-r--r--misc/install-xattr/install-xattr.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/misc/install-xattr/install-xattr.c b/misc/install-xattr/install-xattr.c
index 3e20b63..5c8a978 100644
--- a/misc/install-xattr/install-xattr.c
+++ b/misc/install-xattr/install-xattr.c
@@ -239,7 +239,7 @@ main(int argc, char* argv[])
int target_is_directory = 0; /* is the target a directory? */
int first, last; /* argv indices of the first file/directory and last */
- char *target; /* the target file or directory */
+ char *target = NULL; /* the target file or directory */
char *path; /* path to the target file */
char *mypath = realpath("/proc/self/exe", NULL); /* path to argv[0] */
@@ -331,7 +331,8 @@ main(int argc, char* argv[])
char *portage_helper_path = getenv("__PORTAGE_HELPER_PATH");
char *portage_helper_canpath = NULL;
if (portage_helper_path)
- chdir(oldpwd);
+ if (chdir(oldpwd) != 0)
+ err(1, "failed to chdir %s", oldpwd);
switch (fork()) {
case -1: