Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.
Bug 159310 - Enhance printflags() semantics
Summary: Enhance printflags() semantics
Keywords:
Status: CLOSED NEXTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: strace
Version: rawhide
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Roland McGrath
QA Contact: Brian Brock
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2005-06-01 16:41 UTC by Dmitry V. Levin
Modified: 2007-11-30 22:11 UTC (History)
0 users

Fixed In Version:
Doc Type: Enhancement
Doc Text:
Clone Of:
Environment:
Last Closed: 2005-06-01 19:03:49 UTC


Attachments (Terms of Use)
strace-4.5.11-alt-printflags.patch (deleted)
2005-06-01 16:43 UTC, Dmitry V. Levin
no flags Details | Diff

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.


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