diff options
author | Volodymyr Vasiutyk <volodymyr.vasiutyk@gmail.com> | 2021-10-06 10:45:07 +0300 |
---|---|---|
committer | BenBE <BenBE@geshi.org> | 2021-10-31 15:07:00 +0100 |
commit | 2ef70ad7f692686710091132978129b614f6dd1a (patch) | |
tree | 448c24ac798a6ab5bc18ac37cd9517bddc9f3a73 /darwin | |
parent | 2977414d540c9cb78baa3d7fc612fcb4d6ecc72f (diff) |
Early program termination only from main()
Diffstat (limited to 'darwin')
-rw-r--r-- | darwin/Platform.c | 4 | ||||
-rw-r--r-- | darwin/Platform.h | 7 |
2 files changed, 7 insertions, 4 deletions
diff --git a/darwin/Platform.c b/darwin/Platform.c index 3f596a39..152f617b 100644 --- a/darwin/Platform.c +++ b/darwin/Platform.c @@ -126,7 +126,7 @@ static double Platform_nanosecondsPerMachTick = 1.0; static double Platform_nanosecondsPerSchedulerTick = -1; -void Platform_init(void) { +bool Platform_init(void) { Platform_nanosecondsPerMachTick = Platform_calculateNanosecondsPerMachTick(); // Determine the number of scheduler clock ticks per second @@ -139,6 +139,8 @@ void Platform_init(void) { const double nanos_per_sec = 1e9; Platform_nanosecondsPerSchedulerTick = nanos_per_sec / scheduler_ticks_per_sec; + + return true; } // Converts ticks in the Mach "timebase" to nanoseconds. diff --git a/darwin/Platform.h b/darwin/Platform.h index c03a9b45..fe75db06 100644 --- a/darwin/Platform.h +++ b/darwin/Platform.h @@ -19,6 +19,7 @@ in the source distribution for its full text. #include "NetworkIOMeter.h" #include "ProcessLocksScreen.h" #include "SignalsPanel.h" +#include "CommandLine.h" #include "darwin/DarwinProcess.h" #include "generic/gettime.h" #include "generic/hostname.h" @@ -33,7 +34,7 @@ extern const unsigned int Platform_numberOfSignals; extern const MeterClass* const Platform_meterTypes[]; -void Platform_init(void); +bool Platform_init(void); // Converts ticks in the Mach "timebase" to nanoseconds. // See `mach_timebase_info`, as used to define the `Platform_nanosecondsPerMachTick` constant. @@ -87,8 +88,8 @@ static inline void Platform_getRelease(char** string) { static inline void Platform_longOptionsUsage(ATTR_UNUSED const char* name) { } -static inline bool Platform_getLongOption(ATTR_UNUSED int opt, ATTR_UNUSED int argc, ATTR_UNUSED char** argv) { - return false; +static inline CommandLineStatus Platform_getLongOption(ATTR_UNUSED int opt, ATTR_UNUSED int argc, ATTR_UNUSED char** argv) { + return STATUS_ERROR_EXIT; } static inline void Platform_gettime_realtime(struct timeval* tv, uint64_t* msec) { |