=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/msgs/Attic/msgs.c,v retrieving revision 1.1 retrieving revision 1.2 diff -c -r1.1 -r1.2 *** src/usr.bin/msgs/Attic/msgs.c 1995/10/18 08:45:50 1.1 --- src/usr.bin/msgs/Attic/msgs.c 1996/06/25 01:02:48 1.2 *************** *** 76,81 **** --- 76,82 ---- #include #include + #include #include #include #include *************** *** 139,145 **** time_t t; time_t keep; - char *mktemp(); char *nxtfld(); void onintr(); void onsusp(); --- 140,145 ---- *************** *** 717,723 **** char *prompt; { char inch; ! int n, cmsg; off_t oldpos; FILE *cpfrom, *cpto; --- 717,723 ---- char *prompt; { char inch; ! int n, cmsg, fd; off_t oldpos; FILE *cpfrom, *cpto; *************** *** 768,775 **** sprintf(cmdbuf, _PATH_MAIL, fname); mailing = YES; } ! cpto = fopen(fname, "a"); ! if (!cpto) { perror(fname); mailing = NO; fseek(newmsg, oldpos, 0); --- 768,777 ---- sprintf(cmdbuf, _PATH_MAIL, fname); mailing = YES; } ! if ((fd = open(fname, O_RDWR|O_EXCL|O_CREAT|O_APPEND)) == -1 || ! (cpto = fdopen(fd, "a")) == NULL) { ! if (fd == -1) ! close(fd); perror(fname); mailing = NO; fseek(newmsg, oldpos, 0);