]>
Commit | Line | Data |
---|---|---|
7ac48069 | 1 | /* $Id$ |
d77bf7b9 | 2 | * |
7ac48069 | 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>. | |
d77bf7b9 | 6 | */ |
7 | ||
7ac48069 | 8 | #include <mit-copyright.h> |
9 | #include <moira.h> | |
10 | #include "dump_db.h" | |
d77bf7b9 | 11 | |
12 | #include <stdio.h> | |
d77bf7b9 | 13 | |
7ac48069 | 14 | RCSID("$Header$"); |
15 | ||
16 | extern void sqlglm(char *, unsigned int *, unsigned int *); | |
17 | ||
18 | void punt(char *msg) | |
d77bf7b9 | 19 | { |
5eaef520 | 20 | perror(msg); |
21 | exit(1); | |
d77bf7b9 | 22 | } |
b4188632 | 23 | |
7ac48069 | 24 | void dbmserr(void) |
b4188632 | 25 | { |
5eaef520 | 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); | |
b4188632 | 35 | } |