Rev 2927 | Rev 3149 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
| Rev 2927 | Rev 3009 | ||
|---|---|---|---|
| Line 153... | Line 153... | ||
| 153 | void *tmp = NULL; |
153 | void *tmp = NULL; |
| 154 | 154 | ||
| 155 | if (ops->plb_get_char(next) == '/') |
155 | if (ops->plb_get_char(next) == '/') |
| 156 | next++; /* eat slash */ |
156 | next++; /* eat slash */ |
| 157 | 157 | ||
| 158 | while (ops->has_children(cur) && next <= last) { |
158 | while (next <= last && ops->has_children(cur)) { |
| 159 | /* collect the component */ |
159 | /* collect the component */ |
| 160 | len = 0; |
160 | len = 0; |
| 161 | while ((ops->plb_get_char(next) != '/') && (next <= last)) { |
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 | /* comopnent length overflow */ |
| 164 | ipc_answer_0(rid, ENAMETOOLONG); |
164 | ipc_answer_0(rid, ENAMETOOLONG); |
| 165 | goto out; |
165 | goto out; |
| 166 | } |
166 | } |
| Line 195... | Line 195... | ||
| 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 | if (!ops->link(cur, nodep, component)) { |
199 | if (!ops->link(cur, nodep, component)) { |
| 200 | if (lflag & L_CREATE) |
200 | if (lflag & L_CREATE) { |
| 201 | (void)ops->destroy(nodep); |
201 | (void)ops->destroy( |
| - | 202 | nodep); |
|
| - | 203 | } |
|
| 202 | ipc_answer_0(rid, ENOSPC); |
204 | ipc_answer_0(rid, ENOSPC); |
| 203 | } else { |
205 | } else { |
| 204 | ipc_answer_5(rid, EOK, |
206 | ipc_answer_5(rid, EOK, |
| 205 | fs_handle, dev_handle, |
207 | fs_handle, dev_handle, |
| 206 | ops->index_get(nodep), |
208 | ops->index_get(nodep), |
| Line 230... | Line 232... | ||
| 230 | cur = tmp; |
232 | cur = tmp; |
| 231 | tmp = NULL; |
233 | tmp = NULL; |
| 232 | } |
234 | } |
| 233 | 235 | ||
| 234 | /* handle miss: excessive components */ |
236 | /* handle miss: excessive components */ |
| 235 | if (!ops->has_children(cur) && next <= last) { |
237 | if (next <= last && !ops->has_children(cur)) { |
| 236 | if (lflag & (L_CREATE | L_LINK)) { |
238 | if (lflag & (L_CREATE | L_LINK)) { |
| 237 | if (!ops->is_directory(cur)) { |
239 | if (!ops->is_directory(cur)) { |
| 238 | ipc_answer_0(rid, ENOTDIR); |
240 | ipc_answer_0(rid, ENOTDIR); |
| 239 | goto out; |
241 | goto out; |
| 240 | } |
242 | } |