summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthias Brugger <matthias.bgg@gmail.com>2016-05-09 20:47:31 +0200
committerMatthias Brugger <matthias.bgg@gmail.com>2016-05-09 20:47:31 +0200
commit0bb6ad75ac24f00af44de8f40eea8523d9dc23df (patch)
tree1d5ce59cdfc656b6002a8f630e1b51b7f148c0b7
parent5f0ca02589e07829f669674e8dd664927fb91e15 (diff)
parent0a7ee7d0d7d68d89009c81955002e582d2d37dff (diff)
downloadldd3-0bb6ad75ac24f00af44de8f40eea8523d9dc23df.tar.gz
Merge pull request #20 from coderkaka/master
Fix failure to compile the scull with kernel of version 4.6.0.
-rw-r--r--scull/access.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/scull/access.c b/scull/access.c
index 96b1c6b..6e20f8a 100644
--- a/scull/access.c
+++ b/scull/access.c
@@ -105,15 +105,15 @@ static int scull_u_open(struct inode *inode, struct file *filp)
spin_lock(&scull_u_lock);
if (scull_u_count &&
- (scull_u_owner != current_uid()) && /* allow user */
- (scull_u_owner != current_euid()) && /* allow whoever did su */
+ (scull_u_owner != current_uid().val) && /* allow user */
+ (scull_u_owner != current_euid().val) && /* allow whoever did su */
!capable(CAP_DAC_OVERRIDE)) { /* still allow root */
spin_unlock(&scull_u_lock);
return -EBUSY; /* -EPERM would confuse the user */
}
if (scull_u_count == 0)
- scull_u_owner = current_uid(); /* grab it */
+ scull_u_owner = current_uid().val; /* grab it */
scull_u_count++;
spin_unlock(&scull_u_lock);
@@ -164,8 +164,8 @@ static DEFINE_SPINLOCK(scull_w_lock);
static inline int scull_w_available(void)
{
return scull_w_count == 0 ||
- scull_w_owner == current_uid() ||
- scull_w_owner == current_euid() ||
+ scull_w_owner == current_uid().val ||
+ scull_w_owner == current_euid().val ||
capable(CAP_DAC_OVERRIDE);
}
@@ -183,7 +183,7 @@ static int scull_w_open(struct inode *inode, struct file *filp)
spin_lock(&scull_w_lock);
}
if (scull_w_count == 0)
- scull_w_owner = current_uid(); /* grab it */
+ scull_w_owner = current_uid().val; /* grab it */
scull_w_count++;
spin_unlock(&scull_w_lock);