| 98 | } |
| 99 | |
| 100 | int close(Worker& proxy) { |
| 101 | // TODO: Downgrade to Blob access once the last writable file descriptor has |
| 102 | // been closed. |
| 103 | int err = 0; |
| 104 | if (--openCount == 0) { |
| 105 | switch (kind) { |
| 106 | case Access: |
| 107 | proxy( |
| 108 | [&](auto ctx) { _wasmfs_opfs_close_access(ctx.ctx, id, &err); }); |
| 109 | break; |
| 110 | case Blob: |
| 111 | proxy([&]() { _wasmfs_opfs_close_blob(id); }); |
| 112 | break; |
| 113 | case None: |
| 114 | WASMFS_UNREACHABLE("Open file should have kind"); |
| 115 | } |
| 116 | kind = None; |
| 117 | id = -1; |
| 118 | } |
| 119 | return err; |
| 120 | } |
| 121 | |
| 122 | int getAccessID() { |
| 123 | assert(openCount > 0); |
nothing calls this directly
no outgoing calls
no test coverage detected