Annotation of 41BSD/cmd/ucbmail/temp.c, revision 1.1.1.1

1.1       root        1: #
                      2: 
                      3: #include "rcv.h"
                      4: 
                      5: /*
                      6:  * Mail -- a mail program
                      7:  *
                      8:  * Give names to all the temporary files that we will need.
                      9:  */
                     10: 
                     11: char   tempMail[14];
                     12: char   tempQuit[14];
                     13: char   tempEdit[14];
                     14: char   tempSet[14];
                     15: char   tempResid[14];
                     16: char   tempMesg[14];
                     17: 
                     18: tinit()
                     19: {
                     20:        register char *cp, *cp2;
                     21:        char uname[9];
                     22:        register int err = 0;
                     23:        register int pid;
                     24: 
                     25:        pid = getpid();
                     26:        sprintf(tempMail, "/tmp/Rs%05d", pid);
                     27:        sprintf(tempResid, "/tmp/Rq%05d", pid);
                     28:        sprintf(tempQuit, "/tmp/Rm%05d", pid);
                     29:        sprintf(tempEdit, "/tmp/Re%05d", pid);
                     30:        sprintf(tempSet, "/tmp/Rx%05d", pid);
                     31:        sprintf(tempMesg, "/tmp/Rx%05d", pid);
                     32: 
                     33:        if (strlen(myname) != 0) {
                     34:                uid = getuserid(myname);
                     35:                if (uid == -1)
                     36:                        goto youlose;
                     37:        }
                     38:        else {
                     39:                uid = getuid() & UIDMASK;
                     40:                if (username(uid, uname) < 0) {
                     41:                        copy("ubluit", myname);
                     42: youlose:
                     43:                        err++;
                     44:                        if (rcvmode) {
                     45:                                printf("Who are you!?\n");
                     46:                                exit(1);
                     47:                        }
                     48:                }
                     49:                copy(uname, myname);
                     50:        }
                     51:        mailname = mailspace;
                     52:        cp = value("HOME");
                     53:        if (cp == NOSTR)
                     54:                cp = ".";
                     55:        copy(cp, homedir);
                     56:        findmail();
                     57:        cp = copy(homedir, mbox);
                     58:        copy("/mbox", cp);
                     59:        cp = copy(homedir, mailrc);
                     60:        copy("/.mailrc", cp);
                     61:        cp = copy(homedir, deadletter);
                     62:        copy("/dead.letter", cp);
                     63:        if (debug) {
                     64:                printf("uid = %d, user = %s, mailname = %s\n",
                     65:                    uid, myname, mailname);
                     66:                printf("deadletter = %s, mailrc = %s, mbox = %s\n",
                     67:                    deadletter, mailrc, mbox);
                     68:        }
                     69: }

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.