aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/cgroup.c
diff options
context:
space:
mode:
authorPaul Menage <menage@google.com>2008-04-29 03:59:59 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2008-04-29 11:06:08 -0400
commitb7269dfc826fbf554c9e6a9eaa4e6ff95fa08656 (patch)
tree3be0f111e9951deb4e7ea5930ea659742dea419e /kernel/cgroup.c
parent2c3daa722b624eaf0c5ea60e4f180bd0684542e2 (diff)
CGroup API files: strip all trailing whitespace in cgroup_write_u64
This removes the need for people to remember to pass the -n flag to echo when writing values to cgroup control files. Signed-off-by: Paul Menage <menage@google.com> Cc: "Li Zefan" <lizf@cn.fujitsu.com> Cc: Balbir Singh <balbir@in.ibm.com> Cc: Paul Jackson <pj@sgi.com> Cc: Pavel Emelyanov <xemul@openvz.org> Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com> Cc: "YAMAMOTO Takashi" <yamamoto@valinux.co.jp> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'kernel/cgroup.c')
-rw-r--r--kernel/cgroup.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/kernel/cgroup.c b/kernel/cgroup.c
index 0bd79a81666a..57afdde871ac 100644
--- a/kernel/cgroup.c
+++ b/kernel/cgroup.c
@@ -1329,10 +1329,7 @@ static ssize_t cgroup_write_u64(struct cgroup *cgrp, struct cftype *cft,
1329 return -EFAULT; 1329 return -EFAULT;
1330 1330
1331 buffer[nbytes] = 0; /* nul-terminate */ 1331 buffer[nbytes] = 0; /* nul-terminate */
1332 1332 strstrip(buffer);
1333 /* strip newline if necessary */
1334 if (nbytes && (buffer[nbytes-1] == '\n'))
1335 buffer[nbytes-1] = 0;
1336 val = simple_strtoull(buffer, &end, 0); 1333 val = simple_strtoull(buffer, &end, 0);
1337 if (*end) 1334 if (*end)
1338 return -EINVAL; 1335 return -EINVAL;