mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* xor as a lazy comparison
@ 2005-07-24 16:40 Jan Engelhardt
  2005-07-24 20:07 ` Grant Coady
  0 siblings, 1 reply; 17+ messages in thread
From: Jan Engelhardt @ 2005-07-24 16:40 UTC (permalink / raw)
  To: Linux Kernel Mailing List

Hi list,


I have seen this in kernel/signal.c:check_kill_permission()

            && (current->euid ^ t->suid) && (current->euid ^ t->uid)

If current->euid and t->suid are the same, the xor returns 0, so these 
statements are effectively the same as a !=

	current->euid != t->suid ...

Why ^ ?


Jan Engelhardt
-- 

^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2005-07-26  8:35 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-07-24 16:40 xor as a lazy comparison Jan Engelhardt
2005-07-24 20:07 ` Grant Coady
2005-07-24 21:43   ` Jan Engelhardt
2005-07-24 22:15     ` Puneet Vyas
2005-07-25  8:57       ` Bernd Petrovitsch
2005-07-25 17:55         ` Steven Rostedt
2005-07-25 19:10           ` Lee Revell
2005-07-25 19:16             ` Philippe Troin
2005-07-25 19:18               ` Lee Revell
2005-07-26  6:07                 ` Jan Engelhardt
2005-07-26  8:30                   ` Bernd Petrovitsch
2005-07-25 19:24               ` Steven Rostedt
2005-07-25 19:27               ` Lee Revell
2005-07-25 19:23             ` Paulo Marques
2005-07-25 19:25               ` Lee Revell
2005-07-25 20:24             ` Bill Davidsen
2005-07-25 18:00         ` [PATCH] make signal.c more readable (was: Re: xor as a lazy comparison) Steven Rostedt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®