GUnixFDMessage: fix a small typo in an extra check
authorRyan Lortie <desrt@desrt.ca>
Tue, 5 Jan 2010 23:49:23 +0000 (18:49 -0500)
committerRyan Lortie <desrt@desrt.ca>
Tue, 5 Jan 2010 23:52:33 +0000 (18:52 -0500)
In the deserialise function, GUnixFDMessage was comparing 'level' to
both SOL_SOCKET and SCM_RIGHTS.  It is correct to compare 'type' to
SCM_RIGHTS.  The code passed tests only because:

1) it's a "should always be OK" double-check

2) SOL_SOCKET and SCM_RIGHTS, by chance, both have the value '1' on
   Linux systems.

gio/gunixfdmessage.c

index 9ca497e..bb37d5f 100644 (file)
@@ -84,7 +84,7 @@ g_unix_fd_message_deserialize (int      level,
   gint *fds;
 
   if (level != SOL_SOCKET ||
-      level != SCM_RIGHTS)
+      type != SCM_RIGHTS)
     return NULL;
   
   if (size % 4 > 0)