Page MenuHomeFreeBSD

cmp: Print a summary on SIGINFO.
ClosedPublic

Authored by des on Jan 30 2023, 5:26 PM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, Jul 2, 10:12 PM
Unknown Object (File)
Thu, Jun 27, 2:22 AM
Unknown Object (File)
Sun, Jun 23, 11:05 AM
Unknown Object (File)
Jun 13 2024, 5:45 AM
Unknown Object (File)
May 5 2024, 5:50 PM
Unknown Object (File)
May 1 2024, 9:39 AM
Unknown Object (File)
Apr 12 2024, 4:52 AM
Unknown Object (File)
Apr 12 2024, 1:23 AM
Subscribers

Details

Summary

MFC after: 1 week
Sponsored by: Klara, Inc.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

des requested review of this revision.Jan 30 2023, 5:26 PM
markj added inline comments.
usr.bin/cmp/cmp.c
255

If you don't intend to check for errors. It's good for silencing static analyzers if nothing else.

271

Why bother unsetting it?

usr.bin/cmp/regular.c
126

I think it's usually preferable to print these to stderr, lest one inject something unexpected into a pipe.

des marked 3 inline comments as done.

Incorporate reviewer feedback.

usr.bin/cmp/cmp.c
271

Good point, it's harmless.

usr.bin/cmp/regular.c
126

You're right, I misremembered.

It's not obvious to me why we bother with the ifdefs. Most other utilities in the base system don't conditionalize SIGINFO support, but I guess it doesn't hurt.

This revision is now accepted and ready to land.Jan 30 2023, 6:58 PM

It's not obvious to me why we bother with the ifdefs. Most other utilities in the base system don't conditionalize SIGINFO support, but I guess it doesn't hurt.

Well, extern.h needs the #ifdef unless we want to #include <signal.h> in link.c and misc.c, which don't need it, and the remaining #ifdefs a) don't hurt and b) make the code easier for others to pull if they want to. I initially also put in a bit that defined SIGINFO to SIGVTALRM if the latter is defined but the former is not but took it out.

This revision was automatically updated to reflect the committed changes.