Revision: 14257
Author: adrian.chadd
Date: Sat Aug  1 23:07:56 2009
Log: Only write out the swap log info if the swap file was correctly read.


http://code.google.com/p/lusca-cache/source/detail?r=14257

Modified:
  /branches/LUSCA_HEAD/app/ufs_rebuild/ufs_build_dir.c

=======================================
--- /branches/LUSCA_HEAD/app/ufs_rebuild/ufs_build_dir.c        Sat Aug  1  
22:57:41 2009
+++ /branches/LUSCA_HEAD/app/ufs_rebuild/ufs_build_dir.c        Sat Aug  1  
23:07:56 2009
@@ -144,12 +144,14 @@
                                debug(47, 3) ("read_dir: opening %s\n", path);

                                rebuild_entry_init(&re);
-                               (void) read_file(path, &re);
-                               re.swap_filen = fn;
-                               if (! write_swaplog_entry(stdout, &re)) {
-                                       debug(47, 1) ("read_dir: write() 
failed: (%d) %s\n", errno,  
xstrerror());
-                                       rebuild_entry_done(&re);
-                                       return;
+                               /* Only write out the swap entry if the file 
metadata was correctly  
read */
+                               if (read_file(path, &re)) {
+                                       re.swap_filen = fn;
+                                       if (! write_swaplog_entry(stdout, &re)) 
{
+                                               debug(47, 1) ("read_dir: 
write() failed: (%d) %s\n", errno,  
xstrerror());
+                                               rebuild_entry_done(&re);
+                                               return;
+                                       }
                                }
                                rebuild_entry_done(&re);


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"lusca-commit" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/lusca-commit?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to