9 date 92.12.15.00.20.22; author jromine; state Exp;
14 date 92.01.31.21.56.12; author jromine; state Exp;
19 date 90.11.05.11.46.34; author mh; state Exp;
24 date 90.04.05.15.31.00; author sources; state Exp;
29 date 90.04.05.14.45.03; author sources; state Exp;
34 date 90.02.05.14.22.42; author sources; state Exp;
39 date 90.02.01.14.06.58; author sources; state Exp;
44 date 90.02.01.14.04.25; author sources; state Exp;
58 @/* m_sync.c - synchronize message sequences */
60 static char ident[] = "@@(#)$Id: m_sync.c,v 1.7 1992/01/31 21:56:12 jromine Exp jromine $";
67 #define sigmask(s) (1 << ((s) - 1))
68 #endif /* not sigmask */
72 1. public and folder readonly: make it private
73 2a. public: add it to the sequences file
74 2b. private: add it to the profile
79 register struct msgs *mp;
89 TYPESIG (*hstat) (), (*istat) (), (*qstat) (), (*tstat) ();
94 if (!(mp -> msgflags & SEQMOD))
96 mp -> msgflags &= ~SEQMOD;
99 (void) sprintf (seq, "%s/%s", mp -> foldpath, mh_seq);
103 flags = mp -> msgflags;
104 if (mh_seq == NULL || *mh_seq == 0)
105 mp -> msgflags |= READONLY;
107 for (i = 0; mp -> msgattrs[i]; i++) {
108 (void) sprintf (attr, "atr-%s-%s", mp -> msgattrs[i], mp -> foldpath);
109 if (mp -> msgflags & READONLY
110 || mp -> attrstats & (1 << (bits + i))) {
112 if (cp = m_seq (mp, mp -> msgattrs[i]))
113 m_replace (attr, cp);
115 (void) m_delete (attr);
118 (void) m_delete (attr);
119 if ((cp = m_seq (mp, mp -> msgattrs[i])) == NULL)
122 if ((fp = fopen (seq, "w")) == NULL
123 && (unlink (seq) == NOTOK ||
124 (fp = fopen (seq, "w")) == NULL)) {
125 admonish (attr, "unable to write");
129 hstat = signal (SIGHUP, SIG_IGN);
130 istat = signal (SIGINT, SIG_IGN);
131 qstat = signal (SIGQUIT, SIG_IGN);
132 tstat = signal (SIGTERM, SIG_IGN);
134 smask = sigblock (sigmask (SIGHUP) | sigmask (SIGINT)
135 | sigmask (SIGQUIT) | sigmask (SIGTERM));
138 fprintf (fp, "%s: %s\n", mp -> msgattrs[i], cp);
145 (void) signal (SIGHUP, hstat);
146 (void) signal (SIGINT, istat);
147 (void) signal (SIGQUIT, qstat);
148 (void) signal (SIGTERM, tstat);
150 (void) sigsetmask (smask);
154 if (!(mp -> msgflags & READONLY))
157 mp -> msgflags = flags;
169 static char ident[] = "@@(#)$Id: m_sync.c,v 1.6 1990/11/05 11:46:34 mh Exp jromine $";
197 @correctly detect inability to alter the public sequence
198 file. the original test only worked if the unlink succeeded.
204 static char ident[] = "@@(#)$Id: m_sync.c,v 1.5 90/04/05 15:31:00 sources Exp Locker: mh $";
207 if (mh_seq == NULL || *mh_seq == NULL)
218 static char ident[] = "@@(#)$Id:$";
221 && unlink (seq) != NOTOK
222 && (fp = fopen (seq, "w")) == NULL) {
233 static char ident[] = "$Id:";
248 @increase message sequence buffer size by factor of 2. I hope this
249 is worth it, since it'll make things bigger.
254 int (*hstat) (), (*istat) (), (*qstat) (), (*tstat) ();