Refactor flags in method FileSystem::execute_command() (#754684)
Change the two optional boolean parameters into a single optional flags parameter which uses symbolically defined names. Makes reading the execute_command() calls much easier to understand. (Implemented as bit field using the same technique as used for Glib::SpawnFlags [1]). This changes the calls thus: execute_command(cmd, od) -> (cmd, od) execute_command(cmd, od, false) -> (cmd, od, EXEC_NONE) // [2] execute_command(cmd, od, true ) -> (cmd, od, EXEC_CHECK_STATUS) execute_command(cmd, od, false, true) -> (cmd, od, EXEC_CANCEL_SAFE) execute_command(cmd, od, true , true) -> (cmd, od, EXEC_CHECK_STATUS|EXEC_CANCEL_SAFE) [1] SpawnFlags bitwise operators in /usr/include/glibmm-2.4/glibmm/spawn.h. [2] False and EXEC_NONE are the default values for the optional third parameter before and after this change respectively and both mean the same. This is being used in btrfs::resize() and being kept for now despite it being the default. Bug 754684 - Updates to FileSystem:: and Utils::execute_command() functions
parent
d3e17f44
Please register or sign in to comment