diff options
Diffstat (limited to 'kernel/futex.c')
-rw-r--r-- | kernel/futex.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/kernel/futex.c b/kernel/futex.c index af831fbb7fb4..6b597cf33b02 100644 --- a/kernel/futex.c +++ b/kernel/futex.c | |||
@@ -1252,6 +1252,7 @@ handle_fault: | |||
1252 | */ | 1252 | */ |
1253 | #define FLAGS_SHARED 0x01 | 1253 | #define FLAGS_SHARED 0x01 |
1254 | #define FLAGS_CLOCKRT 0x02 | 1254 | #define FLAGS_CLOCKRT 0x02 |
1255 | #define FLAGS_HAS_TIMEOUT 0x04 | ||
1255 | 1256 | ||
1256 | static long futex_wait_restart(struct restart_block *restart); | 1257 | static long futex_wait_restart(struct restart_block *restart); |
1257 | 1258 | ||
@@ -1486,7 +1487,7 @@ retry_private: | |||
1486 | restart->futex.val = val; | 1487 | restart->futex.val = val; |
1487 | restart->futex.time = abs_time->tv64; | 1488 | restart->futex.time = abs_time->tv64; |
1488 | restart->futex.bitset = bitset; | 1489 | restart->futex.bitset = bitset; |
1489 | restart->futex.flags = 0; | 1490 | restart->futex.flags = FLAGS_HAS_TIMEOUT; |
1490 | 1491 | ||
1491 | if (fshared) | 1492 | if (fshared) |
1492 | restart->futex.flags |= FLAGS_SHARED; | 1493 | restart->futex.flags |= FLAGS_SHARED; |
@@ -1510,13 +1511,16 @@ static long futex_wait_restart(struct restart_block *restart) | |||
1510 | { | 1511 | { |
1511 | u32 __user *uaddr = (u32 __user *)restart->futex.uaddr; | 1512 | u32 __user *uaddr = (u32 __user *)restart->futex.uaddr; |
1512 | int fshared = 0; | 1513 | int fshared = 0; |
1513 | ktime_t t; | 1514 | ktime_t t, *tp = NULL; |
1514 | 1515 | ||
1515 | t.tv64 = restart->futex.time; | 1516 | if (restart->futex.flags & FLAGS_HAS_TIMEOUT) { |
1517 | t.tv64 = restart->futex.time; | ||
1518 | tp = &t; | ||
1519 | } | ||
1516 | restart->fn = do_no_restart_syscall; | 1520 | restart->fn = do_no_restart_syscall; |
1517 | if (restart->futex.flags & FLAGS_SHARED) | 1521 | if (restart->futex.flags & FLAGS_SHARED) |
1518 | fshared = 1; | 1522 | fshared = 1; |
1519 | return (long)futex_wait(uaddr, fshared, restart->futex.val, &t, | 1523 | return (long)futex_wait(uaddr, fshared, restart->futex.val, tp, |
1520 | restart->futex.bitset, | 1524 | restart->futex.bitset, |
1521 | restart->futex.flags & FLAGS_CLOCKRT); | 1525 | restart->futex.flags & FLAGS_CLOCKRT); |
1522 | } | 1526 | } |