masqmail

changeset 377:9bc3e47b0222

Various cleanups to remove compiler warnings. We're clean now, if we specify `-Wno-pointer-sign'.
author markus schnalke <meillo@marmaro.de>
date Sat, 14 Jan 2012 18:44:48 +0100
parents 028bc124d744
children 5781ba87df95
files src/accept.c src/log.c src/peopen.c src/readsock.c src/smtp_out.h
diffstat 5 files changed, 23 insertions(+), 28 deletions(-) [+]
line diff
     1.1 --- a/src/accept.c	Sat Jan 14 18:20:03 2012 +0100
     1.2 +++ b/src/accept.c	Sat Jan 14 18:44:48 2012 +0100
     1.3 @@ -42,19 +42,6 @@
     1.4  	return res;
     1.5  }
     1.6  
     1.7 -static gint
     1.8 -_g_list_addr_isequal(gconstpointer a, gconstpointer b)
     1.9 -{
    1.10 -	address *addr1 = (address *) a;
    1.11 -	address *addr2 = (address *) b;
    1.12 -	int ret;
    1.13 -
    1.14 -	if ((ret = strcasecmp(addr1->domain, addr2->domain)) == 0) {
    1.15 -		return strcmp(addr1->local_part, addr2->local_part);
    1.16 -	}
    1.17 -	return ret;
    1.18 -}
    1.19 -
    1.20  /*
    1.21  **  accept message from anywhere.
    1.22  **  A message from local is indicated by msg->recieved_host == NULL
     2.1 --- a/src/log.c	Sat Jan 14 18:20:03 2012 +0100
     2.2 +++ b/src/log.c	Sat Jan 14 18:44:48 2012 +0100
     2.3 @@ -17,6 +17,7 @@
     2.4  **  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
     2.5  */
     2.6  
     2.7 +#include <sys/stat.h>
     2.8  #include <sysexits.h>
     2.9  
    2.10  #include "masqmail.h"
     3.1 --- a/src/peopen.c	Sat Jan 14 18:20:03 2012 +0100
     3.2 +++ b/src/peopen.c	Sat Jan 14 18:44:48 2012 +0100
     3.3 @@ -15,18 +15,20 @@
     3.4  #include "peopen.h"
     3.5  #include "masqmail.h"
     3.6  
     3.7 -static void
     3.8 -destroy_argv(char **arr)
     3.9 -{
    3.10 -	char *p = arr[0];
    3.11 -	int i = 0;
    3.12 -
    3.13 -	while (p) {
    3.14 -		free(p);
    3.15 -		p = arr[i++];
    3.16 -	}
    3.17 -	free(arr);
    3.18 -}
    3.19 +/*
    3.20 +** static void
    3.21 +** destroy_argv(char **arr)
    3.22 +** {
    3.23 +** 	char *p = arr[0];
    3.24 +** 	int i = 0;
    3.25 +** 
    3.26 +** 	while (p) {
    3.27 +** 		free(p);
    3.28 +** 		p = arr[i++];
    3.29 +** 	}
    3.30 +** 	free(arr);
    3.31 +** }
    3.32 +*/
    3.33  
    3.34  static char**
    3.35  create_argv(const char *cmd, int count)
     4.1 --- a/src/readsock.c	Sat Jan 14 18:20:03 2012 +0100
     4.2 +++ b/src/readsock.c	Sat Jan 14 18:44:48 2012 +0100
     4.3 @@ -25,7 +25,6 @@
     4.4  #include <ctype.h>
     4.5  
     4.6  #include "readsock.h"
     4.7 -/*#include "masqmail.h"*/
     4.8  
     4.9  jmp_buf jmp_timeout;
    4.10  
    4.11 @@ -150,8 +149,13 @@
    4.12  		_read_chug(in);
    4.13  	}
    4.14  
    4.15 -	if (!*pbuf)
    4.16 -		*pbuf = (char *) g_malloc(size);
    4.17 +	if (!*pbuf) {
    4.18 +		*pbuf = (char *) malloc(size);
    4.19 +		if (!*pbuf) {
    4.20 +			fprintf(stderr, "Out of memory.\n");
    4.21 +			exit(1);
    4.22 +		}
    4.23 +	}
    4.24  	buf = *pbuf;
    4.25  
    4.26  	while (1) {
     5.1 --- a/src/smtp_out.h	Sat Jan 14 18:20:03 2012 +0100
     5.2 +++ b/src/smtp_out.h	Sat Jan 14 18:44:48 2012 +0100
     5.3 @@ -81,5 +81,6 @@
     5.4  gboolean smtp_out_init(smtp_base *psb, gboolean instant_helo);
     5.5  gint smtp_out_msg(smtp_base *psb, message *msg, address *return_path, GList *rcpt_list, GList *hdr_list);
     5.6  gboolean smtp_out_quit(smtp_base *psb);
     5.7 +void smtp_out_mark_rcpts(smtp_base *psb, GList *rcpt_list);
     5.8  
     5.9  gint smtp_deliver(gchar *host, gint port, GList *resolve_list, message *msg, address *return_path, GList *rcpt_list);