Re: [PATCH 03/19] write: stop using MAXHOSTNAMELEN

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

 



On Sunday 14 October 2012 16:20:54 Sami Kerola wrote:
> +	host = xmalloc(sizeof(char) * (sysconf(_SC_HOST_NAME_MAX) + 1));
> +	if (gethostname(host, sysconf(_SC_HOST_NAME_MAX)) < 0)

sysconf() isn't labeled pure or anything, so it'd be better imo to store this 
in a local var so you don't waste time calling it twice.
	long len = sysconf(...);
-mike

Attachment: signature.asc
Description: This is a digitally signed message part.


[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux