aboutsummaryrefslogtreecommitdiff
path: root/src/gsql_conn.c
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2005-06-26 10:38:26 +0000
committerSergey Poznyakoff <gray@gnu.org.ua>2005-06-26 10:38:26 +0000
commit4987cf3134f116d1881602141ccc5ee7d572b8de (patch)
treea86f7135fd97098f6d98aeeabe0799e20615d91c /src/gsql_conn.c
parentd47c213bb55adbe961c54242c642c2d1b7c3ec6c (diff)
downloadgamma-4987cf3134f116d1881602141ccc5ee7d572b8de.tar.gz
gamma-4987cf3134f116d1881602141ccc5ee7d572b8de.tar.bz2
Throw gsql-error, instead of misc-error, on failure
Diffstat (limited to 'src/gsql_conn.c')
-rw-r--r--src/gsql_conn.c22
1 files changed, 13 insertions, 9 deletions
diff --git a/src/gsql_conn.c b/src/gsql_conn.c
index 77fc60e..4a48de7 100644
--- a/src/gsql_conn.c
+++ b/src/gsql_conn.c
@@ -1,5 +1,5 @@
/* This file is part of guile-sql.
- Copyright (C) 2002 Sergey Poznyakoff
+ Copyright (C) 2002, 2005 Sergey Poznyakoff
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -25,6 +25,9 @@
int num_iface;
struct sql_iface sql_iftab[MAX_IFACES];
+SCM_GLOBAL_SYMBOL (gsql_error, "gsql-error");
+
+
long sql_connect_tag;
/* SMOB functions: */
@@ -120,7 +123,8 @@ SCM_DEFINE (sql_connect, "sql-connect", 5, 1, 0,
char *user;
char *pass;
int iface;
-
+ struct sql_connect *conn;
+
if (SCM_IMP(IFACE) && SCM_INUMP(IFACE))
iface = SCM_INUM(IFACE);
else if (SCM_STRINGP(IFACE))
@@ -157,13 +161,13 @@ SCM_DEFINE (sql_connect, "sql-connect", 5, 1, 0,
smob = sql_iftab[iface].connect(hostname, port,
dbname, user, pass,
FUNC_NAME);
- if (smob != SCM_BOOL_F) {
- struct sql_connect *conn = (struct sql_connect *)SCM_CDR(smob);
- conn->hostname = strdup(hostname);
- conn->port = port;
- conn->username = strdup(user);
- conn->database = strdup(dbname);
- }
+
+ conn = (struct sql_connect *)SCM_CDR(smob);
+ conn->hostname = strdup(hostname);
+ conn->port = port;
+ conn->username = strdup(user);
+ conn->database = strdup(dbname);
+
return smob;
}
#undef FUNC_NAME

Return to:

Send suggestions and report system problems to the System administrator.