On Thu, Mar 16, 2017 at 01:01:40AM +0300, Victor Krapivensky wrote: > * xlat/usagewho.in: Add values for existing values, add RUSAGE_THREAD. > * tests/getrusage.c: Test decoding of RUSAGE_THREAD. > --- > tests/getrusage.c | 31 +++++++++++++++++++++++++------ > xlat/usagewho.in | 7 ++++--- > 2 files changed, 29 insertions(+), 9 deletions(-) [...] > +int > +main(void) > +{ > + struct rusage *const usage = tail_alloc(sizeof(struct rusage));
The idiom is struct rusage *const usage = tail_alloc(sizeof(*usage)); > + if (invoke_print(ARG_STR(RUSAGE_SELF), usage)) { > + return 1; > + } Let's follow the current practice and use perror_msg_and_fail if something fails when it shouldn't, e.g. perror_msg_and_fail("RUSAGE_SELF"); > + if (invoke_print(ARG_STR(RUSAGE_THREAD), usage) && errno != EINVAL) { > + return 1; > + } Likewise. -- ldv
pgpTQMmHg4qOJ.pgp
Description: PGP signature
------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________ Strace-devel mailing list Strace-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/strace-devel