MCPcopy Create free account
hub / github.com/devkitPro/libctru / romfsUnmount

Function romfsUnmount

libctru/source/romfs_dev.c:329–355  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

327}
328
329Result 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

Callers 2

osReadVersionBinFunction · 0.85
romfsExitFunction · 0.85

Calls 1

romfs_freeFunction · 0.85

Tested by

no test coverage detected