diff src/lib-index/mail-transaction-log.c @ 4071:cd3d26cf124a HEAD

Renamed safe-open.* to nfs-workarounds.*, safe_open() to nfs_safe_open() and added a new global NFS_ESTALE_RETRY_COUNT which everyone uses instead of defining their own.
author Timo Sirainen <tss@iki.fi>
date Sun, 26 Feb 2006 12:15:39 +0200
parents b19ccbaa3802
children 7e6acdd8d18d
line wrap: on
line diff
--- a/src/lib-index/mail-transaction-log.c	Sun Feb 26 12:04:59 2006 +0200
+++ b/src/lib-index/mail-transaction-log.c	Sun Feb 26 12:15:39 2006 +0200
@@ -4,7 +4,7 @@
 #include "ioloop.h"
 #include "buffer.h"
 #include "file-dotlock.h"
-#include "safe-open.h"
+#include "nfs-workarounds.h"
 #include "close-keep-errno.h"
 #include "read-full.h"
 #include "write-full.h"
@@ -497,7 +497,7 @@
 	bool found;
 
 	/* log creation is locked now - see if someone already created it */
-	old_fd = safe_open(path, O_RDWR);
+	old_fd = nfs_safe_open(path, O_RDWR);
 	if (old_fd != -1) {
 		if ((ret = fstat(old_fd, &st)) < 0) {
                         mail_index_file_set_syscall_error(index, path,
@@ -773,7 +773,7 @@
 		return mail_transaction_log_file_alloc_in_memory(log);
 
         for (i = 0; ; i++) {
-                fd = safe_open(path, O_RDWR);
+                fd = nfs_safe_open(path, O_RDWR);
                 if (fd == -1) {
                         if (errno != ENOENT) {
                                 mail_index_file_set_syscall_error(log->index,
@@ -808,7 +808,7 @@
         int fd, ret;
 
         for (i = 0;; i++) {
-                fd = safe_open(path, O_RDWR);
+                fd = nfs_safe_open(path, O_RDWR);
                 if (fd == -1) {
                         mail_index_file_set_syscall_error(log->index, path,
                                                           "open()");
@@ -978,7 +978,7 @@
 	/* see if we have it in log.2 file */
 	path = t_strconcat(log->index->filepath,
 			   MAIL_TRANSACTION_LOG_SUFFIX".2", NULL);
-	fd = safe_open(path, O_RDWR);
+	fd = nfs_safe_open(path, O_RDWR);
 	if (fd == -1) {
 		if (errno == ENOENT)
 			return 0;