Commit c7168143 authored by Kir Kolyshkin's avatar Kir Kolyshkin Committed by Cyrill Gorcunov

ipc_ns.c: remove hardcoded sizes

Use sizeof() instead.
Signed-off-by: 's avatarKir Kolyshkin <kir@openvz.org>
Signed-off-by: 's avatarCyrill Gorcunov <gorcunov@openvz.org>
parent 11f2ce03
......@@ -86,7 +86,7 @@ static int read_ipc_sysctl_long(char *name, u64 *data, size_t size)
pr_perror("Can't open %s", name);
return fd;
}
ret = read(fd, buf, 32);
ret = read(fd, buf, sizeof(buf));
if (ret < 0) {
pr_perror("Can't read %s", name);
ret = -errno;
......@@ -110,7 +110,7 @@ static int read_ipc_sysctl(char *name, u32 *data, size_t size)
pr_perror("Can't open %s", name);
return fd;
}
ret = read(fd, buf, 32);
ret = read(fd, buf, sizeof(buf));
if (ret < 0) {
pr_perror("Can't read %s", name);
ret = -errno;
......@@ -135,7 +135,7 @@ static int read_ipc_sem(u32 sem[])
pr_perror("Can't open %s", name);
return fd;
}
ret = read(fd, buf, 128);
ret = read(fd, buf, sizeof(buf));
if (ret < 0) {
pr_perror("Can't read %s", name);
ret = -errno;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment