From c99615c2caa0fa04c7b7bfe32f351a0d51c81cd4 Mon Sep 17 00:00:00 2001
From: sezero <sezero@users.sourceforge.net>
Date: Sun, 22 Jan 2017 11:11:20 +0300
Subject: [PATCH 4/9] metadata_iterators.c: add __OS2__ to the list of cpp
 checks for flac_rename() failure. add __OS2__ to the list of cpp checks to
 not call chown().

---
 src/libFLAC/metadata_iterators.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/libFLAC/metadata_iterators.c b/src/libFLAC/metadata_iterators.c
index 352a6c7..d08f43c 100644
--- a/src/libFLAC/metadata_iterators.c
+++ b/src/libFLAC/metadata_iterators.c
@@ -3378,7 +3378,7 @@ FLAC__bool transport_tempfile_(const char *filename, FILE **tempfile, char **tem
 	(void)fclose(*tempfile);
 	*tempfile = 0;
 
-#if defined _MSC_VER || defined __BORLANDC__ || defined __MINGW32__ || defined __EMX__
+#if defined _MSC_VER || defined __BORLANDC__ || defined __MINGW32__ || defined __EMX__ || defined __OS2__
 	/* on some flavors of windows, flac_rename() will fail if the destination already exists */
 	if(flac_unlink(filename) < 0) {
 		cleanup_tempfile_(tempfile, tempfilename);
@@ -3431,7 +3431,7 @@ void set_file_stats_(const char *filename, struct flac_stat_s *stats)
 	srctime.modtime = stats->st_mtime;
 	(void)flac_chmod(filename, stats->st_mode);
 	(void)flac_utime(filename, &srctime);
-#if !defined _MSC_VER && !defined __BORLANDC__ && !defined __MINGW32__
+#if !defined _MSC_VER && !defined __BORLANDC__ && !defined __MINGW32__ && !defined __OS2__
 	FLAC_CHECK_RETURN(chown(filename, stats->st_uid, -1));
 	FLAC_CHECK_RETURN(chown(filename, -1, stats->st_gid));
 #endif
-- 
1.8.5.5

