FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Ubuntu > Ubuntu User

 
 
LinkBack Thread Tools
 
Old 12-05-2007, 10:23 PM
Bill Nottingham
 
Default Don't #ifdef the rename for s390 only - just do it if unlink() fails.

---
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@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
 

Thread Tools




All times are GMT. The time now is 09:32 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org