Skip to content

Commit

Permalink
Solving todos about getting hold of semaphores and editing error mess…
Browse files Browse the repository at this point in the history
…ages accordingly
  • Loading branch information
tpiekarski committed May 13, 2020
1 parent 4cd9db3 commit 3efbfb7
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions lkm_mev.c
Original file line number Diff line number Diff line change
Expand Up @@ -310,9 +310,8 @@ static ssize_t mev_read(struct file *file, char __user *buf, size_t count,
ssize_t retval = 0;

if (down_interruptible(&container->sem)) {
// todo: check why is 'out' not used (maybe use it)?
printk(KERN_DEBUG
"%s: - (down_interruptible(&container->sem)) = true\n",
printk(KERN_ERR
"%s: Failed getting hold of the semaphore by calling interruptible down\n",
THIS_MODULE->name);

return -ERESTARTSYS;
Expand Down Expand Up @@ -438,9 +437,8 @@ static ssize_t mev_write(struct file *file, const char __user *buf,
ssize_t retval = -ENOMEM;

if (down_interruptible(&container->sem)) {
// todo: check why is 'out' not used (maybe use it)?
printk(KERN_DEBUG
"%s: - (down_interruptible(&container->sem)) = true\n",
printk(KERN_ERR
"%s: Failed getting hold of the semaphore by calling interruptible down\n",
THIS_MODULE->name);

return -ERESTARTSYS;
Expand Down

0 comments on commit 3efbfb7

Please sign in to comment.