diff options
Diffstat (limited to 'trunk/src/cache.c')
-rw-r--r-- | trunk/src/cache.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/trunk/src/cache.c b/trunk/src/cache.c index b677e22..4c6bffd 100644 --- a/trunk/src/cache.c +++ b/trunk/src/cache.c @@ -113,7 +113,7 @@ prelink_find_entry (const char *filename, const struct stat64 *stp, if (! stp) { canon_filename = prelink_canonicalize (filename, &st); - if (canon_filename == NULL && stat64 (filename, &st) < 0) + if (canon_filename == NULL && wrap_stat64 (filename, &st) < 0) { error (0, errno, "Could not stat %s", filename); if (insert) @@ -364,7 +364,7 @@ prelink_load_cache (void) size_t cache_size; uint32_t string_start, *dep; - fd = open (prelink_cache, O_RDONLY); + fd = wrap_open (prelink_cache, O_RDONLY); if (fd < 0) return 0; /* The cache does not exist yet. */ @@ -672,7 +672,7 @@ prelink_save_cache (int do_warn) char prelink_cache_tmp [prelink_cache_len + sizeof (".XXXXXX")]; memcpy (mempcpy (prelink_cache_tmp, prelink_cache, prelink_cache_len), ".XXXXXX", sizeof (".XXXXXX")); - fd = mkstemp (prelink_cache_tmp); + fd = wrap_mkstemp (prelink_cache_tmp); if (fd < 0) { error (0, errno, "Could not write prelink cache"); @@ -682,11 +682,12 @@ prelink_save_cache (int do_warn) if (write (fd, &cache, sizeof (cache)) != sizeof (cache) || write (fd, data, len) != len || fchmod (fd, 0644) + || fsync (fd) || close (fd) - || rename (prelink_cache_tmp, prelink_cache)) + || wrap_rename (prelink_cache_tmp, prelink_cache)) { error (0, errno, "Could not write prelink cache"); - unlink (prelink_cache_tmp); + wrap_unlink (prelink_cache_tmp); return 1; } return 0; |