projects
/
unix-history
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
tags
|
clone url
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
changed file stacking to save and restore cond flag;
[unix-history]
/
usr
/
src
/
usr.bin
/
mail
/
edit.c
diff --git
a/usr/src/usr.bin/mail/edit.c
b/usr/src/usr.bin/mail/edit.c
index
f08f7aa
..
c88b642
100644
(file)
--- a/
usr/src/usr.bin/mail/edit.c
+++ b/
usr/src/usr.bin/mail/edit.c
@@
-10,7
+10,7
@@
* Perform message editing functions.
*/
* Perform message editing functions.
*/
-static char *SccsId = "@(#)edit.c 1.
1
%G%";
+static char *SccsId = "@(#)edit.c 1.
2
%G%";
/*
* Edit a message list.
/*
* Edit a message list.
@@
-122,6
+122,14
@@
edit1(msgvec, ed)
}
fclose(obuf);
}
fclose(obuf);
+ /*
+ * If we are in read only mode, make the
+ * temporary message file readonly as well.
+ */
+
+ if (readonly)
+ chmod(edname, 0400);
+
/*
* Fork/execl the editor on the edit file.
*/
/*
* Fork/execl the editor on the edit file.
*/
@@
-147,6
+155,16
@@
edit1(msgvec, ed)
while (wait(&mesg) != pid)
;
while (wait(&mesg) != pid)
;
+ /*
+ * If in read only mode, just remove the editor
+ * temporary and return.
+ */
+
+ if (readonly) {
+ remove(edname);
+ continue;
+ }
+
/*
* Now copy the message to the end of the
* temp file.
/*
* Now copy the message to the end of the
* temp file.