Changeset: 41bee9cc14cc for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/41bee9cc14cc
Modified Files:
clients/mapiclient/mclient.c
clients/mapilib/mapi.c
Branch: client_interrupts
Log Message:
A little cleanup.
diffs (62 lines):
diff --git a/clients/mapiclient/mclient.c b/clients/mapiclient/mclient.c
--- a/clients/mapiclient/mclient.c
+++ b/clients/mapiclient/mclient.c
@@ -1692,9 +1692,8 @@ SQLrenderer(MapiHdl hdl)
}
mnstr_printf(toConsole, "\n");
- if (prev_handler && signal(SIGINT, prev_handler) == SIG_ERR) {
- perror("SQLrenderer: Could not restore previous handler.");
- }
+ if (prev_handler && signal(SIGINT, prev_handler) == SIG_ERR)
+ perror("SQLrenderer: Could not restore previous handler");
free(len);
free(hdr);
free(rest);
diff --git a/clients/mapilib/mapi.c b/clients/mapilib/mapi.c
--- a/clients/mapilib/mapi.c
+++ b/clients/mapilib/mapi.c
@@ -3406,15 +3406,11 @@ read_into_cache(MapiHdl hdl, int lookahe
for (;;) {
line = read_line(mid);
if (line == NULL) {
+ if (prev_handler && signal(SIGINT, prev_handler) ==
SIG_ERR)
+ perror("mapi_execute_internal: Could not
restore previous handler");
if (mid->from && mnstr_eof(mid->from)) {
- if (prev_handler && signal(SIGINT,
prev_handler) == SIG_ERR) {
- perror("mapi_execute_internal: Could
not restore previous handler.");
- }
return mapi_setError(mid, "unexpected end of
file", __func__, MERROR);
}
- if (prev_handler && signal(SIGINT, prev_handler) ==
SIG_ERR) {
- perror("mapi_execute_internal: Could not
restore previous handler.");
- }
return mid->error;
}
@@ -3471,10 +3467,8 @@ read_into_cache(MapiHdl hdl, int lookahe
}
continue;
}
- if (prev_handler && signal(SIGINT, prev_handler) ==
SIG_ERR) {
- perror("mapi_execute_internal: Could not
restore previous handler.");
- }
-
+ if (prev_handler && signal(SIGINT, prev_handler) ==
SIG_ERR)
+ perror("mapi_execute_internal: Could not
restore previous handler");
return mid->error;
case '!':
/* start a new result set if we don't have one
@@ -3511,10 +3505,8 @@ read_into_cache(MapiHdl hdl, int lookahe
(result->querytype == -1 /* unknown (not SQL) */ ||
result->querytype == Q_TABLE ||
result->querytype == Q_UPDATE)) {
- if (prev_handler && signal(SIGINT,
prev_handler) == SIG_ERR) {
- perror("mapi_execute_internal: Could
not restore previous handler.");
- }
-
+ if (prev_handler && signal(SIGINT,
prev_handler) == SIG_ERR)
+ perror("mapi_execute_internal: Could
not restore previous handler");
return mid->error;
}
break;
_______________________________________________
checkin-list mailing list -- [email protected]
To unsubscribe send an email to [email protected]