From bf654ba1b41078993609e1587f558f9d89b26921 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Ho=C3=A0=20Vi=C3=AAt=20Dinh?= Date: Sat, 13 Aug 2005 16:47:45 +0000 Subject: [PATCH] 2005-08-13 [hoa] 1.9.13cvs33 * src/etpan/imap-thread.c fixed build on Solaris. --- ChangeLog-gtk2.claws | 5 +++++ PATCHSETS | 1 + configure.ac | 2 +- src/etpan/imap-thread.c | 27 ++++++++++++++++++++++++--- 4 files changed, 31 insertions(+), 4 deletions(-) diff --git a/ChangeLog-gtk2.claws b/ChangeLog-gtk2.claws index 61b91a778..43e62aee8 100644 --- a/ChangeLog-gtk2.claws +++ b/ChangeLog-gtk2.claws @@ -1,3 +1,8 @@ +2005-08-13 [hoa] 1.9.13cvs33 + + * src/etpan/imap-thread.c + fixed build on Solaris. + 2005-08-10 [colin] 1.9.13cvs32 * src/procmsg.c diff --git a/PATCHSETS b/PATCHSETS index 5b63ace47..66cedf5b7 100644 --- a/PATCHSETS +++ b/PATCHSETS @@ -718,3 +718,4 @@ ( cvs diff -u -r 1.274.2.54 -r 1.274.2.55 src/mainwindow.c; ) > 1.9.13cvs30.patchset ( cvs diff -u -r 1.150.2.35 -r 1.150.2.36 src/procmsg.c; ) > 1.9.13cvs31.patchset ( cvs diff -u -r 1.150.2.36 -r 1.150.2.37 src/procmsg.c; ) > 1.9.13cvs32.patchset +( cvs diff -u -r 1.1.4.14 -r 1.1.4.15 src/etpan/imap-thread.c; ) > 1.9.13cvs33.patchset diff --git a/configure.ac b/configure.ac index d1de90f66..54790260a 100644 --- a/configure.ac +++ b/configure.ac @@ -11,7 +11,7 @@ MINOR_VERSION=9 MICRO_VERSION=13 INTERFACE_AGE=0 BINARY_AGE=0 -EXTRA_VERSION=32 +EXTRA_VERSION=33 EXTRA_RELEASE= EXTRA_GTK2_VERSION= diff --git a/src/etpan/imap-thread.c b/src/etpan/imap-thread.c index e801dcb78..43e083b68 100644 --- a/src/etpan/imap-thread.c +++ b/src/etpan/imap-thread.c @@ -2125,33 +2125,54 @@ int imap_threaded_store(Folder * folder, struct mailimap_set * set, } +#define ENV_BUFFER_SIZE 512 static void do_exec_command(int fd, const char * command, const char * servername, uint16_t port) { int i, maxopen; - +#ifdef SOLARIS + char env_buffer[ENV_BUFFER_SIZE]; +#endif + if (fork() > 0) { /* Fork again to become a child of init rather than the etpan client. */ exit(0); } +#ifdef SOLARIS + if (servername) + snprintf(env_buffer, ENV_BUFFER_SIZE, + "ETPANSERVER=%s", servername); + else + snprintf(env_buffer, ENV_BUFFER_SIZE, "ETPANSERVER="); + putenv(env_buffer); +#else if (servername) setenv("ETPANSERVER", servername, 1); else unsetenv("ETPANSERVER"); +#endif +#ifdef SOLARIS + if (port) + snprintf(env_buffer, ENV_BUFFER_SIZE, "ETPANPORT=%d", port); + else + snprintf(env_buffer, ENV_BUFFER_SIZE, "ETPANPORT="); + putenv(env_buffer); +#else if (port) { char porttext[20]; - + snprintf(porttext, sizeof(porttext), "%d", port); setenv("ETPANPORT", porttext, 1); } else { unsetenv("ETPANPORT"); } - +#endif + /* Not a lot we can do if there's an error other than bail. */ if (dup2(fd, 0) == -1) exit(1); -- 2.25.1