+ /* We don't want a backup + rename operation if the .map file is
+ * a symlink. Otherwise we'll break the user's careful symlink setup.
+ * Just overwrite the original file. Assume the user has versioning. */
+ bool make_backup;
+ struct stat st;
+ if ( lstat(fullpath.c_str(), &st) == 0 ) {
+ make_backup = true; // file exists
+ if ( (st.st_mode & S_IFMT) == S_IFLNK ) {
+ make_backup = false; // .. but it is a symlink
+ }
+ } else {
+ make_backup = false; // nothing to move
+ }
+
+ if ( !make_backup || file_saveBackup( fullpath.c_str() ) ) {