fix test program: don't close before writing
set fd to writeable on open for write
This commit is contained in:
parent
6fa5ffb56f
commit
2601de0032
|
@ -163,8 +163,6 @@ console_write (int minor, void *buf, int n)
|
|||
int i;
|
||||
uchar *b = buf;
|
||||
|
||||
cprintf ("print character to console\n");
|
||||
|
||||
for (i = 0; i < n; i++) {
|
||||
cons_putc((int) b[i]);
|
||||
}
|
||||
|
|
|
@ -263,6 +263,7 @@ sys_open(void)
|
|||
iput(ip);
|
||||
return -1;
|
||||
}
|
||||
|
||||
if((ufd = fd_ualloc()) < 0){
|
||||
iput(ip);
|
||||
fd_close(fd);
|
||||
|
@ -467,14 +468,6 @@ sys_block(void)
|
|||
brelse(b);
|
||||
}
|
||||
|
||||
#if 0
|
||||
cprintf("overwrite fs.img!\n");
|
||||
b = getblk();
|
||||
memset (b->data, 'f', 10);
|
||||
bwrite(1, b, 0);
|
||||
cprintf("write is done\n");
|
||||
#endif
|
||||
|
||||
ip = iget(1, 1);
|
||||
cprintf("iget 1: %d %d %d %d %d %d %d %d\n",
|
||||
ip->dev, ip->inum, ip->count, ip->busy,
|
||||
|
|
Loading…
Reference in a new issue