]> diplodocus.org Git - nmh/commitdiff
Merge remote-tracking branch 'origin/fix-locking'
authorDavid Levine <levinedl@acm.org>
Thu, 10 Apr 2014 00:19:26 +0000 (19:19 -0500)
committerDavid Levine <levinedl@acm.org>
Thu, 10 Apr 2014 00:19:26 +0000 (19:19 -0500)
1  2 
h/prototypes.h

diff --combined h/prototypes.h
index 7a4f8a382ed9bfa91cb4950a77d8df55cd99dfaf,0edcf411791cc9046646ccd7b51057c423d20c5f..da5231ba5138cd20f04a31928357ce4e8c3b177f
@@@ -178,16 -178,17 +178,17 @@@ int get_term_numcap(char *capability)
   *
   * Files opened for reading are locked with a read lock (if possible by
   * the underlying lock mechanism), files opened for writing are locked
-  * using an exclusive lock.
+  * using an exclusive lock.  The int * argument is used to indicate failure
+  * to acquire a lock.
   */
  int lkclosedata(int, const char *);
  int lkclosespool(int, const char *);
  int lkfclosedata(FILE *, const char *);
  int lkfclosespool(FILE *, const char *);
- FILE *lkfopendata(const char *, const char *);
- int lkopendata(const char *, int, mode_t);
+ FILE *lkfopendata(const char *, const char *, int *);
+ int lkopendata(const char *, int, mode_t, int *);
  FILE *lkfopenspool(const char *, const char *);
- int lkopenspool(const char *, int, mode_t);
+ int lkopenspool(const char *, int, mode_t, int *);
  int m_atoi (char *);
  char *m_backup (char *);
  int m_convert (struct msgs *, char *);
@@@ -207,23 -208,6 +208,23 @@@ char *m_mktemp(const char *, int *, FIL
  char *m_mktemp2(const char *, const char *, int *, FILE **);
  char *m_mktemps(const char *pfx, const char *suffix, int *, FILE **);
  char *get_temp_dir();
 +
 +/*
 + * Create a subprocess and redirect our standard output to it.
 + *
 + * Arguments are:
 + *
 + * name               - Name of process to create
 + * savestdout - If true, will save the current stdout file descriptor and
 + *              m_pclose() will close it at the appropriate time.
 + */
 +void m_popen(char *name, int savestdout);
 +
 +/*
 + * Wait for the last process opened by m_popen().
 + */
 +void m_pclose(void);
 +
  void m_unknown(m_getfld_state_t *, FILE *);
  int makedir (char *);
  char *message_id (time_t, int);
@@@ -297,8 -281,12 +298,12 @@@ void seq_printall (struct msgs *)
   *              and a pointer to the filehandle will be stored in
   *              folder structure, where it will later be used by
   *              seq_save().
+  *
+  * Return values:
+  *     OK       - successfully read the sequence files, or they don't exist
+  *     NOTOK    - failed to lock sequence file
   */
- void seq_read (struct msgs * mp, int lockflag);
+ int seq_read (struct msgs * mp, int lockflag);
  void seq_save (struct msgs *);
  void seq_setcur (struct msgs *, int);
  void seq_setprev (struct msgs *);