kselftest/cgroup: fix a signedness bug
"len" needs to be signed for the error handling to work. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Shuah Khan (Samsung OSG) <shuah@kernel.org>
This commit is contained in:
committed by
Shuah Khan (Samsung OSG)
parent
9855c4626c
commit
53c3daf8cf
@@ -35,7 +35,7 @@ out:
|
|||||||
return len;
|
return len;
|
||||||
}
|
}
|
||||||
|
|
||||||
static ssize_t write_text(const char *path, char *buf, size_t len)
|
static ssize_t write_text(const char *path, char *buf, ssize_t len)
|
||||||
{
|
{
|
||||||
int fd;
|
int fd;
|
||||||
|
|
||||||
@@ -140,7 +140,7 @@ long cg_read_key_long(const char *cgroup, const char *control, const char *key)
|
|||||||
int cg_write(const char *cgroup, const char *control, char *buf)
|
int cg_write(const char *cgroup, const char *control, char *buf)
|
||||||
{
|
{
|
||||||
char path[PATH_MAX];
|
char path[PATH_MAX];
|
||||||
size_t len = strlen(buf);
|
ssize_t len = strlen(buf);
|
||||||
|
|
||||||
snprintf(path, sizeof(path), "%s/%s", cgroup, control);
|
snprintf(path, sizeof(path), "%s/%s", cgroup, control);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user