1: /*
   2:  * Copyright (c) 1980 Regents of the University of California.
   3:  * All rights reserved.  The Berkeley software License Agreement
   4:  * specifies the terms and conditions for redistribution.
   5:  */
   6: 
   7: #ifndef lint
   8: static char *sccsid = "@(#)temp.c	5.2 (Berkeley) 6/21/85";
   9: #endif not lint
  10: 
  11: #include "rcv.h"
  12: 
  13: /*
  14:  * Mail -- a mail program
  15:  *
  16:  * Give names to all the temporary files that we will need.
  17:  */
  18: 
  19: char    tempMail[14];
  20: char    tempQuit[14];
  21: char    tempEdit[14];
  22: char    tempSet[14];
  23: char    tempResid[14];
  24: char    tempMesg[14];
  25: 
  26: tinit()
  27: {
  28:     register char *cp, *cp2;
  29:     char uname[PATHSIZE];
  30:     register int err = 0;
  31:     register int pid;
  32: 
  33:     pid = getpid();
  34:     sprintf(tempMail, "/tmp/Rs%05d", pid);
  35:     sprintf(tempResid, "/tmp/Rq%05d", pid);
  36:     sprintf(tempQuit, "/tmp/Rm%05d", pid);
  37:     sprintf(tempEdit, "/tmp/Re%05d", pid);
  38:     sprintf(tempSet, "/tmp/Rx%05d", pid);
  39:     sprintf(tempMesg, "/tmp/Rx%05d", pid);
  40: 
  41:     if (strlen(myname) != 0) {
  42:         uid = getuserid(myname);
  43:         if (uid == -1) {
  44:             printf("\"%s\" is not a user of this system\n",
  45:                 myname);
  46:             exit(1);
  47:         }
  48:     }
  49:     else {
  50:         uid = getuid() & UIDMASK;
  51:         if (username(uid, uname) < 0) {
  52:             copy("ubluit", myname);
  53:             err++;
  54:             if (rcvmode) {
  55:                 printf("Who are you!?\n");
  56:                 exit(1);
  57:             }
  58:         }
  59:         else
  60:             copy(uname, myname);
  61:     }
  62:     cp = value("HOME");
  63:     if (cp == NOSTR)
  64:         cp = ".";
  65:     copy(cp, homedir);
  66:     findmail();
  67:     cp = copy(homedir, mbox);
  68:     copy("/mbox", cp);
  69:     cp = copy(homedir, mailrc);
  70:     copy("/.mailrc", cp);
  71:     cp = copy(homedir, deadletter);
  72:     copy("/dead.letter", cp);
  73:     if (debug) {
  74:         printf("uid = %d, user = %s, mailname = %s\n",
  75:             uid, myname, mailname);
  76:         printf("deadletter = %s, mailrc = %s, mbox = %s\n",
  77:             deadletter, mailrc, mbox);
  78:     }
  79: }

Defined functions

tinit defined in line 26; used 1 times

Defined variables

sccsid defined in line 8; never used
tempEdit defined in line 21; used 1 times
  • in line 37
tempMail defined in line 19; used 1 times
  • in line 34
tempMesg defined in line 24; used 1 times
  • in line 39
tempQuit defined in line 20; used 1 times
  • in line 36
tempResid defined in line 23; used 1 times
  • in line 35
tempSet defined in line 22; used 1 times
  • in line 38
Last modified: 1985-06-22
Generated: 2016-12-26
Generated by src2html V0.67
page hit count: 1062
Valid CSS Valid XHTML 1.0 Strict