[tracker/error-handling: 4/10] libtracker-data: Handle EINTR instead of EAGAIN when writing journal



commit 52c86c2eb23482d626672a0a7f2ce9a3b8fd1ea0
Author: Jürg Billeter <j bitron ch>
Date:   Tue May 17 15:12:33 2011 +0200

    libtracker-data: Handle EINTR instead of EAGAIN when writing journal
    
    Writing to a regular file will never set EAGAIN.

 src/libtracker-data/tracker-db-journal.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
---
diff --git a/src/libtracker-data/tracker-db-journal.c b/src/libtracker-data/tracker-db-journal.c
index bd4fbeb..486baa2 100644
--- a/src/libtracker-data/tracker-db-journal.c
+++ b/src/libtracker-data/tracker-db-journal.c
@@ -406,7 +406,8 @@ write_all_data (int    fd,
 		written = write (fd, data, len);
 		
 		if (written < 0) {
-			if (errno == EAGAIN) {
+			if (errno == EINTR) {
+				/* interrupted by signal, try again */
 				continue;
 			}
 			goto out;



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]