IO#syswrite should raise an error if it's not opened for writing.

This commit is contained in:
Tomoyuki Sahara
2014-04-18 11:20:55 +09:00
parent 1c4f46f324
commit 36045ea96f
3 changed files with 30 additions and 14 deletions
+3 -2
View File
@@ -10,9 +10,10 @@ extern "C" {
#endif
struct mrb_io {
int fd; /* file descriptor */
int fd2; /* file descriptor */
int fd; /* file descriptor, or -1 */
int fd2; /* file descriptor to write if it's different from fd, or -1 */
int pid; /* child's pid (for pipes) */
unsigned int writable:1;
};
#define FMODE_READABLE 0x00000001