Redundant code in trace_syscall_exiting()

haris iqbal haris.phnx at gmail.com
Wed Mar 9 07:40:54 UTC 2016


On Wed, Mar 9, 2016 at 8:28 AM, Dmitry V. Levin <ldv at altlinux.org> wrote:
> On Tue, Mar 08, 2016 at 10:55:47AM +0530, haris iqbal wrote:
>>   if (tcp->qual_flg & QUAL_RAW) {
>>         /* sys_res = printargs(tcp); - but it's nop on sysexit */
>>     } else {
>>     /* FIXME: not_failing_only (IOW, option -z) is broken:
>>      * failure of syscall is known only after syscall return.
>>      * Thus we end up with something like this on, say, ENOENT:
>>      *     open("doesnt_exist", O_RDONLY <unfinished ...>
>>      *     {next syscall decode}
>>      * whereas the intended result is that open(...) line
>>      * is not shown at all.
>>      */
>>         if (not_failing_only && tcp->u_error)
>>             goto ret;   /* ignore failed syscalls */
>>         if (tcp->sys_func_rval & RVAL_DECODED)
>>             sys_res = tcp->sys_func_rval;
>>         else
>>             sys_res = tcp->s_ent->sys_func(tcp);
>>     }
>>
>> This condition check in if seems redundant. Should I remove it with
>
> The code you are talking about is a comment.
>
>> if (!(tcp->qual_flg & QUAL_RAW))
>
> Why do you think this would be any different from the above?

Forgive me, I wasn't very clear. What I meant was the above change
would make it look more clear. It is true that both has only one
conditional checks. But since there is nothing to be executed if the
'if' condition is true, I suppose we can remove that, just to make it
clearer, and avoid confusion.

>
>
> --
> ldv
>
> ------------------------------------------------------------------------------
> Transform Data into Opportunity.
> Accelerate data analysis in your applications with
> Intel Data Analytics Acceleration Library.
> Click to learn more.
> http://pubads.g.doubleclick.net/gampad/clk?id=278785111&iu=/4140
> _______________________________________________
> Strace-devel mailing list
> Strace-devel at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/strace-devel
>



-- 

With regards,

Md Haris Iqbal,
Placement Coordinator, MTech IT
NITK Surathkal,
Contact: +91 8861996962




More information about the Strace-devel mailing list