OSI/FTAM Programming Reference Manual

NonStop FTAM Programming Examples
HP NonStop OSI/FTAM Programming Reference Manual528611-001
G-227
Translation Application Example
204 FILE_GETINFO_ (sSpiFnum, (short *) &sLastError);
205 if (sLastError)
206 {
207 printf ("Error sending SPI command: %d\n", sLastError);
208 FILE_CLOSE_ (sSpiFnum);
209 sSpiFnum = -1;
210 return FALSE;
211 }
212 /* Check the results to make sure we were accepted */
213 SSPUTTKN (saSpiBuffer, ZSPI_TKN_RESET_BUFFER, (char *) &sLen);
214 SSGETTKN (saSpiBuffer, ZSPI_TKN_DATALIST);
215 SSGETTKN (saSpiBuffer, ZSPI_TKN_ERRLIST);
216 /* List errors. */
217 SSGETTKN (saSpiBuffer, ZSPI_TKN_ERROR, (char *) &spi_error);
218 sLastError = spi_error.z_error;
219 if (sLastError)
220 {
221 printf ("SPI Error returned from SPI command: %d\n",
222 sLastError);
223 FILE_CLOSE_ (sSpiFnum);
224 sSpiFnum = -1;
225 return FALSE;
226 }
227 /* Save the phandle globally */
228 memcpy (&ResponderPhandle, &ThisProcessHandle,
229 sizeof (ThisProcessHandle));
230 return TRUE;
231 }
232 #pragma PAGE "HandleSysMsg"
233 /**********************************************************************/
234 /* */
235 /*Name: HandleSysMsg */
236 /* */
237 /*Description: Checks system message. Handles all forms */
238 /* of failure of or close by responder by starting a timer*/
239 /* Timer completion causes an attempt to reopen. */
240 /* Open is checked for #ZSPI qualifier and only one open */
241 /* by responder is allowed */
242 /* */