[rhmessaging-commits] rhmessaging commits: r3034 - store/trunk/cpp/lib/jrnl.

rhmessaging-commits at lists.jboss.org rhmessaging-commits at lists.jboss.org
Wed Jan 7 15:10:31 EST 2009


Author: kpvdr
Date: 2009-01-07 15:10:31 -0500 (Wed, 07 Jan 2009)
New Revision: 3034

Modified:
   store/trunk/cpp/lib/jrnl/fcntl.cpp
   store/trunk/cpp/lib/jrnl/jcntl.cpp
   store/trunk/cpp/lib/jrnl/pmgr.cpp
Log:
Closed a recover file handle that was being left open needlessly. Minor corrections to exception formatting.

Modified: store/trunk/cpp/lib/jrnl/fcntl.cpp
===================================================================
--- store/trunk/cpp/lib/jrnl/fcntl.cpp	2009-01-07 14:22:24 UTC (rev 3033)
+++ store/trunk/cpp/lib/jrnl/fcntl.cpp	2009-01-07 20:10:31 UTC (rev 3034)
@@ -324,7 +324,7 @@
     if (::posix_memalign(&nullbuf, sblksize, nullbuffsize))
     {
         std::ostringstream oss;
-        oss << ": posix_memalign() failed: size=" << nullbuffsize << " blk_size=" << sblksize;
+        oss << "posix_memalign() failed: size=" << nullbuffsize << " blk_size=" << sblksize;
         oss << FORMAT_SYSERR(errno);
         throw jexception(jerrno::JERR__MALLOC, oss.str(), "fcntl", "clean_file");
     }
@@ -336,7 +336,7 @@
     {
         std::free(nullbuf);
         std::ostringstream oss;
-        oss << ": open() failed:" << "\"" << FORMAT_SYSERR(errno);
+        oss << "open() failed:" << FORMAT_SYSERR(errno);
         throw jexception(jerrno::JERR_FCNTL_OPENWR, oss.str(), "fcntl", "clean_file");
     }
 
@@ -348,7 +348,7 @@
             ::close(fh);
             std::free(nullbuf);
             std::ostringstream oss;
-            oss << ": wr_size=" << (this_write_sblks * sblksize) << FORMAT_SYSERR(errno);
+            oss << "wr_size=" << (this_write_sblks * sblksize) << FORMAT_SYSERR(errno);
             throw jexception(jerrno::JERR_FCNTL_WRITE, oss.str(), "fcntl", "clean_file");
         }
         nsblks -= this_write_sblks;

Modified: store/trunk/cpp/lib/jrnl/jcntl.cpp
===================================================================
--- store/trunk/cpp/lib/jrnl/jcntl.cpp	2009-01-07 14:22:24 UTC (rev 3033)
+++ store/trunk/cpp/lib/jrnl/jcntl.cpp	2009-01-07 20:10:31 UTC (rev 3034)
@@ -611,6 +611,7 @@
         std::ifstream ifs;
         bool lowi = rd._owi; // local copy of owi to be used during analysis
         while (rcvr_get_next_record(fid, &ifs, lowi, rd)) ;
+        if (ifs.is_open()) ifs.close();
         
         // Remove all txns from tmap that are not in the prepared list
         if (prep_txn_list_ptr)

Modified: store/trunk/cpp/lib/jrnl/pmgr.cpp
===================================================================
--- store/trunk/cpp/lib/jrnl/pmgr.cpp	2009-01-07 14:22:24 UTC (rev 3033)
+++ store/trunk/cpp/lib/jrnl/pmgr.cpp	2009-01-07 20:10:31 UTC (rev 3034)
@@ -158,7 +158,7 @@
     if (int ret = aio::queue_init(max_aio_evts, &_ioctx))
     {
         std::ostringstream oss;
-        oss << "io_queue_init() failed: " << std::strerror(-ret) << " (" << ret << ")";
+        oss << "io_queue_init() failed: " << FORMAT_SYSERR(-ret);
         throw jexception(jerrno::JERR__AIO, oss.str(), "pmgr", "initialize");
     }
 }




More information about the rhmessaging-commits mailing list