Page MenuHomeFreeBSD

D58386.id182420.diff
No OneTemporary

D58386.id182420.diff

diff --git a/bin/pwait/pwait.c b/bin/pwait/pwait.c
--- a/bin/pwait/pwait.c
+++ b/bin/pwait/pwait.c
@@ -66,6 +66,15 @@
static struct pidtree pids = RB_INITIALIZER(&pids);
RB_GENERATE_STATIC(pidtree, pid, entry, pidcmp);
+static volatile sig_atomic_t siginfo;
+
+static void
+handler(int signo)
+{
+ if (signo == SIGINFO)
+ siginfo = 1;
+}
+
static void
usage(void)
{
@@ -221,9 +230,21 @@
}
}
ret = EX_OK;
+ signal(SIGINFO, handler);
+ setvbuf(stderr, NULL, _IOLBF, 0);
while ((ndone == 0 || !oflag) && ret == EX_OK && nleft > 0) {
n = kevent(kq, NULL, 0, e, nleft + tflag, NULL);
+ if (siginfo) {
+ p = RB_MIN(pidtree, &pids);
+ fprintf(stderr, "%d", p->pid);
+ while ((p = RB_NEXT(pidtree, &pids, p)) != NULL)
+ fprintf(stderr, " %d", p->pid);
+ fprintf(stderr, "\n");
+ siginfo = 0;
+ }
if (n == -1) {
+ if (errno == EINTR)
+ continue;
err(EX_OSERR, "kevent");
}
for (i = 0; i < n; i++) {

File Metadata

Mime Type
text/plain
Expires
Thu, Jul 30, 8:52 PM (2 h, 15 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
35381386
Default Alt Text
D58386.id182420.diff (944 B)

Event Timeline