From: Alan Cox Date: Thu, 21 May 2015 22:44:38 +0000 (+0100) Subject: inode: correct close behaviour for devices (note: impacts some drivers!) X-Git-Url: https://git.ndcode.org/public/gitweb.cgi?a=commitdiff_plain;h=592109de1b687dd91ed5cc5a698767343fffccec;p=FUZIX.git inode: correct close behaviour for devices (note: impacts some drivers!) We should call _close for each close matching the final close of an open. This is a slight change in semantics but it's what we actually need to sort must things out. Yes it breaks some devices..diddums 8) --- diff --git a/Kernel/inode.c b/Kernel/inode.c index 1fb217d5..c0c7a799 100644 --- a/Kernel/inode.c +++ b/Kernel/inode.c @@ -223,7 +223,7 @@ int16_t doclose(uint8_t uindex) oftindex = udata.u_files[uindex]; - if (ino->c_refs == 1 && of_tab[oftindex].o_refs == 1) { + if (of_tab[oftindex].o_refs == 1) { if (isdevice(ino)) d_close((int) (ino->c_node.i_addr[0])); if (getmode(ino) == F_REG && O_ACCMODE(of_tab[oftindex].o_access))