lkml.org 
[lkml]   [2011]   [Aug]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [Patch] Scm: Remove unnecessary pid & credential references in Unix socket's send and receive path
From
From: Tim Chen <tim.c.chen@linux.intel.com>
Date: Fri, 19 Aug 2011 09:44:58 -0700

> - /* Only send the fds in the first buffer */
> - err = unix_scm_to_skb(siocb->scm, skb, !fds_sent);
> + /* Only send the fds and no ref to pid in the first buffer */
> + if (fds_sent)
> + err = unix_scm_to_skb(siocb->scm, skb, !fds_sent, true);
> + else
> + err = unix_scm_to_skb(siocb->scm, skb, !fds_sent, false);

Just set this final boolean the way the third argument is, there is no
reason to replicate the entire function call twice just to set the
final argument to what "fds_sent" evaluates to as a boolean.

err = unix_scm_to_skb(siocb->scm, skb, !fds_sent, fds_sent);

ought to suffice.


\
 
 \ /
  Last update: 2011-08-23 02:43    [W:0.061 / U:1.440 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site