Fix bug 589673 - need to patch libdbi source for win32 problem.

The patch exists in libdbi source, but not in 0.8.3.  The problem is that "errno" is used
as a routine parameter name.  The parameters are accessed incorrectly leading to a segmentation
violation.


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@18312 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
Phil Longstaff 2009-09-14 01:00:47 +00:00
parent 3cb697a9eb
commit 166a48c12d
3 changed files with 45 additions and 1 deletions

View File

@ -292,6 +292,7 @@ set_default PGSQL_DIR $GLOBAL_DIR\\pgsql
set_default LIBDBI_URL "http://downloads.sourceforge.net/libdbi/libdbi-0.8.3.tar.gz"
set_default LIBDBI_DIR $GLOBAL_DIR\\libdbi
set_default LIBDBI_PATCH `pwd`/libdbi-0.8.3.patch
set_default LIBDBI_PATCH2 `pwd`/libdbi-dbd_helper.c.patch
set_default LIBDBI_DRIVERS_URL "http://downloads.sourceforge.net/libdbi-drivers/libdbi-drivers-0.8.3-1.tar.gz"
set_default LIBDBI_DRIVERS_DIR $GLOBAL_DIR\\libdbi-drivers
set_default LIBDBI_DRIVERS_PATCH `pwd`/libdbi-drivers-dbd_sqlite3.c.patch

View File

@ -111,7 +111,7 @@ function inst_dtk() {
if quiet ${_MSYS_UDIR}/bin/perl --help &&
[ "`m4 --version | sed '1!d;s,.* [Mm]4 ,,'`" = "1.4.7" ]
then
echo "msys dtk already installed. skipping."
echo "msys dtk already installed. skipping."
else
smart_wget $DTK_URL $DOWNLOAD_DIR
$LAST_FILE //SP- //SILENT //DIR="$MSYS_DIR"
@ -1094,6 +1094,9 @@ function inst_libdbi() {
patch -p1 < $LIBDBI_PATCH
./autogen.sh
fi
if [ -n "$LIBDBI_PATCH2" -a -f "$LIBDBI_PATCH2" ]; then
patch -p1 < $LIBDBI_PATCH2
fi
./configure ${HOST_XCOMPILE} \
--disable-docs \
--prefix=${_LIBDBI_UDIR}

View File

@ -0,0 +1,40 @@
--- libdbi-0.8.3/src/dbd_helper.c.orig Sun Sep 13 16:34:39 2009
+++ libdbi-0.8.3/src/dbd_helper.c Sun Sep 13 16:35:02 2009
@@ -145,7 +145,7 @@
return len;
}
-void _dbd_internal_error_handler(dbi_conn_t *conn, const char *errmsg, const int errno) {
+void _dbd_internal_error_handler(dbi_conn_t *conn, const char *errmsg, const int err_no) {
int my_errno = DBI_ERROR_NONE;
int errstatus;
char *my_errmsg = NULL;
@@ -154,7 +154,7 @@
free(conn->error_message);
}
- if (errno == DBI_ERROR_DBD) {
+ if (err_no == DBI_ERROR_DBD) {
/* translate into a client-library specific error number */
errstatus = conn->driver->functions->geterror(conn, &my_errno, &my_errmsg);
@@ -171,8 +171,8 @@
}
}
else if (errmsg) {
- conn->error_flag = errno; /* legacy code may rely on this */
- conn->error_number = errno;
+ conn->error_flag = err_no; /* legacy code may rely on this */
+ conn->error_number = err_no;
conn->error_message = strdup(errmsg);
if (conn->error_handler != NULL) {
@@ -181,7 +181,7 @@
}
else {
/* pass internal errors to the internal libdbi handler */
- _error_handler(conn, errno);
+ _error_handler(conn, err_no);
}
}