From 920955039276dba6059cd281b1f0c17c8218c60e Mon Sep 17 00:00:00 2001 From: "Anthony G. Basile" Date: Sun, 14 Apr 2019 14:39:44 -0400 Subject: install-xattr: address compiler warnings, bug #682110 Signed-off-by: Anthony G. Basile --- misc/install-xattr/install-xattr.c | 5 +++-- 1 file 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: -- cgit v1.2.3-65-gdbad