Bug 159310 - Enhance printflags() semantics
Enhance printflags() semantics
Product: Fedora
Classification: Fedora
Component: strace (Show other bugs)
All Linux
medium Severity medium
: ---
: ---
Assigned To: Roland McGrath
Brian Brock
: FutureFeature
Depends On:
  Show dependency treegraph
Reported: 2005-06-01 12:41 EDT by Dmitry V. Levin
Modified: 2007-11-30 17:11 EST (History)
0 users

See Also:
Fixed In Version:
Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2005-06-01 15:03:49 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
strace-4.5.11-alt-printflags.patch (35.20 KB, patch)
2005-06-01 12:43 EDT, Dmitry V. Levin
no flags Details | Diff

  None (edit)
Description Dmitry V. Levin 2005-06-01 12:41:42 EDT
As of cvs snapshot 20050526, the printflags() semantics is error prone.
Client is expected to check return code of this function, which is easy to forget.  There are 32 cases in current codebase where return code is not checked and therefore flag value may be omitted.

For example:
$ strace -e trace=capget getpcaps $$
capget(0x12345678, 12345, {, , })       = 0
Capabilities for `12345': =

I suggest to add third argument to printflags() with similar meaning to the third argument of printxval().  As result, in most cases printflags() return code will be unneeded and clients will look more clear.
Comment 1 Dmitry V. Levin 2005-06-01 12:43:19 EDT
Created attachment 115039 [details]

Proposed change.
Comment 2 Roland McGrath 2005-06-01 15:03:49 EDT
Looks good, thanks for the patch.  It's in.

Note You need to log in before you can comment on or make changes to this bug.