From: Vitaliy Cherepanov Date: Fri, 23 May 2014 11:18:01 +0000 (+0400) Subject: [FIX] tasks file X-Git-Tag: Tizen_SDK_2.3~60 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=d8bd8e4adc3258b8b7a5eefebdb31da5a239fad3;p=kernel%2Fswap-modules.git [FIX] tasks file add seek able fix problem with symbol at end of string Change-Id: I293b0151574dd29e229152e35835170da114c070 Signed-off-by: Vitaliy Cherepanov --- diff --git a/us_manager/debugfs_us_manager.c b/us_manager/debugfs_us_manager.c index 4f682a0..84a0139 100644 --- a/us_manager/debugfs_us_manager.c +++ b/us_manager/debugfs_us_manager.c @@ -34,13 +34,11 @@ static void on_each_proc_callback(struct sspt_proc *proc, void *data) if (rbuf->end - rbuf->ptr < len + 2) return; - if (rbuf->ptr != rbuf->begin) { - *rbuf->ptr = ' '; - ++rbuf->ptr; - } - memcpy(rbuf->ptr, pid_str, len); rbuf->ptr += len; + + *rbuf->ptr = ' '; + ++rbuf->ptr; } static ssize_t read_tasks(struct file *file, char __user *user_buf, @@ -55,8 +53,9 @@ static ssize_t read_tasks(struct file *file, char __user *user_buf, on_each_proc_no_lock(on_each_proc_callback, (void *)&rbuf); - if (rbuf.ptr < rbuf.end) - ++rbuf.ptr; + if (rbuf.ptr != rbuf.begin) + rbuf.ptr--; + *rbuf.ptr = '\n'; return simple_read_from_buffer(user_buf, count, ppos, rbuf.begin, @@ -65,7 +64,8 @@ static ssize_t read_tasks(struct file *file, char __user *user_buf, static const struct file_operations fops_tasks = { .owner = THIS_MODULE, - .read = read_tasks + .read = read_tasks, + .llseek = default_llseek }; /* ============================================================================