Changeset 1fe186f in mainline
- Timestamp:
- 2008-01-27T10:47:15Z (17 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 72bde81
- Parents:
- b8b23c8
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/fs/tmpfs/tmpfs_ops.c
rb8b23c8 r1fe186f 246 246 char component[NAME_MAX + 1]; 247 247 int len = 0; 248 while ( next <= last) {248 while (dtmp && next <= last) { 249 249 250 250 /* collect the component */ … … 296 296 dcur = dtmp; 297 297 dtmp = dtmp->child; 298 299 /* handle miss: excessive components */ 300 if (!dtmp && next <= last) { 301 if (lflag & L_CREATE) { 302 if (dcur->type != TMPFS_DIRECTORY) { 303 ipc_answer_0(rid, ENOTDIR); 298 } 299 300 /* handle miss: excessive components */ 301 if (!dtmp && next <= last) { 302 if (lflag & L_CREATE) { 303 if (dcur->type != TMPFS_DIRECTORY) { 304 ipc_answer_0(rid, ENOTDIR); 305 return; 306 } 307 308 /* collect next component */ 309 while (next <= last) { 310 if (PLB_GET_CHAR(next) == '/') { 311 /* more than one component */ 312 ipc_answer_0(rid, ENOENT); 304 313 return; 305 314 } 306 307 /* collect next component */ 308 while (next <= last) { 309 if (PLB_GET_CHAR(next) == '/') { 310 /* more than one component */ 311 ipc_answer_0(rid, ENOENT); 312 return; 313 } 314 if (len + 1 == NAME_MAX) { 315 /* component length overflow */ 316 ipc_answer_0(rid, ENAMETOOLONG); 317 return; 318 } 319 component[len++] = PLB_GET_CHAR(next); 320 next++; /* process next character */ 315 if (len + 1 == NAME_MAX) { 316 /* component length overflow */ 317 ipc_answer_0(rid, ENAMETOOLONG); 318 return; 321 319 } 322 assert(len); 323 component[len] = '\0'; 324 len = 0; 320 component[len++] = PLB_GET_CHAR(next); 321 next++; /* process next character */ 322 } 323 assert(len); 324 component[len] = '\0'; 325 len = 0; 325 326 326 unsigned long index; 327 index = create_node(dcur, component, lflag); 328 if (index) { 329 ipc_answer_4(rid, EOK, 330 tmpfs_reg.fs_handle, dev_handle, 331 index, 0); 332 } else { 333 ipc_answer_0(rid, ENOSPC); 334 } 335 return; 327 unsigned long index; 328 index = create_node(dcur, component, lflag); 329 if (index) { 330 ipc_answer_4(rid, EOK, tmpfs_reg.fs_handle, 331 dev_handle, index, 0); 332 } else { 333 ipc_answer_0(rid, ENOSPC); 336 334 } 337 ipc_answer_0(rid, ENOENT);338 335 return; 339 336 } 340 337 ipc_answer_0(rid, ENOENT); 338 return; 341 339 } 342 340
Note:
See TracChangeset
for help on using the changeset viewer.