[glib/2325-symlink-replace-file: 2/4] fixup! glocalfileoutputstream: Fix CREATE_REPLACE_DESTINATION with symlinks




commit 385eb1d35f592e5427bf51c11547c8e1b65652f5
Author: Philip Withnall <pwithnall endlessos org>
Date:   Wed Mar 10 17:48:30 2021 +0000

    fixup! glocalfileoutputstream: Fix CREATE_REPLACE_DESTINATION with symlinks

 gio/glocalfileoutputstream.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
---
diff --git a/gio/glocalfileoutputstream.c b/gio/glocalfileoutputstream.c
index 2b87776bc..5df78f79a 100644
--- a/gio/glocalfileoutputstream.c
+++ b/gio/glocalfileoutputstream.c
@@ -957,7 +957,13 @@ handle_overwrite_open (const char    *filename,
                                _("Target file is a directory"));
           goto err_out;
         }
-      else if (!is_symlink || !S_ISLNK (_g_stat_mode (&original_stat)))
+      else if (!is_symlink ||
+#ifdef S_ISLNK
+               !S_ISLNK (_g_stat_mode (&original_stat))
+#else
+               FALSE
+#endif
+               )
         {
           g_set_error_literal (error,
                              G_IO_ERROR,


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]