summaryrefslogtreecommitdiff
path: root/demo.c
diff options
context:
space:
mode:
authorLeo (Sunpeng) Li <sunpeng.li@amd.com>2018-03-28 10:36:10 -0400
committerLeo (Sunpeng) Li <sunpeng.li@amd.com>2018-05-02 10:13:31 -0400
commit2cbf3a1a7952f491178ce78c00327b0b5095f74b (patch)
tree35e8bb1e836e0c769b24688de8993b05fbd985b1 /demo.c
parent1610c58420e173238656ad11d5f26bf0b0d91edd (diff)
Fix main() return values.
Signed-off-by: Leo (Sunpeng) Li <sunpeng.li@amd.com>
Diffstat (limited to 'demo.c')
-rw-r--r--demo.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/demo.c b/demo.c
index ead3ba8..60eb318 100644
--- a/demo.c
+++ b/demo.c
@@ -630,14 +630,14 @@ int main(int argc, char *const argv[])
}
else {
print_short_help();
- return -1;
+ return 1;
}
}
/* Check that output is given */
if (!output_name) {
print_short_help();
- return 0;
+ return 1;
}
/* Parse the input, and generate the intermediate coefficient arrays */
@@ -650,7 +650,7 @@ int main(int argc, char *const argv[])
/* Print help if input is not as expected */
if (!degamma_changed && !ctm_changed && !regamma_changed) {
print_short_help();
- return 0;
+ return 1;
}
/* Open DRM device, and obtain file descriptor */
@@ -658,7 +658,7 @@ int main(int argc, char *const argv[])
if (drm_fd == -1) {
printf("No valid devices found\n");
printf("Did you run with admin privilege?\n");
- return -1;
+ return 1;
}
/* Open the default X display and window, then obtain the RandR screen
@@ -673,6 +673,7 @@ int main(int argc, char *const argv[])
output = find_output_by_name(dpy, res, output_name);
if (!output) {
printf("Cannot find output %s.\n", output_name);
+ ret = 1;
goto done;
}