3 Jan 2011 00:32
Re: [PATCH 2/3] CLD: switch network proto from UDP to TCP
Pete Zaitcev <zaitcev <at> redhat.com>
2011-01-02 23:32:32 GMT
2011-01-02 23:32:32 GMT
On Fri, 31 Dec 2010 05:57:28 -0500 Jeff Garzik <jeff <at> garzik.org> wrote: > + struct cldc_tcp *tcp = private; > + ssize_t rc; > + struct ubbp_header ubbp; > + > + memcpy(ubbp.magic, "CLD1", 4); > + ubbp.op_size = (buflen << 8) | 1; > +#ifdef WORDS_BIGENDIAN > + swab32(ubbp.op_size); > +#endif > + > + rc = write(tcp->fd, &ubbp, sizeof(ubbp)); Why not this: unsigned int n; n = (buflen << 8) | 1; ubbp.op_size = GUINT32_TO_LE(n); -- P
RSS Feed