Skip to content

Commit

Permalink
#599 undo changes
Browse files Browse the repository at this point in the history
  • Loading branch information
koekeishiya committed Jun 30, 2020
1 parent 71de83e commit 12b0544
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 31 deletions.
1 change: 0 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
- Fixed an issue that caused a window to not become unmanaged when a space with a single window changed to float [#586](https://github.com/koekeishiya/yabai/issues/586)
- Restore opacity back to full if *window_opacity* is disabled [#585](https://github.com/koekeishiya/yabai/issues/585)
- Update scripting-addition to support macOS Big Sur 10.16 Build 20A4299v [#589](https://github.com/koekeishiya/yabai/issues/589)
- Don't observe processes that are being traced / launched from a debugger [#599](https://github.com/koekeishiya/yabai/issues/599)

## [3.2.1] - 2020-06-17
### Changed
Expand Down
1 change: 0 additions & 1 deletion src/manifest.m
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
#include <unistd.h>
#include <sys/wait.h>
#include <sys/stat.h>
#include <sys/sysctl.h>
#include <semaphore.h>
#include <pthread.h>

Expand Down
29 changes: 0 additions & 29 deletions src/process_manager.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,30 +46,6 @@ void process_destroy(struct process *process)
free(process);
}

static bool process_is_traced(pid_t pid)
{
struct kinfo_proc info;
size_t size = sizeof(info);
int mib[4] = { CTL_KERN, KERN_PROC, KERN_PROC_PID, pid };

info.kp_proc.p_flag = 0;
sysctl(mib, sizeof(mib) / sizeof(*mib), &info, &size, NULL, 0);

return ((info.kp_proc.p_flag & P_TRACED) != 0);
}

static bool process_is_suspended(pid_t pid)
{
struct kinfo_proc info;
size_t size = sizeof(info);
int mib[4] = { CTL_KERN, KERN_PROC, KERN_PROC_PID, pid };

info.kp_proc.p_flag = 0;
sysctl(mib, sizeof(mib) / sizeof(*mib), &info, &size, NULL, 0);

return ((info.kp_proc.p_stat & SRUN) == 0);
}

static bool process_is_observable(struct process *process)
{
if (process->xpc) {
Expand All @@ -92,11 +68,6 @@ static bool process_is_observable(struct process *process)
return false;
}

if (process_is_traced(process->pid)) {
warn("%s: %s (%d) is running under a debugger! ignoring..\n", __FUNCTION__, process->name, process->pid);
return false;
}

return true;
}

Expand Down

0 comments on commit 12b0544

Please sign in to comment.