]> andersk Git - moira.git/blobdiff - lib/mr_query.c
declared version number variable
[moira.git] / lib / mr_query.c
index ab57d674425e6056767852f98b7730ee1826866f..fa0e1b099c2bb71d1dfc232f7774d72e981796e3 100644 (file)
@@ -6,9 +6,18 @@
  *     Copyright (C) 1987 by the Massachusetts Institute of Technology
  *
  *     $Log$
- *     Revision 1.2  1987-06-16 17:48:58  wesommer
- *     Clean up memory allocation, indenting.
+ *     Revision 1.5  1988-04-19 12:38:41  mar
+ *     pass version number on queries
  *
+ * Revision 1.4  87/08/22  17:11:16  wesommer
+ * Increment the nesting level only after we know we're connected.
+ * 
+ * Revision 1.3  87/08/02  21:49:53  wesommer
+ * Prevent recursive query call.
+ * 
+ * Revision 1.2  87/06/16  17:48:58  wesommer
+ * Clean up memory allocation, indenting.
+ * 
  * Revision 1.1  87/06/04  01:29:32  wesommer
  * Initial revision
  * 
@@ -26,6 +35,7 @@ static char *rcsid_sms_query_c = "$Header$";
  * It builds a new argument vector with the query handle prepended,
  * and calls sms_query_internal.
  */
+int level = 0;
 
 int sms_query(name, argc, argv, callproc, callarg)
     char *name;                /* Query name */
@@ -66,10 +76,14 @@ int sms_query_internal(argc, argv, callproc, callarg)
     register sms_params *params = NULL;
     sms_params *reply = NULL;
     int stopcallbacks = 0;
+
+    if (level) return SMS_QUERY_NOT_REENTRANT;
     
     CHECK_CONNECTED;
+    level++;
 
-    params = &params_st;
+    params = &params_st; 
+    params->sms_version_no = sending_version_no;
     params->sms_procno = SMS_QUERY;
     params->sms_argc = argc;
     params->sms_argl = NULL;
@@ -92,12 +106,14 @@ int sms_query_internal(argc, argv, callproc, callarg)
        complete_operation(_sms_recv_op);
        if (OP_STATUS(_sms_recv_op) != OP_COMPLETE) {
            sms_disconnect();
-           return SMS_ABORTED;
+           status = SMS_ABORTED;
+           goto punt_1;
        }
     }  
 punt:
     sms_destroy_reply(reply);
-
+punt_1:
+    level--;
     return status;
 }
 /*
This page took 0.033524 seconds and 4 git commands to generate.