1: #ifndef lint
   2: static char *sccsid = "@(#)ihave.c	1.3	(Berkeley) 3/2/86";
   3: #endif
   4: 
   5: #include "common.h"
   6: 
   7: /*
   8:  * IHAVE <messageid>
   9:  *
  10:  * Accept an article for transferral if we haven't seen it before.
  11:  */
  12: 
  13: ihave(argc, argv)
  14: int argc;
  15: char    *argv[];
  16: {
  17:     int     retcode;
  18:     register FILE   *fp;
  19: 
  20:     if (argc != 2) {
  21:         printf("%d IHAVE requires two arguments.\r\n", ERR_CMDSYN);
  22:         (void) fflush(stdout);
  23:         return;
  24:     }
  25: 
  26:     fp = openartbyid(argv[1]);
  27:     if (fp != NULL) {
  28:         (void) fclose(fp);
  29:         printf("%d Already seen that one, thanks.\r\n", ERR_GOTIT);
  30:         (void) fflush(stdout);
  31: #ifdef LOG
  32:         syslog(LOG_INFO, "%s ihave %s rejected", hostname, argv[1]);
  33: #endif
  34:         return;
  35:     }
  36: 
  37:     retcode = spawn(RNEWS, "rnews", (char *) 0, CONT_XFER, ERR_XFERFAIL);
  38:     if (retcode <= 0)
  39:         printf("%d Transfer failed.\r\n", ERR_XFERFAIL);
  40:     else if (retcode > 0)
  41:         printf("%d Article transferred successfully.  Thank you.\r\n",
  42:             OK_XFERED);
  43:     (void) fflush(stdout);
  44: 
  45: #ifdef LOG
  46:     syslog(LOG_INFO, "%s ihave %s accepted %s",
  47:         hostname, argv[1], retcode == 1 ? "succeeded" : "failed");
  48: #endif
  49: 
  50: }

Defined functions

ihave defined in line 13; used 1 times

Defined variables

sccsid defined in line 2; never used
Last modified: 1986-03-21
Generated: 2016-12-26
Generated by src2html V0.67
page hit count: 993
Valid CSS Valid XHTML 1.0 Strict