Project

General

Profile

Bug #499 ยป ast_ksh_20101112_libcmd_tee_open_intr001.diff.txt

Prototype patch - Roland Mainz, 2010-12-10 02:12 PM

 
1
Index: usr/src/lib/libcmd/common/tee.c
2
===================================================================
3
--- usr/src/lib/libcmd/common/tee.c	(revision 2267)
4
+++ usr/src/lib/libcmd/common/tee.c	(working copy)
5
@@ -177,7 +177,11 @@
6
 			hp = tp->fd;
7
 			while (cp = *argv++)
8
 			{
9
-				if ((*hp = open(cp, oflag, S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP|S_IROTH|S_IWOTH)) < 0)
10
+				while ((*hp = open(cp, oflag, S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP|S_IROTH|S_IWOTH)) < 0 &&
11
+					errno == EINTR)
12
+					errno=0;
13
+				
14
+				if (*hp < 0)
15
 					error(ERROR_system(0), "%s: cannot create", cp);
16
 				else
17
 					hp++;
    (1-1/1)