Obsolete
/
libipc-old
Archived
3
0
Fork 0

pubsub: eq test channels -- fixed

more_to_read
Philippe PITTOLI 2016-09-10 02:54:53 +02:00
parent bd2e3e0d15
commit 99ca565bb6
3 changed files with 5 additions and 2 deletions

View File

@ -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); srv_process_gen (p, pid, index, version);
return 0; return 0;

View File

@ -116,7 +116,8 @@ struct channel * pubsubd_channel_get (struct channels *chans, struct channel *c)
int int
pubsubd_channel_eq (const struct channel *c1, const struct channel *c2) 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 // SUBSCRIBER

View File

@ -3,5 +3,5 @@
for i in $(seq 1 10) for i in $(seq 1 10)
do do
echo "${i} 1 1 pub chan${i}" > /tmp/ipc/gen echo "${i} 1 1 pub chan${i}" > /tmp/ipc/gen
sleep 1 sleep 0.1
done done