diff options
| author | Teddy Wing | 2018-10-06 01:09:02 +0200 | 
|---|---|---|
| committer | Teddy Wing | 2018-10-06 01:09:02 +0200 | 
| commit | ae4e7c53e7453e0399baab82bd4a6c2d83c8c167 (patch) | |
| tree | fe393ac1f2bc1de5970a708212a88eaef1b10504 | |
| parent | b93cf2273da91459627ca0746a560bd9f646285f (diff) | |
| download | DomeKey-ae4e7c53e7453e0399baab82bd4a6c2d83c8c167.tar.bz2 | |
Mappings(dispatchReload): Return result of `notify_post()`
Return this as the exit code so we can pass the information back to the
client.
| -rw-r--r-- | DomeKey/Mappings.h | 2 | ||||
| -rw-r--r-- | DomeKey/Mappings.m | 7 | ||||
| -rw-r--r-- | DomeKey/main.m | 4 | 
3 files changed, 7 insertions, 6 deletions
| diff --git a/DomeKey/Mappings.h b/DomeKey/Mappings.h index 2c46dde..b2cea20 100644 --- a/DomeKey/Mappings.h +++ b/DomeKey/Mappings.h @@ -18,6 +18,6 @@  @interface Mappings : NSObject  + (void)observeReloadNotification; -+ (void)dispatchReload; ++ (uint32_t)dispatchReload;  @end diff --git a/DomeKey/Mappings.m b/DomeKey/Mappings.m index 0d57fa6..1261601 100644 --- a/DomeKey/Mappings.m +++ b/DomeKey/Mappings.m @@ -54,12 +54,15 @@ void reload_mappings(      }  } -+ (void)dispatchReload ++ (uint32_t)dispatchReload  { -    if (notify_post(NOTIFICATION_NAME_RELOAD) != 0) { +    uint32_t status = notify_post(NOTIFICATION_NAME_RELOAD); +    if (status != 0) {          // Notification failed          NSLog(@"Reload notification failed");      } + +    return status;  }  @end diff --git a/DomeKey/main.m b/DomeKey/main.m index 4eff03d..13ec820 100644 --- a/DomeKey/main.m +++ b/DomeKey/main.m @@ -15,9 +15,7 @@ int main(int argc, const char * argv[]) {      const Config *config = c_parse_args(argv, argc);      if (config->args.reload) { -        [Mappings dispatchReload]; - -        // TODO: Return result of `notify_post`, and still log +        return [Mappings dispatchReload];      } else if (config->args.daemon) {          @autoreleasepool {              [NSApplication sharedApplication]; | 
