MCPcopy Create free account
hub / github.com/PCSX2/pcsx2 / zip_source_commit_write

Function zip_source_commit_write

3rdparty/libzip/lib/zip_source_commit_write.c:38–68  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

36
37
38ZIP_EXTERN int
39zip_source_commit_write(zip_source_t *src) {
40 if (ZIP_SOURCE_IS_LAYERED(src)) {
41 zip_error_set(&src->error, ZIP_ER_OPNOTSUPP, 0);
42 return -1;
43 }
44
45 if (!ZIP_SOURCE_IS_OPEN_WRITING(src)) {
46 zip_error_set(&src->error, ZIP_ER_INVAL, 0);
47 return -1;
48 }
49
50 if (src->open_count > 1) {
51 zip_error_set(&src->error, ZIP_ER_INUSE, 0);
52 return -1;
53 }
54 else if (ZIP_SOURCE_IS_OPEN_READING(src)) {
55 if (zip_source_close(src) < 0) {
56 return -1;
57 }
58 }
59
60 if (_zip_source_call(src, NULL, 0, ZIP_SOURCE_COMMIT_WRITE) < 0) {
61 src->write_state = ZIP_SOURCE_WRITE_FAILED;
62 return -1;
63 }
64
65 src->write_state = ZIP_SOURCE_WRITE_CLOSED;
66
67 return 0;
68}

Callers 2

zip_closeFunction · 0.85

Calls 3

zip_error_setFunction · 0.85
zip_source_closeFunction · 0.85
_zip_source_callFunction · 0.85

Tested by

no test coverage detected