This is the mail archive of the libc-ports@sources.redhat.com mailing list for the libc-ports project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] arm: ioperm use /proc/sys not sysctl


On Monday 09 November 2009 00:58:06 Eric W. Biederman wrote:
> +static int get_sysctl_int(const char *name, int *result)
> +{
> +  char buf[20];
> +  ssize_t ret;
> +  int fd;
> +  fd = __open(name, O_RDONLY);
> +  if (fd < 0)
> +    return -1;
> +
> +  memset(buf, 0, sizeof(buf));
> +  ret = __read(fd, buf, sizeof(buf) - 1);
> +  __close(fd);
> +  if (ret < 0)
> +    return -1;
> +
> +  *result = strtoul(buf, NULL, 10);

is that memset really needed /
-mike

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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]