Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix checkpid on windows #2031

Closed

Conversation

hurricanehrndz
Copy link
Contributor

Describe your changes

syscall.signal 0 does not work on windows as it is not implemented

Issue ticket number and link

Checklist

  • Is it a bug fix
  • Is a typo/documentation fix
  • Is a feature enhancement
  • It is a refactor
  • Created tests that fail without the change (if possible)
  • Extended the README / documentation, if necessary

Copy link
Collaborator

@mlsmaycon mlsmaycon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @hurricanehrndz for the contribution. Left one request.

}
}
// Prepare the command
cmd := exec.Command("tasklist", "/FI", fmt.Sprintf("PID eq %d", pid))
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you use a function similar to GetSystem32Command to avoid path issues?

client/ui/client_ui.go Show resolved Hide resolved
if strings.Contains(line, fmt.Sprintf("%d", pid)) {
return true
}
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you handle scanner.Err() here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If scanner.Err actually returns an error the overall return of the function would be false, the only benefit to handling scanner.Err is to log an issue with the scanning, but it is not like the log is written to disk or anything so ...

Copy link
Contributor

@lixmal lixmal May 23, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right, but if there's an issue that would at least give us a hint when debugging the application from CLI

client/ui/client_ui.go Outdated Show resolved Hide resolved
hurricanehrndz and others added 2 commits May 23, 2024 06:16
Co-authored-by: Viktor Liu <vma@randomcrap.eu>
Co-authored-by: Viktor Liu <vma@randomcrap.eu>
@hurricanehrndz
Copy link
Contributor Author

hurricanehrndz commented May 23, 2024 via email

@hurricanehrndz
Copy link
Contributor Author

hurricanehrndz commented May 24, 2024

Although this patch somewhat works, I am not entirely happy, since a miss click will run multiple apps. I will close this for now, and reopen and when I have a better solution

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants