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)
Fri, Oct 11, 7:27 AM
Unknown Object (File)
Fri, Oct 11, 7:26 AM
Unknown Object (File)
Fri, Oct 11, 7:12 AM
Unknown Object (File)
Oct 4 2024, 12:11 PM
Unknown Object (File)
Oct 1 2024, 2:14 AM
Unknown Object (File)
Sep 25 2024, 2:23 PM
Unknown Object (File)
Sep 25 2024, 2:16 PM
Unknown Object (File)
Sep 25 2024, 12:35 PM
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.