aboutsummaryrefslogtreecommitdiffstats
path: root/mail/mail-config.c
diff options
context:
space:
mode:
authorTor Lillqvist <tml@novell.com>2005-12-18 16:24:26 +0800
committerTor Lillqvist <tml@src.gnome.org>2005-12-18 16:24:26 +0800
commit448d624c00f0c4e12917a4d31babd10555b2e8a4 (patch)
treec44c6e6864f1e0cd34455da2e71fc33ca13d61e6 /mail/mail-config.c
parent2f1a024be76933ba28ab80e76a52ff46358e33dd (diff)
downloadgsoc2013-evolution-448d624c00f0c4e12917a4d31babd10555b2e8a4.tar.gz
gsoc2013-evolution-448d624c00f0c4e12917a4d31babd10555b2e8a4.tar.zst
gsoc2013-evolution-448d624c00f0c4e12917a4d31babd10555b2e8a4.zip
em-folder-browser.c em-folder-view.c em-format-html.c
2005-12-18 Tor Lillqvist <tml@novell.com> * em-folder-browser.c * em-folder-view.c * em-format-html.c * em-format-html-display.c * em-mailer-prefs.c * em-message-browser.c * em-migrate.c * em-subscribe-editor.c * em-sync-stream.c * em-utils.c * em-vfolder-editor.c * em-vfolder-rule.c * mail-autofilter.c * mail-component.c * mail-config.c * mail-folder-cache.c: Use gstdio wrappers. Construct pathnames of glade, xml, etspec and png files at run-time. Use g_filename_{to,from}_uri(). * em-folder-browser.c (emfb_init) * em-folder-view.c (emfv_finalise) * em-message-browser.c (emmb_init): As EMFolderView::ui_files now always is a list of filenames constructed with g_build_filename(), use g_free() on each list entry before calling g_slist_free() on the list. * em-folder-tree-model.c (em_folder_tree_model_load_state): Use e_xml_parse_file(). * em-migrate.c: Bypass all the code for upgrading from 1.x on Win32. (emm_setup_initial): Use GDir instead of dirent. * em-sync-stream.c * mail-folder-cache.c: Use pthread_equal() to compare pthread_t values. * em-vfs-stream.c: No EINPROGRESS or ELOOP on Win32. svn path=/trunk/; revision=30854
Diffstat (limited to 'mail/mail-config.c')
-rw-r--r--mail/mail-config.c30
1 files changed, 21 insertions, 9 deletions
diff --git a/mail/mail-config.c b/mail/mail-config.c
index 6619b49b84..8900295ad4 100644
--- a/mail/mail-config.c
+++ b/mail/mail-config.c
@@ -29,8 +29,6 @@
#include <sys/stat.h>
#include <unistd.h>
#include <fcntl.h>
-#include <pwd.h>
-#include <sys/wait.h>
#include <signal.h>
#include <errno.h>
@@ -38,6 +36,12 @@
#include <ctype.h>
#include <glib.h>
+#include <glib/gstdio.h>
+
+#ifndef G_OS_WIN32
+#include <sys/wait.h>
+#endif
+
#include <gtk/gtkdialog.h>
#include <gtkhtml/gtkhtml.h>
#include <glade/glade.h>
@@ -71,6 +75,10 @@
#include "mail-mt.h"
#include "mail-tools.h"
+#if !GLIB_CHECK_VERSION (2, 8, 0)
+#define g_creat creat
+#endif
+
/* Note, the first element of each MailConfigLabel must NOT be translated */
MailConfigLabel label_defaults[5] = {
{ "important", N_("Important"), "#ff0000" }, /* red */
@@ -252,7 +260,7 @@ config_write_style (void)
char *citation_color;
FILE *rc;
- if (!(rc = fopen (config->gtkrc, "wt"))) {
+ if (!(rc = g_fopen (config->gtkrc, "wt"))) {
g_warning ("unable to open %s", config->gtkrc);
return;
}
@@ -823,7 +831,7 @@ mail_config_uri_renamed (GCompareFunc uri_cmp, const char *old, const char *new)
oldname = uri_to_evname (old, cachenames[i]);
newname = uri_to_evname (new, cachenames[i]);
/*printf ("** renaming %s to %s\n", oldname, newname);*/
- rename (oldname, newname);
+ g_rename (oldname, newname);
g_free (oldname);
g_free (newname);
}
@@ -917,9 +925,9 @@ get_new_signature_filename (void)
base_directory = mail_component_peek_base_directory (mail_component_peek ());
filename = g_build_filename (base_directory, "signatures", NULL);
- if (lstat (filename, &st)) {
+ if (g_lstat (filename, &st)) {
if (errno == ENOENT) {
- if (mkdir (filename, 0700))
+ if (g_mkdir (filename, 0700))
g_warning ("Fatal problem creating %s directory.", filename);
} else
g_warning ("Fatal problem with %s directory.", filename);
@@ -932,10 +940,10 @@ get_new_signature_filename (void)
for (i = 0; i < (INT_MAX - 1); i++) {
sprintf (id, "%d", i);
- if (lstat (filename, &st) == -1 && errno == ENOENT) {
+ if (g_lstat (filename, &st) == -1 && errno == ENOENT) {
int fd;
- fd = creat (filename, 0600);
+ fd = g_creat (filename, 0600);
if (fd >= 0) {
close (fd);
return filename;
@@ -990,7 +998,7 @@ void
mail_config_remove_signature (ESignature *signature)
{
if (signature->filename && !signature->script)
- unlink (signature->filename);
+ g_unlink (signature->filename);
e_signature_list_remove (config->signatures, signature);
mail_config_save_signatures ();
@@ -999,6 +1007,7 @@ mail_config_remove_signature (ESignature *signature)
char *
mail_config_signature_run_script (const char *script)
{
+#ifndef G_OS_WIN32
int result, status;
int in_fds[2];
pid_t pid;
@@ -1104,4 +1113,7 @@ mail_config_signature_run_script (const char *script)
return content;
}
+#else
+ return NULL;
+#endif
}