Page MenuHomeFreeBSD

err.3: Fix an example
Needs RevisionPublic

Authored by 0mp on Dec 16 2020, 9:23 AM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Apr 6, 10:24 AM
Unknown Object (File)
Dec 23 2023, 12:07 AM
Unknown Object (File)
Feb 14 2023, 1:45 AM
Unknown Object (File)
Jan 8 2023, 6:21 AM
Unknown Object (File)
Dec 13 2022, 1:11 AM
Subscribers

Details

Reviewers
yuripv
jilles
Group Reviewers
manpages
Summary
err.3: Fix an example

The example says that it shows the use of warn*() functions. Replace the err() function there with a warn() call.

Reported by:	yuripv

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 35432
Build 32345: arc lint + arc unit

Event Timeline

0mp requested review of this revision.Dec 16 2020, 9:23 AM
jilles requested changes to this revision.Dec 16 2020, 3:05 PM
jilles added a subscriber: jilles.
jilles added inline comments.
lib/libc/gen/err.3
199

This doesn't compile, since warn() doesn't take an int eval.

In general, the example seems OK as is, since the warnx() above gives a warning only, and opening some sort of device is apparently required.

The duality of raw and block devices no longer exists, so the example is a bit out of date.

Although warnings like these can be useful, they cannot be used in most POSIX-specified utilities used in the way specified by the standard. POSIX indicates this with the text "The standard error shall be used only for diagnostic messages." A "diagnostic message" implies that the exit status is not 0.

This revision now requires changes to proceed.Dec 16 2020, 3:05 PM