qfile-unpacker: add option (-w) to wait for disk space before extracting

Add -w MARGIN option to always leave at least MARGIN bytes of free
space.

QubesOS/qubes-issues#4791
This commit is contained in:
Marek Marczykowski-Górecki 2019-09-06 17:13:43 +02:00
parent 13eef467bf
commit 7c261f45da
No known key found for this signature in database
GPG Key ID: 063938BA42CFA724

View File

@ -75,6 +75,12 @@ int main(int argc, char ** argv)
for (i = 3; i < argc; i++) {
if (strcmp(argv[i], "-v") == 0)
set_verbose(1);
else if (strcmp(argv[i], "-w") == 0)
if (i+1 < argc && argv[i+1][0] != '-') {
set_wait_for_space(atoi(argv[i+1]));
i++;
} else
set_wait_for_space(1);
else
gui_fatal("Invalid option %s", argv[i]);
}