projects
/
profile
/
ivi
/
weston-ivi-shell.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
c9e64ab
)
weston-launch: Add some error reporting for weston-launch
author
Rob Bradford
<rob@linux.intel.com>
Wed, 5 Dec 2012 18:47:11 +0000
(18:47 +0000)
committer
Kristian Høgsberg
<krh@bitplanet.net>
Fri, 7 Dec 2012 03:33:25 +0000
(22:33 -0500)
This also avoids us passing (size_t)(-1 * sizeof(gid_t)) into malloc
src/weston-launch.c
patch
|
blob
|
history
diff --git
a/src/weston-launch.c
b/src/weston-launch.c
index
cb69968
..
6d1f7c3
100644
(file)
--- a/
src/weston-launch.c
+++ b/
src/weston-launch.c
@@
-84,11
+84,18
@@
read_groups(void)
gid_t *groups;
n = getgroups(0, NULL);
+
+ if (n < 0) {
+ fprintf(stderr, "Unable to retrieve groups: %m\n");
+ return NULL;
+ }
+
groups = malloc(n * sizeof(gid_t));
if (!groups)
return NULL;
if (getgroups(n, groups) < 0) {
+ fprintf(stderr, "Unable to retrieve groups: %m\n");
free(groups);
return NULL;
}