Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 234629
b: refs/heads/master
c: 6e6823d
h: refs/heads/master
i:
  234627: 09605f8
v: v3
  • Loading branch information
Torben Hohn authored and Thomas Gleixner committed Mar 12, 2011
1 parent 35eb025 commit 454a6b6
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: a9e7acfff0a279792918b7b0de74106e576e9988
refs/heads/master: 6e6823d17b157f185be09f4c70181299f9273f0b
14 changes: 12 additions & 2 deletions trunk/kernel/time/posix-clock.c
Original file line number Diff line number Diff line change
Expand Up @@ -287,11 +287,16 @@ static int pc_clock_adjtime(clockid_t id, struct timex *tx)
if (err)
return err;

if ((cd.fp->f_mode & FMODE_WRITE) == 0) {
err = -EACCES;
goto out;
}

if (cd.clk->ops.clock_adjtime)
err = cd.clk->ops.clock_adjtime(cd.clk, tx);
else
err = -EOPNOTSUPP;

out:
put_clock_desc(&cd);

return err;
Expand Down Expand Up @@ -344,11 +349,16 @@ static int pc_clock_settime(clockid_t id, const struct timespec *ts)
if (err)
return err;

if ((cd.fp->f_mode & FMODE_WRITE) == 0) {
err = -EACCES;
goto out;
}

if (cd.clk->ops.clock_settime)
err = cd.clk->ops.clock_settime(cd.clk, ts);
else
err = -EOPNOTSUPP;

out:
put_clock_desc(&cd);

return err;
Expand Down

0 comments on commit 454a6b6

Please sign in to comment.