<div dir="ltr"><div><div><div>Reviewed-by: Marek Chalupa <<a href="mailto:mchqwerty@gmail.com">mchqwerty@gmail.com</a>><br><br></div></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Sat, Jun 20, 2015 at 12:47 AM, Bryce Harrington <span dir="ltr"><<a href="mailto:bryce@osg.samsung.com" target="_blank">bryce@osg.samsung.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">error(1, ...) already will exit, per man page: "If status has a nonzero<br>
value, then error() calls exit(3) to terminate the program using the<br>
given value as the exit status."  So exit(EXIT_FAILURE) is never<br>
reached.<br>
<br>
The EXIT_FAILURE macro is guaranteed to be non-zero.  Typically it's<br>
just 1, but on some systems (e.g. OpenVMS apparently) exit(1) means<br>
success so EXIT_FAILURE there is defined to some other non-zero value.<br>
<br>
Signed-off-by: Bryce Harrington <<a href="mailto:bryce@osg.samsung.com">bryce@osg.samsung.com</a>><br>
---<br>
 src/weston-launch.c | 6 ++----<br>
 1 file changed, 2 insertions(+), 4 deletions(-)<br>
<br>
diff --git a/src/weston-launch.c b/src/weston-launch.c<br>
index f67aaaf..90a070f 100644<br>
--- a/src/weston-launch.c<br>
+++ b/src/weston-launch.c<br>
@@ -738,10 +738,8 @@ main(int argc, char *argv[])<br>
                exit(EXIT_FAILURE);<br>
<br>
        wl.child = fork();<br>
-       if (wl.child == -1) {<br>
-               error(1, errno, "fork failed");<br>
-               exit(EXIT_FAILURE);<br>
-       }<br>
+       if (wl.child == -1)<br>
+               error(EXIT_FAILURE, errno, "fork failed");<br>
<br>
        if (wl.child == 0)<br>
                launch_compositor(&wl, argc - optind, argv + optind);<br>
<span class="HOEnZb"><font color="#888888">--<br>
1.9.1<br>
<br>
_______________________________________________<br>
wayland-devel mailing list<br>
<a href="mailto:wayland-devel@lists.freedesktop.org">wayland-devel@lists.freedesktop.org</a><br>
<a href="http://lists.freedesktop.org/mailman/listinfo/wayland-devel" rel="noreferrer" target="_blank">http://lists.freedesktop.org/mailman/listinfo/wayland-devel</a><br>
</font></span></blockquote></div><br></div>