mesos-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Benno Evers (JIRA)" <>
Subject [jira] [Created] (MESOS-8869) Re-think semantics of os::system()
Date Wed, 02 May 2018 13:10:00 GMT
Benno Evers created MESOS-8869:

             Summary: Re-think semantics of os::system()
                 Key: MESOS-8869
             Project: Mesos
          Issue Type: Improvement
            Reporter: Benno Evers

The current posix implementation of stout's os::system() has two deficiencies that make its
use harder than necessary:
 * Contrary to its documentation, in the case of an exec failure we don't return None but
rather an exit code of 127.
 * The status obtained from waitpid() is returned directly, without WEXITSTATUS() being applied

Together, these imply that code relying on some particular return value must apply WEXITSTATUS()
itself (breaking the platform-indepence afforded by os::system()), and it cannot check if
the program returned a value of 127/-1 at all.


Intuitively, it seems the function might be more useful by only returning 0 if the call exited
successfully, or None if any kind of error happened. We could also think about an additional
platform-specific function
 that returns the raw return value of the executed function.


This message was sent by Atlassian JIRA

View raw message