GNOME Bugzilla – Bug 707233
[Genie] Allow exit status to be set from init function
Last modified: 2018-05-22 14:56:02 UTC
Currently an exit status of zero is always returned by a Genie program. To indicate a program has failed in some way a non-zero exit code would be useful, for example when using a Genie program from a Unix script. At present init is a void function, so: init return 1 gives "error: Return with value in void function" The proposal is to make init return an integer, but for the parser to default to a value of zero if no return statement is provided. This maintains backwards compatibility.
Yes good idea
Created attachment 348532 [details] [review] Allow the main function, init, to return an integer as the program exit status This patch keeps the original init block: init pass but, alternatively allows an integer to be returned: init:int return 0 The integer is the exit status for the program. This allows Genie programs to be used more easily from scripts, which then know whether the Genie program was successful or not. Convention is that zero indicates a successful program. For example see bash: http://tldp.org/LDP/abs/html/exitcodes.html
-- GitLab Migration Automatic Message -- This bug has been migrated to GNOME's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/vala/issues/402.