summaryrefslogtreecommitdiff
path: root/elf/cache.c
diff options
context:
space:
mode:
Diffstat (limited to 'elf/cache.c')
-rw-r--r--elf/cache.c18
1 files changed, 14 insertions, 4 deletions
diff --git a/elf/cache.c b/elf/cache.c
index fbee172012..e63979da7d 100644
--- a/elf/cache.c
+++ b/elf/cache.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1999-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1999-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Andreas Jaeger <aj@suse.de>, 1999.
@@ -114,6 +114,12 @@ print_entry (const char *lib, int flag, unsigned int osversion,
case FLAG_MIPS64_LIBN64_NAN2008:
fputs (",64bit,nan2008", stdout);
break;
+ case FLAG_RISCV_FLOAT_ABI_SOFT:
+ fputs (",soft-float", stdout);
+ break;
+ case FLAG_RISCV_FLOAT_ABI_DOUBLE:
+ fputs (",double-float", stdout);
+ break;
case 0:
break;
default:
@@ -448,8 +454,7 @@ save_cache (const char *cache_name)
error (EXIT_FAILURE, errno, _("Writing of cache data failed"));
}
- if (write (fd, strings, total_strlen) != (ssize_t) total_strlen
- || close (fd))
+ if (write (fd, strings, total_strlen) != (ssize_t) total_strlen)
error (EXIT_FAILURE, errno, _("Writing of cache data failed"));
/* Make sure user can always read cache file */
@@ -458,6 +463,10 @@ save_cache (const char *cache_name)
_("Changing access rights of %s to %#o failed"), temp_name,
S_IROTH|S_IRGRP|S_IRUSR|S_IWUSR);
+ /* Make sure that data is written to disk. */
+ if (fsync (fd) != 0 || close (fd) != 0)
+ error (EXIT_FAILURE, errno, _("Writing of cache data failed"));
+
/* Move temporary to its final location. */
if (rename (temp_name, cache_name))
error (EXIT_FAILURE, errno, _("Renaming of %s to %s failed"), temp_name,
@@ -812,7 +821,8 @@ save_aux_cache (const char *aux_cache_name)
if (write (fd, file_entries, file_entries_size + total_strlen)
!= (ssize_t) (file_entries_size + total_strlen)
- || close (fd))
+ || fdatasync (fd) != 0
+ || close (fd) != 0)
{
unlink (temp_name);
goto out_fail;