[PATCH 02/15] Don't #ifdef the rename for s390 only - just do it if unlink() fails.

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

 



---
 loader2/loader.c |   14 ++++++--------
 1 files changed, 6 insertions(+), 8 deletions(-)

diff --git a/loader2/loader.c b/loader2/loader.c
index ce00bd7..90a1e0c 100644
--- a/loader2/loader.c
+++ b/loader2/loader.c
@@ -1405,15 +1405,13 @@ static void migrate_runtime_directory(char * dirname) {
 
     ret = asprintf(&runtimedir, "/mnt/runtime%s", dirname);
     if (!access(runtimedir, X_OK)) {
-#if !defined(__s390__) && !defined(__s390x__)
-        unlink(dirname);
-#else
-        char * olddir;
+        if (unlink(dirname) == -1) {
+            char * olddir;
 
-        asprintf(&olddir, "%s_old", dirname);
-        rename(dirname, olddir);
-        free(olddir);
-#endif
+            ret = asprintf(&olddir, "%s_old", dirname);
+            ret = rename(dirname, olddir);
+            free(olddir);
+        }
         ret = symlink(runtimedir, dirname);
     }
     free(runtimedir);
-- 
1.5.3.4

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/anaconda-devel-list

[Index of Archives]     [Kickstart]     [Fedora Users]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]
  Powered by Linux