summaryrefslogtreecommitdiffstats
path: root/libmount/src/tab_update.c
diff options
context:
space:
mode:
Diffstat (limited to 'libmount/src/tab_update.c')
-rw-r--r--libmount/src/tab_update.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/libmount/src/tab_update.c b/libmount/src/tab_update.c
index 7238faf68..56e87cf0e 100644
--- a/libmount/src/tab_update.c
+++ b/libmount/src/tab_update.c
@@ -545,7 +545,9 @@ static int update_table(struct libmnt_update *upd, struct libmnt_table *tb)
fclose(f);
f = NULL;
- rc = rename(uq, upd->filename) ? -errno : 0;
+
+ if (!rc)
+ rc = rename(uq, upd->filename) ? -errno : 0;
} else {
rc = -errno;
close(fd);