]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - include/net/sock.h
net: fix sleeping for sk_wait_event()
[karo-tx-linux.git] / include / net / sock.h
index cf617ee16723f2096941548a100832154e359c36..9d905ed0cd250203f1fbe282186d7e0d4de8f518 100644 (file)
@@ -915,14 +915,16 @@ static inline void sock_rps_reset_rxhash(struct sock *sk)
 #endif
 }
 
-#define sk_wait_event(__sk, __timeo, __condition)                      \
+#define sk_wait_event(__sk, __timeo, __condition, __wait)              \
        ({      int __rc;                                               \
                release_sock(__sk);                                     \
                __rc = __condition;                                     \
                if (!__rc) {                                            \
-                       *(__timeo) = schedule_timeout(*(__timeo));      \
+                       *(__timeo) = wait_woken(__wait,                 \
+                                               TASK_INTERRUPTIBLE,     \
+                                               *(__timeo));            \
                }                                                       \
-               sched_annotate_sleep();                                         \
+               sched_annotate_sleep();                                 \
                lock_sock(__sk);                                        \
                __rc = __condition;                                     \
                __rc;                                                   \