Revision 24319,
842 bytes
checked in by broder, 14 years ago
(diff) |
New Moira snapshot from SVN.
|
Rev | Line | |
---|
[24319] | 1 | /* $Id: dumprest.pc 3956 2010-01-05 20:56:56Z zacheiss $ |
---|
[23095] | 2 | * |
---|
| 3 | * (c) Copyright 1988-1998 by the Massachusetts Institute of Technology. |
---|
| 4 | * For copying and distribution information, please see the file |
---|
| 5 | * <mit-copyright.h>. |
---|
| 6 | */ |
---|
| 7 | |
---|
| 8 | #include <mit-copyright.h> |
---|
| 9 | #include <moira.h> |
---|
| 10 | #include "dump_db.h" |
---|
| 11 | |
---|
| 12 | #include <stdio.h> |
---|
| 13 | |
---|
[24319] | 14 | RCSID("$HeadURL: svn+ssh://svn.mit.edu/moira/trunk/moira/backup/dumprest.pc $ $Id: dumprest.pc 3956 2010-01-05 20:56:56Z zacheiss $"); |
---|
[23095] | 15 | |
---|
| 16 | extern void sqlglm(char *, unsigned int *, unsigned int *); |
---|
| 17 | |
---|
| 18 | void punt(char *msg) |
---|
| 19 | { |
---|
| 20 | perror(msg); |
---|
| 21 | exit(1); |
---|
| 22 | } |
---|
| 23 | |
---|
| 24 | void dbmserr(void) |
---|
| 25 | { |
---|
| 26 | EXEC SQL BEGIN DECLARE SECTION; |
---|
| 27 | char err_msg[256]; |
---|
| 28 | EXEC SQL END DECLARE SECTION; |
---|
| 29 | int bufsize = 256, msglength = 0; |
---|
| 30 | |
---|
| 31 | sqlglm(err_msg, &bufsize, &msglength); |
---|
| 32 | err_msg[msglength] = '\0'; |
---|
| 33 | fprintf(stderr, "Fatal SQL error:\n%s", err_msg); |
---|
| 34 | exit(1); |
---|
| 35 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.