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, Sep 24, 9:16 AM
Unknown Object (File)
Fri, Sep 13, 11:42 AM
Unknown Object (File)
Mon, Sep 9, 3:30 AM
Unknown Object (File)
Sun, Sep 8, 3:26 PM
Unknown Object (File)
Sun, Sep 8, 1:31 PM
Unknown Object (File)
Sun, Sep 8, 6:00 AM
Unknown Object (File)
Aug 25 2024, 7:00 AM
Unknown Object (File)
Aug 25 2024, 7:00 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.