Skip to content

Commit

Permalink
Fix LaunchService launch in some cases
Browse files Browse the repository at this point in the history
  • Loading branch information
jjgod committed Aug 6, 2016
1 parent 31820aa commit 8f4ccc5
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -104,9 +104,10 @@ int get_process_name(pid_t inPID, char *outName, size_t inMaxLen)

int should_start_as_gui() {
char parent_process_name[1024];
const char *launchd = "launchd";
if (!get_process_name(getppid(), parent_process_name, 1024) &&
!strcmp(parent_process_name, "launchd"))
return TRUE;
!strncmp(parent_process_name, launchd, strlen(launchd)))
return TRUE;

return FALSE;
}
Expand Down

0 comments on commit 8f4ccc5

Please sign in to comment.