Commit | Line | Data |
---|---|---|
cf908fd1 WJ |
1 | /* psapminor2.c - PPM: respond to minorsyncs */ |
2 | ||
3 | #ifndef lint | |
4 | static char *rcsid = "$Header: /f/osi/psap2/RCS/psapminor2.c,v 7.1 91/02/22 09:37:38 mrose Interim $"; | |
5 | #endif | |
6 | ||
7 | /* | |
8 | * $Header: /f/osi/psap2/RCS/psapminor2.c,v 7.1 91/02/22 09:37:38 mrose Interim $ | |
9 | * | |
10 | * | |
11 | * $Log: psapminor2.c,v $ | |
12 | * Revision 7.1 91/02/22 09:37:38 mrose | |
13 | * Interim 6.8 | |
14 | * | |
15 | * Revision 7.0 89/11/23 22:14:25 mrose | |
16 | * Release 6.0 | |
17 | * | |
18 | */ | |
19 | ||
20 | /* | |
21 | * NOTICE | |
22 | * | |
23 | * Acquisition, use, and distribution of this module and related | |
24 | * materials are subject to the restrictions of a license agreement. | |
25 | * Consult the Preface in the User's Manual for the full terms of | |
26 | * this agreement. | |
27 | * | |
28 | */ | |
29 | ||
30 | ||
31 | /* LINTLIBRARY */ | |
32 | ||
33 | #include <stdio.h> | |
34 | #include <signal.h> | |
35 | #include "ppkt.h" | |
36 | ||
37 | /* \f P-MINOR-SYNC.RESPONSE */ | |
38 | ||
39 | int PMinSyncResponse (sd, ssn, data, ndata, pi) | |
40 | int sd; | |
41 | long ssn; | |
42 | int ndata; | |
43 | PE *data; | |
44 | struct PSAPindication *pi; | |
45 | { | |
46 | SBV smask; | |
47 | int len, | |
48 | result; | |
49 | char *base, | |
50 | *realbase; | |
51 | register struct psapblk *pb; | |
52 | struct SSAPindication sis; | |
53 | register struct SSAPabort *sa = &sis.si_abort; | |
54 | ||
55 | toomuchP (data, ndata, NPDATA, "minorsync"); | |
56 | missingP (pi); | |
57 | ||
58 | smask = sigioblock (); | |
59 | ||
60 | psapPsig (pb, sd); | |
61 | ||
62 | if ((result = info2ssdu (pb, pi, data, ndata, &realbase, &base, &len, | |
63 | "P-MINOR-SYNC user-data", PPDU_NONE)) != OK) | |
64 | goto out2; | |
65 | ||
66 | if ((result = SMinSyncResponse (sd, ssn, base, len, &sis)) == NOTOK) | |
67 | if (SC_FATAL (sa -> sa_reason)) | |
68 | (void) ss2pslose (pb, pi, "SMinSyncResponse", sa); | |
69 | else { | |
70 | (void) ss2pslose (NULLPB, pi, "SMinSyncResponse", sa); | |
71 | goto out1; | |
72 | } | |
73 | ||
74 | out2: ; | |
75 | if (result == NOTOK) | |
76 | freepblk (pb); | |
77 | else | |
78 | if (result == DONE) | |
79 | result = NOTOK; | |
80 | out1: ; | |
81 | if (realbase) | |
82 | free (realbase); | |
83 | else | |
84 | if (base) | |
85 | free (base); | |
86 | ||
87 | (void) sigiomask (smask); | |
88 | ||
89 | return result; | |
90 | } |