Thread (6 messages) 6 messages, 2 authors, 2011-08-25

Re: [Patch] Scm: Remove unnecessary pid & credential references in Unix socket's send and receive path

flat view

From: David Miller <davem@davemloft.net>
Date: 2011-08-25 02:43:49
Also in: lkml

From: Tim Chen <redacted>
Date: Mon, 22 Aug 2011 17:57:26 -0700
On Mon, 2011-08-22 at 17:40 -0700, David Miller wrote:
quoted
From: Tim Chen <redacted>
Date: Fri, 19 Aug 2011 09:44:58 -0700
quoted
-		/* 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.
Good point.  Patch updated as suggested.
Applied.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help