Add minor enhancements to compile binary.

* If output file exists, ask user whether to overwrite
* Fix erroneous check for whether XML file was successfully saved

PiperOrigin-RevId: 468743682
Change-Id: I06058c498328d333792e4b40d65c3a99ca1842e4
This commit is contained in:
Kevin Zakka
2022-08-19 11:14:37 -07:00
committed by Copybara-Service
parent 7b7cf0c27a
commit ee6fed1230
3 changed files with 17 additions and 11 deletions
+2
View File
@@ -120,6 +120,8 @@ mjModel* mj_loadXML(const char* filename, const mjVFS* vfs,
// update XML data structures with info from low-level model, save as MJCF
// returns 1 if successful, 0 otherwise
// error can be NULL; otherwise assumed to have size error_sz
int mj_saveLastXML(const char* filename, const mjModel* m, char* error, int error_sz) {
// serialize access to themodel
std::lock_guard<std::mutex> lock(themutex);