lkml.org 
[lkml]   [2006]   [Jul]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Subject[PATCH 17/19] UML - Add some EINTR protection
Date
From
Add some more uses of the CATCH_EINTR wrapper.

Signed-off-by: Jeff Dike <jdike@addtoit.com>

Index: linux-2.6.17/arch/um/drivers/net_user.c
===================================================================
--- linux-2.6.17.orig/arch/um/drivers/net_user.c 2006-07-05 20:54:02.000000000 -0400
+++ linux-2.6.17/arch/um/drivers/net_user.c 2006-07-05 21:04:12.000000000 -0400
@@ -105,9 +105,7 @@ int net_recvfrom(int fd, void *buf, int
{
int n;

- while(((n = recvfrom(fd, buf, len, 0, NULL, NULL)) < 0) &&
- (errno == EINTR)) ;
-
+ CATCH_EINTR(n = recvfrom(fd, buf, len, 0, NULL, NULL));
if(n < 0){
if(errno == EAGAIN)
return 0;
@@ -135,7 +133,7 @@ int net_send(int fd, void *buf, int len)
{
int n;

- while(((n = send(fd, buf, len, 0)) < 0) && (errno == EINTR)) ;
+ CATCH_EINTR(n = send(fd, buf, len, 0));
if(n < 0){
if(errno == EAGAIN)
return 0;
@@ -150,8 +148,8 @@ int net_sendto(int fd, void *buf, int le
{
int n;

- while(((n = sendto(fd, buf, len, 0, (struct sockaddr *) to,
- sock_len)) < 0) && (errno == EINTR)) ;
+ CATCH_EINTR(n = sendto(fd, buf, len, 0, (struct sockaddr *) to,
+ sock_len));
if(n < 0){
if(errno == EAGAIN)
return 0;
Index: linux-2.6.17/arch/um/os-Linux/file.c
===================================================================
--- linux-2.6.17.orig/arch/um/os-Linux/file.c 2006-07-05 21:04:02.000000000 -0400
+++ linux-2.6.17/arch/um/os-Linux/file.c 2006-07-05 21:04:12.000000000 -0400
@@ -18,6 +18,7 @@
#include "os.h"
#include "user.h"
#include "kern_util.h"
+#include "user_util.h"

static void copy_stat(struct uml_stat *dst, struct stat64 *src)
{
@@ -42,10 +43,7 @@ int os_stat_fd(const int fd, struct uml_
struct stat64 sbuf;
int err;

- do {
- err = fstat64(fd, &sbuf);
- } while((err < 0) && (errno == EINTR)) ;
-
+ CATCH_EINTR(err = fstat64(fd, &sbuf));
if(err < 0)
return -errno;

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2006-07-07 02:43    [W:0.070 / U:0.276 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site