Skip to content

Conversation

@Bluemangoo
Copy link
Collaborator

@Bluemangoo Bluemangoo commented Jul 5, 2025

wrote a tool to test:

$ ./sigr                    
I'm 99648
recv a sig = 2 data = 10 data = 10
$ cargo run -q pkill -SIGINT -q 10 sigr -e
./sigr killed (pid 99648)

@Bluemangoo Bluemangoo force-pushed the feature/pkill-queue branch 4 times, most recently from 7b9af1a to 73ee796 Compare July 5, 2025 12:14
@cakebaker cakebaker force-pushed the feature/pkill-queue branch from 73ee796 to 7440279 Compare July 8, 2025 15:00
@Bluemangoo Bluemangoo force-pushed the feature/pkill-queue branch from 7440279 to 2c9c9a6 Compare July 9, 2025 07:35
@Bluemangoo Bluemangoo force-pushed the feature/pkill-queue branch 3 times, most recently from 887761d to 5bfc7b1 Compare July 30, 2025 09:19
@sylvestre
Copy link
Contributor

could you please add a test ?

@Bluemangoo
Copy link
Collaborator Author

Common distributions do not have commands to detect output queues. The tool mentioned above is written in C++.

It might be difficult to test if it really working only with rust tests. btw, test_pkill.rs only contains tests for invalid arguments. I think we can open an issue for this.

#include <string.h>
#include <signal.h>
#include <unistd.h>
#include <stdlib.h>
#include <stdio.h>
 
void handler(int, siginfo_t *, void*);
 
int main(int argc, char *argv[])
{
    printf("I'm %d\n", getpid());
    struct sigaction act;
    act.sa_sigaction = handler;
    sigemptyset(&act.sa_mask);
    act.sa_flags = SA_SIGINFO;
    
    if(sigaction(SIGINT, &act, NULL) < 0) {
        perror("sigaction error");
        exit(0);
    }
    for(; ;)
      pause();
    return 0;
}
 
void handler(int sig, siginfo_t *info, void *ctx)
{
    printf("recv a sig = %d data = %d data = %d\n", sig, info->si_value.sival_int, info->si_int);
}

@Bluemangoo
Copy link
Collaborator Author

Bluemangoo commented Aug 1, 2025

added a simple test for invalid input.

@Bluemangoo Bluemangoo force-pushed the feature/pkill-queue branch from 9ceaebb to 4f1d753 Compare August 1, 2025 09:00
@codecov
Copy link

codecov bot commented Aug 4, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 0.00%. Comparing base (fd9344f) to head (3d5bcda).
⚠️ Report is 8 commits behind head on main.

Additional details and impacted files
@@     Coverage Diff     @@
##   main   #457   +/-   ##
===========================
===========================

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@Bluemangoo Bluemangoo force-pushed the feature/pkill-queue branch from 4f1d753 to 3d5bcda Compare August 7, 2025 02:23
@Bluemangoo
Copy link
Collaborator Author

fixed.

@cakebaker cakebaker merged commit c4f18be into uutils:main Aug 8, 2025
16 checks passed
@cakebaker
Copy link
Contributor

Thanks!

@Bluemangoo Bluemangoo deleted the feature/pkill-queue branch August 18, 2025 02:20
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.

3 participants