Rev 3022 | Rev 4420 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
| Rev 3022 | Rev 4055 | ||
|---|---|---|---|
| Line 158... | Line 158... | ||
| 158 | while (next <= last && ops->has_children(cur)) { |
158 | while (next <= last && ops->has_children(cur)) { |
| 159 | /* collect the component */ |
159 | /* collect the component */ |
| 160 | len = 0; |
160 | len = 0; |
| 161 | while ((next <= last) && (ops->plb_get_char(next) != '/')) { |
161 | while ((next <= last) && (ops->plb_get_char(next) != '/')) { |
| 162 | if (len + 1 == NAME_MAX) { |
162 | if (len + 1 == NAME_MAX) { |
| 163 | /* comopnent length overflow */ |
163 | /* component length overflow */ |
| 164 | ipc_answer_0(rid, ENAMETOOLONG); |
164 | ipc_answer_0(rid, ENAMETOOLONG); |
| 165 | goto out; |
165 | goto out; |
| 166 | } |
166 | } |
| 167 | component[len++] = ops->plb_get_char(next); |
167 | component[len++] = ops->plb_get_char(next); |
| 168 | next++; /* process next character */ |
168 | next++; /* process next character */ |
| Line 189... | Line 189... | ||
| 189 | ipc_answer_0(rid, ENOTDIR); |
189 | ipc_answer_0(rid, ENOTDIR); |
| 190 | goto out; |
190 | goto out; |
| 191 | } |
191 | } |
| 192 | void *nodep; |
192 | void *nodep; |
| 193 | if (lflag & L_CREATE) |
193 | if (lflag & L_CREATE) |
| 194 | nodep = ops->create(lflag); |
194 | nodep = ops->create(dev_handle, lflag); |
| 195 | else |
195 | else |
| 196 | nodep = ops->node_get(dev_handle, |
196 | nodep = ops->node_get(dev_handle, |
| 197 | index); |
197 | index); |
| 198 | if (nodep) { |
198 | if (nodep) { |
| - | 199 | int rc; |
|
| - | 200 | ||
| 199 | if (!ops->link(cur, nodep, component)) { |
201 | rc = ops->link(cur, nodep, component); |
| - | 202 | if (rc != EOK) { |
|
| 200 | if (lflag & L_CREATE) { |
203 | if (lflag & L_CREATE) { |
| 201 | (void)ops->destroy( |
204 | (void)ops->destroy( |
| 202 | nodep); |
205 | nodep); |
| 203 | } |
206 | } |
| 204 | ipc_answer_0(rid, ENOSPC); |
207 | ipc_answer_0(rid, rc); |
| 205 | } else { |
208 | } else { |
| 206 | ipc_answer_5(rid, EOK, |
209 | ipc_answer_5(rid, EOK, |
| 207 | fs_handle, dev_handle, |
210 | fs_handle, dev_handle, |
| 208 | ops->index_get(nodep), |
211 | ops->index_get(nodep), |
| 209 | ops->size_get(nodep), |
212 | ops->size_get(nodep), |
| Line 260... | Line 263... | ||
| 260 | assert(len); |
263 | assert(len); |
| 261 | component[len] = '\0'; |
264 | component[len] = '\0'; |
| 262 | 265 | ||
| 263 | void *nodep; |
266 | void *nodep; |
| 264 | if (lflag & L_CREATE) |
267 | if (lflag & L_CREATE) |
| 265 | nodep = ops->create(lflag); |
268 | nodep = ops->create(dev_handle, lflag); |
| 266 | else |
269 | else |
| 267 | nodep = ops->node_get(dev_handle, index); |
270 | nodep = ops->node_get(dev_handle, index); |
| 268 | if (nodep) { |
271 | if (nodep) { |
| - | 272 | int rc; |
|
| - | 273 | ||
| 269 | if (!ops->link(cur, nodep, component)) { |
274 | rc = ops->link(cur, nodep, component); |
| - | 275 | if (rc != EOK) { |
|
| 270 | if (lflag & L_CREATE) |
276 | if (lflag & L_CREATE) |
| 271 | (void)ops->destroy(nodep); |
277 | (void)ops->destroy(nodep); |
| 272 | ipc_answer_0(rid, ENOSPC); |
278 | ipc_answer_0(rid, rc); |
| 273 | } else { |
279 | } else { |
| 274 | ipc_answer_5(rid, EOK, |
280 | ipc_answer_5(rid, EOK, |
| 275 | fs_handle, dev_handle, |
281 | fs_handle, dev_handle, |
| 276 | ops->index_get(nodep), |
282 | ops->index_get(nodep), |
| 277 | ops->size_get(nodep), |
283 | ops->size_get(nodep), |