pubsub: eq test channels -- fixed
parent
bd2e3e0d15
commit
99ca565bb6
|
@ -162,6 +162,8 @@ int srv_get_new_process (const struct service *srv, struct process *p)
|
|||
}
|
||||
}
|
||||
|
||||
if (buf != NULL)
|
||||
free (buf);
|
||||
srv_process_gen (p, pid, index, version);
|
||||
|
||||
return 0;
|
||||
|
|
|
@ -116,7 +116,8 @@ struct channel * pubsubd_channel_get (struct channels *chans, struct channel *c)
|
|||
int
|
||||
pubsubd_channel_eq (const struct channel *c1, const struct channel *c2)
|
||||
{
|
||||
return (strncmp (c1->chan, c2->chan, c1->chanlen) == 0);
|
||||
return c1->chanlen == c2->chanlen &&
|
||||
strncmp (c1->chan, c2->chan, c1->chanlen) == 0;
|
||||
}
|
||||
|
||||
// SUBSCRIBER
|
||||
|
|
|
@ -3,5 +3,5 @@
|
|||
for i in $(seq 1 10)
|
||||
do
|
||||
echo "${i} 1 1 pub chan${i}" > /tmp/ipc/gen
|
||||
sleep 1
|
||||
sleep 0.1
|
||||
done
|
||||
|
|
Reference in New Issue