You can import this changeset into BK by piping this whole message to: '| bk receive [path to repository]' or apply the patch as usual. =================================================================== ChangeSet@1.1422.1.12, 2003-11-13 04:32:10-02:00, acme@conectiva.com.br o IPV4: use sk_wait_error af_inet.c | 2 +- tcp.c | 53 ++++++++++++++++++----------------------------------- 2 files changed, 19 insertions(+), 36 deletions(-) diff -Nru a/net/ipv4/af_inet.c b/net/ipv4/af_inet.c --- a/net/ipv4/af_inet.c Sat Nov 15 17:01:15 2003 +++ b/net/ipv4/af_inet.c Sat Nov 15 17:01:15 2003 @@ -579,7 +579,7 @@ !((1 << sk->sk_state) & (TCPF_SYN_SENT | TCPF_SYN_RECV)))) break; - if (signal_pending(current) || !timeo) + if (__sk_wait_error(timeo)) break; } finish_wait(sk->sk_sleep, &wait); diff -Nru a/net/ipv4/tcp.c b/net/ipv4/tcp.c --- a/net/ipv4/tcp.c Sat Nov 15 17:01:15 2003 +++ b/net/ipv4/tcp.c Sat Nov 15 17:01:15 2003 @@ -661,19 +661,15 @@ { int rc; struct tcp_opt *tp = tcp_sk(sk); - struct task_struct *tsk = current; DEFINE_WAIT(wait); while (1) { - if (sk->sk_err) - return sock_error(sk); + rc = sk_wait_error(sk, *timeo_p); + if (rc) + break; + rc = -EPIPE; if ((1 << sk->sk_state) & ~(TCPF_SYN_SENT | TCPF_SYN_RECV)) - return -EPIPE; - if (!*timeo_p) - return -EAGAIN; - if (signal_pending(tsk)) - return sock_intr_errno(*timeo_p); - + break; prepare_to_wait(sk->sk_sleep, &wait, TASK_INTERRUPTIBLE); tp->write_pending++; rc = sk_wait_event(sk, timeo_p, @@ -681,10 +677,12 @@ ~(TCPF_ESTABLISHED | TCPF_CLOSE_WAIT))); finish_wait(sk->sk_sleep, &wait); tp->write_pending--; - if (rc) + if (rc) { + rc = 0; break; + } } - return 0; + return rc; } static inline int tcp_memory_free(struct sock *sk) @@ -711,12 +709,12 @@ prepare_to_wait(sk->sk_sleep, &wait, TASK_INTERRUPTIBLE); - if (sk->sk_err || (sk->sk_shutdown & SEND_SHUTDOWN)) - goto do_error; - if (!*timeo) - goto do_nonblock; - if (signal_pending(current)) - goto do_interrupted; + err = -EPIPE; + if (sk->sk_shutdown & SEND_SHUTDOWN) + break; + err = sk_wait_error(sk, *timeo); + if (err) + break; clear_bit(SOCK_ASYNC_NOSPACE, &sk->sk_socket->flags); if (tcp_memory_free(sk) && !vm_wait) break; @@ -737,19 +735,8 @@ } *timeo = current_timeo; } -out: finish_wait(sk->sk_sleep, &wait); return err; - -do_error: - err = -EPIPE; - goto out; -do_nonblock: - err = -EAGAIN; - goto out; -do_interrupted: - err = sock_intr_errno(*timeo); - goto out; } ssize_t do_tcp_sendpages(struct sock *sk, struct page **pages, int poffset, @@ -1983,7 +1970,6 @@ } if (timeout) { - struct task_struct *tsk = current; DEFINE_WAIT(wait); do { @@ -1991,7 +1977,7 @@ TASK_INTERRUPTIBLE); if (sk_wait_event(sk, &timeout, !closing(sk))) break; - } while (!signal_pending(tsk) && timeout); + } while (!__sk_wait_error(timeout)); finish_wait(sk->sk_sleep, &wait); } @@ -2169,11 +2155,8 @@ err = -EINVAL; if (sk->sk_state != TCP_LISTEN) break; - err = sock_intr_errno(timeo); - if (signal_pending(current)) - break; - err = -EAGAIN; - if (!timeo) + err = __sk_wait_error(timeo); + if (err) break; } finish_wait(sk->sk_sleep, &wait); =================================================================== This BitKeeper patch contains the following changesets: 1.1422.1.12 ## Wrapped with gzip_uu ## M'XL( /MWMC\ [U6[T_;,!#]'/\5-R%-=%M2GV,[3E 1&T&CV@05C.UCE3IF MK4J;*DF+IF7_^YR47V%E##315+TD/K][=^]9ZA:<%2:/G$3/#-F"PZPH(T=G M?W)X3T>K _3N;?S:DIH=#0RHWT7LH@^41SZ+D+J4193"1FAXR\"EY /\WS;VB88, M^H.O/()E8:"8#B^323DT>9[EY!/4O)$,;B=)W"=^"*$));N/\+8"=R>+%>^6 M>N'IN^1#H2JFE*\J'6B5JC1%EHX,&XTV#VH#U+40*$0E&&/RW^DDY\.)?=A M22CTJT!B*H4,V&-$3!>"5" M'JC&SM)O^Q@C(?[N8P077]S'Z_D>@YM?-E_KR\&&43_#W;%0#)#TU\%Q)N>P M/1RVZF^7DYG).IVVOHT]GZ#M$T[&8[K>.QGVEU/[R-E:4R&>K*D"UQGR.8I*R:V4-BA@I"]E"-P*FUNQV@RVB^D[>-.(.UQT=J[$SW7'WCFC MW"33G>M][L&@/SC8L: !@K2@@6S<!W0+!SSJG0: []:IH=OVJ M\X-U?AVGAV=?XN-O1VW^:X"'&K]IVR[X M'$\N#&R_VGAJEF7'EH@9!@P$Z=LHFP&M66T^:"U*-W\/]-CH:;&<]1(Q8H(S +07X#8D5@)),(