Bug 159310

Summary: Enhance printflags() semantics
Product: [Fedora] Fedora Reporter: Dmitry V. Levin <ldv>
Component: straceAssignee: Roland McGrath <roland>
Status: CLOSED NEXTRELEASE QA Contact: Brian Brock <bbrock>
Severity: medium Docs Contact:
Priority: medium    
Version: rawhideKeywords: FutureFeature
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2005-06-01 19:03:49 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
strace-4.5.11-alt-printflags.patch none

Description Dmitry V. Levin 2005-06-01 16:41:42 UTC
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 16:43:19 UTC
Created attachment 115039 [details]
strace-4.5.11-alt-printflags.patch

Proposed change.

Comment 2 Roland McGrath 2005-06-01 19:03:49 UTC
Looks good, thanks for the patch.  It's in.