ports/mail/vpopmail/files/patch-vpgsql.c
Peter Pentchev 2cb9f94f22 Make the PostgreSQL backend actually compile with the new
WITH_SQL_LOG_REMOVE_DELETED knob - fix the name of a variable and
a standard PostgreSQL routine.

Pointy hat to:	roam (myself), in addition to the upstream developers
2006-10-08 17:29:02 +00:00

47 lines
1.3 KiB
C

diff -urN -x .svn ../../vendor/vpopmail/vpgsql.c ./vpgsql.c
--- ../../vendor/vpopmail/vpgsql.c Wed Oct 4 13:19:16 2006
+++ ./vpgsql.c Sun Oct 8 17:20:54 2006
@@ -16,6 +16,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
+#include <ctype.h>
#include <pwd.h>
#include <unistd.h>
#include <stdio.h>
@@ -389,13 +390,15 @@
#endif
#ifdef ENABLE_SQL_LOGGING
- qnprintf( sqlBufUpdate, SQL_BUF_SIZE,
+#ifdef ENABLE_SQL_REMOVE_DELETED
+ qnprintf( SqlBufUpdate, SQL_BUF_SIZE,
"delete from vlog where domain = '%s'", domain );
pgres=PQexec(pgc, SqlBufUpdate);
- if( !pgres || PGresultStatus(pgres)!=PGRES_COMMAND_OK) {
+ if( !pgres || PQresultStatus(pgres)!=PGRES_COMMAND_OK) {
return(-1);
}
#endif
+#endif
return(0);
}
@@ -442,13 +445,15 @@
#endif
#ifdef ENABLE_SQL_LOGGING
- qnprintf( sqlBufUpdate, SQL_BUF_SIZE,
+#ifdef ENABLE_SQL_REMOVE_DELETED
+ qnprintf( SqlBufUpdate, SQL_BUF_SIZE,
"delete from vlog where domain = '%s' and user='%s'",
domain, user );
pgres=PQexec(pgc, SqlBufUpdate);
- if( !pgres || PGresultStatus(pgres)!=PGRES_COMMAND_OK) {
+ if( !pgres || PQresultStatus(pgres)!=PGRES_COMMAND_OK) {
err = -1;
}
+#endif
#endif
return(err);