1 |
commit: 52033f4ef3e633a1743de398b49a46ddd1564c99 |
2 |
Author: Fabian Groffen <grobian <AT> gentoo <DOT> org> |
3 |
AuthorDate: Sat May 25 12:19:03 2019 +0000 |
4 |
Commit: Fabian Groffen <grobian <AT> gentoo <DOT> org> |
5 |
CommitDate: Sat May 25 12:19:03 2019 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=52033f4e |
7 |
|
8 |
qmanifest: silence warnings on Linux |
9 |
|
10 |
Signed-off-by: Fabian Groffen <grobian <AT> gentoo.org> |
11 |
|
12 |
qmanifest.c | 8 ++++++-- |
13 |
1 file changed, 6 insertions(+), 2 deletions(-) |
14 |
|
15 |
diff --git a/qmanifest.c b/qmanifest.c |
16 |
index b5bbd79..541ab34 100644 |
17 |
--- a/qmanifest.c |
18 |
+++ b/qmanifest.c |
19 |
@@ -1772,8 +1772,12 @@ qmanifest_main(int argc, char **argv) |
20 |
if (*overlay != '/') { |
21 |
if (portroot[1] == '\0') { |
22 |
/* resolve the path */ |
23 |
- (void)fchdir(curdirfd); |
24 |
- (void)realpath(overlay, path); |
25 |
+ if (fchdir(curdirfd) != 0) |
26 |
+ continue; /* this shouldn't happen */ |
27 |
+ if (realpath(overlay, path) == NULL && *path == '\0') { |
28 |
+ warn("could not resolve %s", overlay); |
29 |
+ continue; /* very unlikely */ |
30 |
+ } |
31 |
} else { |
32 |
snprintf(path, sizeof(path), "./%s", overlay); |
33 |
} |