Commit | Line | Data |
---|---|---|
cf908fd1 WJ |
1 | /* psapminor1.c - PPM: initiate minorsyncs */ |
2 | ||
3 | #ifndef lint | |
4 | static char *rcsid = "$Header: /f/osi/psap2/RCS/psapminor1.c,v 7.1 91/02/22 09:37:37 mrose Interim $"; | |
5 | #endif | |
6 | ||
7 | /* | |
8 | * $Header: /f/osi/psap2/RCS/psapminor1.c,v 7.1 91/02/22 09:37:37 mrose Interim $ | |
9 | * | |
10 | * | |
11 | * $Log: psapminor1.c,v $ | |
12 | * Revision 7.1 91/02/22 09:37:37 mrose | |
13 | * Interim 6.8 | |
14 | * | |
15 | * Revision 7.0 89/11/23 22:14:24 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.REQUEST */ | |
38 | ||
39 | int PMinSyncRequest (sd, type, ssn, data, ndata, pi) | |
40 | int sd; | |
41 | int type, | |
42 | ndata; | |
43 | long *ssn; | |
44 | PE *data; | |
45 | struct PSAPindication *pi; | |
46 | { | |
47 | SBV smask; | |
48 | int len, | |
49 | result; | |
50 | char *base, | |
51 | *realbase; | |
52 | register struct psapblk *pb; | |
53 | struct SSAPindication sis; | |
54 | register struct SSAPabort *sa = &sis.si_abort; | |
55 | ||
56 | toomuchP (data, ndata, NPDATA, "minorsync"); | |
57 | missingP (pi); | |
58 | ||
59 | smask = sigioblock (); | |
60 | ||
61 | psapPsig (pb, sd); | |
62 | ||
63 | if ((result = info2ssdu (pb, pi, data, ndata, &realbase, &base, &len, | |
64 | "P-MINOR-SYNC user-data", PPDU_NONE)) != OK) | |
65 | goto out2; | |
66 | ||
67 | if ((result = SMinSyncRequest (sd, type, ssn, base, len, &sis)) == NOTOK) | |
68 | if (SC_FATAL (sa -> sa_reason)) | |
69 | (void) ss2pslose (pb, pi, "SMinSyncRequest", sa); | |
70 | else { | |
71 | (void) ss2pslose (NULLPB, pi, "SMinSyncRequest", sa); | |
72 | goto out1; | |
73 | } | |
74 | ||
75 | out2: ; | |
76 | if (result == NOTOK) | |
77 | freepblk (pb); | |
78 | else | |
79 | if (result == DONE) | |
80 | result = NOTOK; | |
81 | out1: ; | |
82 | if (realbase) | |
83 | free (realbase); | |
84 | else | |
85 | if (base) | |
86 | free (base); | |
87 | ||
88 | (void) sigiomask (smask); | |
89 | ||
90 | return result; | |
91 | } |