From: Tor Lillqvist Date: Fri, 9 Dec 2005 07:57:08 +0000 (+0000) Subject: Just #define O_BINARY as 0 on Unix, less ifdefs that way. Should really do X-Git-Tag: upstream/3.7.4~6706 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=7715ef854b32f1200578c5f6aee23bb884226726;p=platform%2Fupstream%2Fevolution-data-server.git Just #define O_BINARY as 0 on Unix, less ifdefs that way. Should really do 2005-12-09 Tor Lillqvist * camel-mbox-folder.c: Just #define O_BINARY as 0 on Unix, less ifdefs that way. Should really do this in some suitable header, of course, and not duplicate here and there. --- diff --git a/camel/providers/local/ChangeLog b/camel/providers/local/ChangeLog index d5018e8..8545055 100644 --- a/camel/providers/local/ChangeLog +++ b/camel/providers/local/ChangeLog @@ -1,3 +1,9 @@ +2005-12-09 Tor Lillqvist + + * camel-mbox-folder.c: Just #define O_BINARY as 0 on Unix, less + ifdefs that way. Should really do this in some suitable header, of + course, and not duplicate here and there. + 2005-12-09 David Malcolm * camel-local-folder.c: restore missing declarations for non-Win32 diff --git a/camel/providers/local/camel-mbox-folder.c b/camel/providers/local/camel-mbox-folder.c index 415eb39..d4ad3aa 100644 --- a/camel/providers/local/camel-mbox-folder.c +++ b/camel/providers/local/camel-mbox-folder.c @@ -47,6 +47,10 @@ #include "camel-mbox-store.h" #include "camel-mbox-summary.h" +#ifndef O_BINARY +#define O_BINARY 0 +#endif + #define d(x) /*(printf("%s(%d): ", __FILE__, __LINE__),(x))*/ static CamelLocalFolderClass *parent_class = NULL; @@ -185,7 +189,6 @@ mbox_append_message(CamelFolder *folder, CamelMimeMessage * message, const Camel char *fromline = NULL; int fd, retval; struct stat st; - int mode; #if 0 char *xev; #endif @@ -288,12 +291,7 @@ fail_write: g_free(fromline); /* reset the file to original size */ -#ifdef G_OS_WIN32 - mode = O_WRONLY | O_BINARY; -#else - mode = O_WRONLY; -#endif - fd = g_open(lf->folder_path, mode, 0600); + fd = g_open(lf->folder_path, O_WRONLY | O_BINARY, 0600); if (fd != -1) { ftruncate(fd, mbs->folder_size); close(fd); @@ -329,7 +327,6 @@ mbox_get_message(CamelFolder *folder, const gchar * uid, CamelException *ex) int fd, retval; int retried = FALSE; off_t frompos; - int mode; d(printf("Getting message %s\n", uid)); @@ -365,13 +362,7 @@ retry: 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. */ -#ifdef G_OS_WIN32 - mode = O_RDONLY | O_BINARY; -#else - mode = O_RDONLY; -#endif - - fd = g_open(lf->folder_path, mode, 0); + fd = g_open(lf->folder_path, O_RDONLY | O_BINARY, 0); if (fd == -1) { camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM, _("Cannot get message: %s from folder %s\n %s"),