1 |
commit: 920955039276dba6059cd281b1f0c17c8218c60e |
2 |
Author: Anthony G. Basile <blueness <AT> gentoo <DOT> org> |
3 |
AuthorDate: Sun Apr 14 18:39:44 2019 +0000 |
4 |
Commit: Anthony G. Basile <blueness <AT> gentoo <DOT> org> |
5 |
CommitDate: Sun Apr 14 18:40:01 2019 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/elfix.git/commit/?id=92095503 |
7 |
|
8 |
install-xattr: address compiler warnings, bug #682110 |
9 |
|
10 |
Signed-off-by: Anthony G. Basile <blueness <AT> gentoo.org> |
11 |
|
12 |
misc/install-xattr/install-xattr.c | 5 +++-- |
13 |
1 file changed, 3 insertions(+), 2 deletions(-) |
14 |
|
15 |
diff --git a/misc/install-xattr/install-xattr.c b/misc/install-xattr/install-xattr.c |
16 |
index 3e20b63..5c8a978 100644 |
17 |
--- a/misc/install-xattr/install-xattr.c |
18 |
+++ b/misc/install-xattr/install-xattr.c |
19 |
@@ -239,7 +239,7 @@ main(int argc, char* argv[]) |
20 |
int target_is_directory = 0; /* is the target a directory? */ |
21 |
|
22 |
int first, last; /* argv indices of the first file/directory and last */ |
23 |
- char *target; /* the target file or directory */ |
24 |
+ char *target = NULL; /* the target file or directory */ |
25 |
char *path; /* path to the target file */ |
26 |
|
27 |
char *mypath = realpath("/proc/self/exe", NULL); /* path to argv[0] */ |
28 |
@@ -331,7 +331,8 @@ main(int argc, char* argv[]) |
29 |
char *portage_helper_path = getenv("__PORTAGE_HELPER_PATH"); |
30 |
char *portage_helper_canpath = NULL; |
31 |
if (portage_helper_path) |
32 |
- chdir(oldpwd); |
33 |
+ if (chdir(oldpwd) != 0) |
34 |
+ err(1, "failed to chdir %s", oldpwd); |
35 |
|
36 |
switch (fork()) { |
37 |
case -1: |