diff options
Diffstat (limited to 'trunk/src/verify.c')
-rw-r--r-- | trunk/src/verify.c | 27 |
1 files changed, 20 insertions, 7 deletions
diff --git a/trunk/src/verify.c b/trunk/src/verify.c index 15cbd0e..d9f4d7d 100644 --- a/trunk/src/verify.c +++ b/trunk/src/verify.c @@ -193,7 +193,7 @@ prelink_verify (const char *filename) size_t count; char *p, *q; - if (stat64 (filename, &st) < 0) + if (wrap_stat64 (filename, &st) < 0) error (EXIT_FAILURE, errno, "Couldn't stat %s", filename); dso = open_dso (filename); @@ -269,7 +269,7 @@ prelink_verify (const char *filename) break; } - fd = open (dso->temp_filename, O_RDONLY); + fd = wrap_open (dso->temp_filename, O_RDONLY); if (fd < 0) { error (0, errno, "Could not verify %s", filename); @@ -304,7 +304,7 @@ prelink_verify (const char *filename) if (prelink (dso2, ent)) goto failure_unlink; - unlink (ent->filename); + wrap_unlink (ent->filename); if (write_dso (dso2)) goto failure; @@ -412,6 +412,9 @@ prelink_verify (const char *filename) if (handle_verify (fdundone, filename)) goto failure; + fsync (fd); + fsync (fdorig); + fsync (fdundone); close (fd); close (fdorig); close (fdundone); @@ -421,11 +424,20 @@ failure_unlink: unlink (ent->filename); failure: if (fd != -1) - close (fd); + { + fsync (fd); + close (fd); + } if (fdorig != -1) - close (fdorig); + { + fsync (fdorig); + close (fdorig); + } if (fdundone != -1) - close (fdundone); + { + fsync (fdundone); + close (fdundone); + } if (dso) close_dso (dso); if (dso2) @@ -435,11 +447,12 @@ failure: not_prelinked: if (dso) close_dso (dso); - fd = open (filename, O_RDONLY); + fd = wrap_open (filename, O_RDONLY); if (fd < 0) error (EXIT_FAILURE, errno, "Couldn't open %s", filename); if (handle_verify (fd, filename)) return EXIT_FAILURE; + fsync (fd); close (fd); return 0; } |