| 327 | } |
| 328 | |
| 329 | Result romfsUnmount(const char* name) |
| 330 | { |
| 331 | // Find the mount |
| 332 | romfs_mount* mount = romfs_mount_list; |
| 333 | while (mount) |
| 334 | { |
| 335 | if (strncmp(mount->name, name, sizeof(mount->name)) == 0) |
| 336 | break; |
| 337 | mount = mount->next; |
| 338 | } |
| 339 | |
| 340 | if (mount == NULL) |
| 341 | return MAKERESULT(RL_STATUS, RS_NOTFOUND, RM_ROMFS, RD_NOT_FOUND); |
| 342 | |
| 343 | // Remove device |
| 344 | char tmpname[34]; |
| 345 | unsigned len = strlen(name); |
| 346 | memcpy(tmpname, mount->name, len); |
| 347 | tmpname[len] = ':'; |
| 348 | tmpname[len+1] = 0; |
| 349 | RemoveDevice(tmpname); |
| 350 | |
| 351 | // Free the mount |
| 352 | romfs_free(mount); |
| 353 | |
| 354 | return 0; |
| 355 | } |
| 356 | |
| 357 | //----------------------------------------------------------------------------- |
| 358 |
no test coverage detected