O_LARGEFILE fixes
Jeffrey Stedfast <[email protected]>
| Newsgroups | gmane.comp.gnome.evolution.patches |
|---|---|
| Organization | Novell, Inc. |
| Message-ID | <[email protected]> |
I think configure.in will still need to be patched to add something like -D_LARGEFILE_SOURCE or some such to the build flags, but I'm not sure how best to detect if the system supports large file support. It may also be necessary to #define O_LARGEFILE to 0 for systems without O_LARGEFILE defined. -- Jeffrey Stedfast Evolution Hacker - Novell, Inc. [email protected] - www.novell.com _______________________________________________ Evolution-patches mailing list [email protected] http://mail.gnome.org/mailman/listinfo/evolution-patches
largefile-mbox.patch
(text/x-patch, 4.7 KB)
? largefile-mbox.patch Index: ChangeLog =================================================================== RCS file: /cvs/gnome/evolution-data-server/camel/providers/local/ChangeLog,v retrieving revision 1.18 diff -u -r1.18 ChangeLog --- ChangeLog 28 Mar 2006 05:07:14 -0000 1.18 +++ ChangeLog 28 Mar 2006 16:44:30 -0000 @@ -1,3 +1,15 @@ +2006-03-28 Jeffrey Stedfast <[email protected]> + + * camel-mbox-summary.c (summary_update, mbox_summary_sync_full), + (mbox_summary_sync_full, mbox_summary_sync_quick): Use O_LARGEFILE + when opening the mbox file. + + * camel-mbox-store.c (get_folder): Use O_LARGEFILE when opening + the mbox file. + + * camel-mbox-folder.c (mbox_append_message, mbox_get_message): Use + O_LARGEFILE when opening the mbox file. + 2006-03-28 Parthasarathi Susarla <[email protected]> ** See bug 160889 on bugzilla.novell.com Index: camel-mbox-folder.c =================================================================== RCS file: /cvs/gnome/evolution-data-server/camel/providers/local/camel-mbox-folder.c,v retrieving revision 1.42 diff -u -r1.42 camel-mbox-folder.c --- camel-mbox-folder.c 9 Dec 2005 07:57:08 -0000 1.42 +++ camel-mbox-folder.c 28 Mar 2006 16:44:30 -0000 @@ -28,6 +28,7 @@ #include <sys/types.h> #include <sys/stat.h> #include <unistd.h> +#include <fcntl.h> #include <errno.h> #include <string.h> @@ -291,7 +292,7 @@ g_free(fromline); /* reset the file to original size */ - fd = g_open(lf->folder_path, O_WRONLY | O_BINARY, 0600); + fd = g_open(lf->folder_path, O_LARGEFILE | O_WRONLY | O_BINARY, 0600); if (fd != -1) { ftruncate(fd, mbs->folder_size); close(fd); @@ -362,7 +363,7 @@ with no stream). This means we dont have to lock the mbox for the life of the message, but only while it is being created. */ - fd = g_open(lf->folder_path, O_RDONLY | O_BINARY, 0); + fd = g_open(lf->folder_path, O_LARGEFILE | O_RDONLY | O_BINARY, 0); if (fd == -1) { camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM, _("Cannot get message: %s from folder %s\n %s"), Index: camel-mbox-store.c =================================================================== RCS file: /cvs/gnome/evolution-data-server/camel/providers/local/camel-mbox-store.c,v retrieving revision 1.45 diff -u -r1.45 camel-mbox-store.c --- camel-mbox-store.c 28 Mar 2006 05:07:14 -0000 1.45 +++ camel-mbox-store.c 28 Mar 2006 16:44:31 -0000 @@ -27,6 +27,7 @@ #include <sys/types.h> #include <sys/stat.h> #include <unistd.h> +#include <fcntl.h> #include <errno.h> #include <glib.h> @@ -180,7 +181,7 @@ g_free(dirname); - fd = g_open(name, O_WRONLY | O_CREAT | O_APPEND | O_BINARY, 0666); + fd = g_open(name, O_LARGEFILE | O_WRONLY | O_CREAT | O_APPEND | O_BINARY, 0666); if (fd == -1) { camel_exception_setv(ex, CAMEL_EXCEPTION_SYSTEM, _("Cannot create folder `%s': %s"), Index: camel-mbox-summary.c =================================================================== RCS file: /cvs/gnome/evolution-data-server/camel/providers/local/camel-mbox-summary.c,v retrieving revision 1.56 diff -u -r1.56 camel-mbox-summary.c --- camel-mbox-summary.c 8 Dec 2005 11:28:47 -0000 1.56 +++ camel-mbox-summary.c 28 Mar 2006 16:44:31 -0000 @@ -26,6 +26,7 @@ #include <sys/types.h> #include <sys/stat.h> #include <unistd.h> +#include <fcntl.h> #include <errno.h> #include <string.h> #include <stdlib.h> @@ -414,7 +415,7 @@ camel_operation_start(NULL, _("Storing folder")); - fd = g_open(cls->folder_path, O_RDONLY | O_BINARY, 0); + fd = g_open(cls->folder_path, O_LARGEFILE | O_RDONLY | O_BINARY, 0); if (fd == -1) { d(printf("%s failed to open: %s\n", cls->folder_path, strerror (errno))); camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM, @@ -587,7 +588,7 @@ camel_operation_start(NULL, _("Storing folder")); - fd = g_open(cls->folder_path, O_RDONLY | O_BINARY, 0); + fd = g_open(cls->folder_path, O_LARGEFILE | O_RDONLY | O_BINARY, 0); if (fd == -1) { camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM, _("Could not open file: %s: %s"), @@ -599,7 +600,7 @@ tmpname = g_alloca (strlen (cls->folder_path) + 5); sprintf (tmpname, "%s.tmp", cls->folder_path); d(printf("Writing tmp file to %s\n", tmpname)); - fdout = g_open(tmpname, O_WRONLY|O_CREAT|O_TRUNC|O_BINARY, 0600); + fdout = g_open(tmpname, O_LARGEFILE|O_WRONLY|O_CREAT|O_TRUNC|O_BINARY, 0600); if (fdout == -1) { camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM, _("Cannot open temporary mailbox: %s"), @@ -682,7 +683,7 @@ camel_operation_start(NULL, _("Storing folder")); - fd = g_open(cls->folder_path, O_RDWR|O_BINARY, 0); + fd = g_open(cls->folder_path, O_LARGEFILE|O_RDWR|O_BINARY, 0); if (fd == -1) { camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM, _("Could not open file: %s: %s"),