Wrap file I/O to claws_* to benefit from custom locking when
[claws.git] / src / imap.c
index 4982b61618f745825ad87734387f233df6cf6738..5871b79f3d5af68b558144097b1bf7e1f3c2fc7f 100644 (file)
@@ -71,6 +71,7 @@
 #include "tags.h"
 #include "main.h"
 #include "passwordstore.h"
+#include "claws_io.h"
 
 typedef struct _IMAPFolder     IMAPFolder;
 typedef struct _IMAPSession    IMAPSession;
@@ -1377,17 +1378,17 @@ static guint get_file_size_with_crs(const gchar *filename)
        if (filename == NULL)
                return -1;
        
-       fp = g_fopen(filename, "rb");
+       fp = claws_fopen(filename, "rb");
        if (!fp)
                return -1;
        
-       while (fgets(buf, sizeof (buf), fp) != NULL) {
+       while (claws_fgets(buf, sizeof (buf), fp) != NULL) {
                cnt += strlen(buf);
                if (!strstr(buf, "\r\n") && strstr(buf, "\n"))
                        cnt++;
        }
        
-       fclose(fp);
+       claws_fclose(fp);
        return cnt;
 }