Skip to content
Snippets Groups Projects
Commit 43d176b2 authored by Thierno souleymane Bah's avatar Thierno souleymane Bah
Browse files

feat(TP3 updated)

parent 9502e408
No related branches found
No related tags found
No related merge requests found
...@@ -116,7 +116,7 @@ static ssize_t procfile_write(struct file *filp, const char __user *buff, ...@@ -116,7 +116,7 @@ static ssize_t procfile_write(struct file *filp, const char __user *buff,
long size; long size;
int i; int i;
char *new_msg, *old_msg; char *new_msg;
procfs_buffer_size = len; procfs_buffer_size = len;
...@@ -155,14 +155,13 @@ static ssize_t procfile_write(struct file *filp, const char __user *buff, ...@@ -155,14 +155,13 @@ static ssize_t procfile_write(struct file *filp, const char __user *buff,
new_msg = kmalloc(size, GFP_KERNEL); new_msg = kmalloc(size, GFP_KERNEL);
old_msg = msg.text;
msg.text = new_msg;
for (i = 0; i < msg.first_write - msg.first_read; i++) for (i = msg.first_read; i < msg.first_write; i++)
msg.text[i] = old_msg[i]; new_msg[i-msg.first_read] = msg.text[i%msg.size];
kfree(old_msg); kfree(msg.text);
msg.text = new_msg;
msg.size = size; msg.size = size;
msg.first_read = 0; msg.first_read = 0;
msg.first_write = i; msg.first_write = i;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment