summaryrefslogtreecommitdiff
path: root/firmware
diff options
context:
space:
mode:
Diffstat (limited to 'firmware')
-rw-r--r--firmware/common/file.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/firmware/common/file.c b/firmware/common/file.c
index a513f5221f..4b7865d724 100644
--- a/firmware/common/file.c
+++ b/firmware/common/file.c
@@ -72,6 +72,8 @@ int open(char* pathname, int flags)
72 return -1; 72 return -1;
73 } 73 }
74 74
75 openfiles[fd].busy = true;
76
75 /* locate filename */ 77 /* locate filename */
76 name=strrchr(pathname+1,'/'); 78 name=strrchr(pathname+1,'/');
77 if ( name ) { 79 if ( name ) {
@@ -87,6 +89,7 @@ int open(char* pathname, int flags)
87 if (!dir) { 89 if (!dir) {
88 DEBUGF("Failed opening dir\n"); 90 DEBUGF("Failed opening dir\n");
89 errno = EIO; 91 errno = EIO;
92 openfiles[fd].busy = false;
90 return -1; 93 return -1;
91 } 94 }
92 95
@@ -103,12 +106,12 @@ int open(char* pathname, int flags)
103 if ( !entry ) { 106 if ( !entry ) {
104 DEBUGF("Couldn't find %s in %s\n",name,pathname); 107 DEBUGF("Couldn't find %s in %s\n",name,pathname);
105 errno = ENOENT; 108 errno = ENOENT;
109 openfiles[fd].busy = false;
106 return -1; 110 return -1;
107 } 111 }
108 112
109 openfiles[fd].cacheoffset = -1; 113 openfiles[fd].cacheoffset = -1;
110 openfiles[fd].fileoffset = 0; 114 openfiles[fd].fileoffset = 0;
111 openfiles[fd].busy = true;
112 return fd; 115 return fd;
113} 116}
114 117