aboutsummaryrefslogtreecommitdiffstats
path: root/arch/um/drivers/net_user.c
diff options
context:
space:
mode:
authorJeff Dike <jdike@addtoit.com>2006-07-10 07:45:15 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2006-07-10 16:24:24 -0400
commit9ead6feedd28091d86cde0843be914847b4e10e8 (patch)
treed477bd385e04d77d74823dbbaa4c840c235a5630 /arch/um/drivers/net_user.c
parent108ffa8cbfa323d462a2f4b49f38da3205d36e5a (diff)
[PATCH] uml: add some EINTR protection
Add some more uses of the CATCH_EINTR wrapper. Signed-off-by: Jeff Dike <jdike@addtoit.com> Cc: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'arch/um/drivers/net_user.c')
-rw-r--r--arch/um/drivers/net_user.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/arch/um/drivers/net_user.c b/arch/um/drivers/net_user.c
index 8cd851be0e4d..107c5e43fa00 100644
--- a/arch/um/drivers/net_user.c
+++ b/arch/um/drivers/net_user.c
@@ -105,9 +105,7 @@ int net_recvfrom(int fd, void *buf, int len)
105{ 105{
106 int n; 106 int n;
107 107
108 while(((n = recvfrom(fd, buf, len, 0, NULL, NULL)) < 0) && 108 CATCH_EINTR(n = recvfrom(fd, buf, len, 0, NULL, NULL));
109 (errno == EINTR)) ;
110
111 if(n < 0){ 109 if(n < 0){
112 if(errno == EAGAIN) 110 if(errno == EAGAIN)
113 return 0; 111 return 0;
@@ -135,7 +133,7 @@ int net_send(int fd, void *buf, int len)
135{ 133{
136 int n; 134 int n;
137 135
138 while(((n = send(fd, buf, len, 0)) < 0) && (errno == EINTR)) ; 136 CATCH_EINTR(n = send(fd, buf, len, 0));
139 if(n < 0){ 137 if(n < 0){
140 if(errno == EAGAIN) 138 if(errno == EAGAIN)
141 return 0; 139 return 0;
@@ -150,8 +148,8 @@ int net_sendto(int fd, void *buf, int len, void *to, int sock_len)
150{ 148{
151 int n; 149 int n;
152 150
153 while(((n = sendto(fd, buf, len, 0, (struct sockaddr *) to, 151 CATCH_EINTR(n = sendto(fd, buf, len, 0, (struct sockaddr *) to,
154 sock_len)) < 0) && (errno == EINTR)) ; 152 sock_len));
155 if(n < 0){ 153 if(n < 0){
156 if(errno == EAGAIN) 154 if(errno == EAGAIN)
157 return 0; 155 return 0;