Package: patchutils
Version: 0.2.31-4
Severity: important
File: /usr/bin/rediff

Hello,

when I did

rediff patches/28_io_eintr.patch~ patches/28_io_eintr.patch

the program crashed with a message

rediff: src/rediff.c:506: show_modified_hunk: Assertion `r != -1' failed.

The files in question are attached.

Regards
    Jiri Palecek

-- System Information:
Debian Release: lenny/sid
  APT prefers testing
  APT policy: (990, 'testing'), (500, 'unstable'), (1, 'experimental')
Architecture: i386 (i686)

Kernel: Linux 2.6.23.9-debug (PREEMPT)
Locale: LANG=cs_CZ, LC_CTYPE=cs_CZ (charmap=ISO-8859-2) (ignored: LC_ALL set 
to cs_CZ)
Shell: /bin/sh linked to /bin/dash

Versions of packages patchutils depends on:
ii  debianutils                   2.23.1     Miscellaneous utilities specific 
t
ii  libc6                         2.7-3      GNU C Library: Shared libraries
ii  patch                         2.5.9-4    Apply a diff file to an original
ii  perl                          5.8.8-12   Larry Wall's Practical Extraction 

patchutils recommends no packages.
Index: ltp-full-20080131/lib/tlibio.c
===================================================================
--- ltp-full-20080131.orig/lib/tlibio.c	2008-03-08 18:54:40.000000000 +0100
+++ ltp-full-20080131/lib/tlibio.c	2008-03-08 20:01:31.000000000 +0100
@@ -694,11 +690,13 @@
 	    printf("DEBUG %s/%d: %s\n", __FILE__, __LINE__, Lio_SysCall);
         }
 
-	if ((ret = write(fd, buffer, size)) == -1) {
-	    sprintf(Errormsg, "%s/%d write(%d, buf, %d) ret:-1, errno=%d %s",
-		__FILE__, __LINE__,
-		fd, size, errno, strerror(errno));
-	    return -errno;
+	while ((ret = write(fd, buffer, size)) == -1) {
+		if(errno == EAGAIN || errno == EINTR)
+			continue;
+		sprintf(Errormsg, "%s/%d write(%d, buf, %d) ret:-1, errno=%d %s",
+						__FILE__, __LINE__,
+						fd, size, errno, strerror(errno));
+		return -errno;
 	}
 
 	if ( ret != size ) {
@@ -1213,7 +1211,9 @@
 	    printf("DEBUG %s/%d: %s\n", __FILE__, __LINE__, Lio_SysCall);
         }
 
-	if ((ret = read(fd, buffer, size)) == -1) {
+	while ((ret = read(fd, buffer, size)) == -1) {
+		if( errno == EINTR || errno== EAGAIN )
+			continue;
 	    sprintf(Errormsg, "%s/%d read(%d, buf, %d) ret:-1, errno=%d %s",
 		    __FILE__, __LINE__,
 		fd, size, errno, strerror(errno));

Attachment: 28_io_eintr.patch~
Description: application/trash

Reply via email to