Update of /cvsroot/firebug/fireboard/beta/tools/src/xlisten
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30285
Modified Files:
xdb.c xlisten.c
Log Message:
Added db to command line.
Index: xdb.c
===================================================================
RCS file: /cvsroot/firebug/fireboard/beta/tools/src/xlisten/xdb.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** xdb.c 17 Jun 2005 22:09:49 -0000 1.4
--- xdb.c 17 Jun 2005 23:23:36 -0000 1.5
***************
*** 29,35 ****
int errno;
char command[256];
! char * statement = "create database %s template firebug";
sprintf(command,statement,dbname);
errno = xdb_execute(command);
}
--- 29,44 ----
int errno;
char command[256];
! char * statement = "create database %s";
sprintf(command,statement,dbname);
errno = xdb_execute(command);
+
+ #if 0
+ if (errno == 0) {
+ g_dbname = dbname;
+ } else {
+ exit(0);
+ }
+ #endif
+
}
***************
*** 106,111 ****
{
errno = PQresultStatus(res);
! if (errno > PGRES_COMMAND_OK)
fprintf(stderr, "error: DATABASE command failed: %i\n", errno);
PQclear(res);
}
--- 115,122 ----
{
errno = PQresultStatus(res);
! if (errno > PGRES_COMMAND_OK) {
fprintf(stderr, "error: DATABASE command failed: %i\n", errno);
+ fprintf(stderr,"%s",PQresultErrorMessage(res));
+ }
PQclear(res);
}
Index: xlisten.c
===================================================================
RCS file: /cvsroot/firebug/fireboard/beta/tools/src/xlisten/xlisten.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** xlisten.c 17 Jun 2005 22:09:49 -0000 1.4
--- xlisten.c 17 Jun 2005 23:23:41 -0000 1.5
***************
*** 159,164 ****
if (argv[argc][2] == '=') {
//xdb_set_table(argv[argc]+3);
- xdb_set_dbname(argv[argc]+3);
printf("dbname=%s\n",argv[argc]+3);
//exit(0);
}
--- 159,164 ----
if (argv[argc][2] == '=') {
//xdb_set_table(argv[argc]+3);
printf("dbname=%s\n",argv[argc]+3);
+ xdb_set_dbname(argv[argc]+3);
//exit(0);
}
|