Re: [PATCH 2/3] CLD: switch network proto from UDP to TCP

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, 31 Dec 2010 05:57:28 -0500
Jeff Garzik <jeff@xxxxxxxxxx> 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
--
To unsubscribe from this list: send the line "unsubscribe hail-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Fedora Clound]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux