]>
Commit | Line | Data |
---|---|---|
ca401c43 | 1 | /* |
2 | * $Source$ | |
3 | * $Author$ | |
4 | * $Header$ | |
5 | * | |
6 | * Copyright (C) 1987 by the Massachusetts Institute of Technology | |
babbc197 | 7 | * For copying and distribution information, please see the file |
8 | * <mit-copyright.h>. | |
ca401c43 | 9 | */ |
10 | ||
11 | #ifndef lint | |
59ec8dae | 12 | static char *rcsid_mr_call_c = "$Header$"; |
a43ce477 | 13 | #endif |
ca401c43 | 14 | |
babbc197 | 15 | #include <mit-copyright.h> |
8defc06b | 16 | #include "mr_private.h" |
ca401c43 | 17 | |
5eaef520 | 18 | int mr_do_call(struct mr_params *params, struct mr_params **reply) |
ca401c43 | 19 | { |
5eaef520 | 20 | CHECK_CONNECTED; |
21 | ||
22 | if (!_mr_send_op) | |
23 | _mr_send_op = create_operation(); | |
24 | ||
25 | if (!_mr_recv_op) | |
26 | _mr_recv_op = create_operation(); | |
27 | ||
28 | initialize_operation(_mr_send_op, mr_start_send, (char *)params, NULL); | |
29 | queue_operation(_mr_conn, CON_OUTPUT, _mr_send_op); | |
30 | ||
31 | initialize_operation(_mr_recv_op, mr_start_recv, (char *)reply, NULL); | |
32 | queue_operation(_mr_conn, CON_INPUT, _mr_recv_op); | |
33 | ||
34 | /* Block until operation done. */ | |
35 | mr_complete_operation(_mr_send_op); | |
36 | mr_complete_operation(_mr_recv_op); | |
37 | /* Look at results */ | |
38 | if ((OP_STATUS(_mr_send_op) != OP_COMPLETE) || | |
39 | (OP_STATUS(_mr_recv_op) != OP_COMPLETE)) | |
40 | { | |
41 | mr_disconnect(); | |
42 | return MR_ABORTED; | |
83e80378 | 43 | } |
5eaef520 | 44 | return 0; |
ca401c43 | 45 | } |