commit cec188e4a3534b3cd5184768fcfa95cc841a0ada
Author: David Sorber <dsorber@prometheus.fios-router.home>
Date:   Thu Feb 16 16:45:42 2017 -0500

    Adding some minor edits along with a bit of debug code.

diff --git a/software/photo_compress_archiver/PhotoCompressArchiver.cc b/software/photo_compress_archiver/PhotoCompressArchiver.cc
index 318f13d..42c1ffc 100644
--- a/software/photo_compress_archiver/PhotoCompressArchiver.cc
+++ b/software/photo_compress_archiver/PhotoCompressArchiver.cc
@@ -61,7 +61,7 @@ int PhotoCompressArchiver::execute()
     
     // TODO: need to handle the case were number of input files is less than
     //       the number of threads
-    uint32_t num_threads = m_num_cores;
+    uint32_t num_threads = 1;//m_num_cores;
     uint32_t sublist_len = m_num_input_files / num_threads;
  
     for (uint32_t idx = 0; idx < num_threads; ++idx)
@@ -104,6 +104,7 @@ int PhotoCompressArchiver::execute()
         delete worker;
     }
     
+    // Print out compression information if compressing
     if (! m_decompress)
     {
         OUT(std::cout << "\n  Total compressed bytes: " 
@@ -191,6 +192,7 @@ void PhotoCompressArchiver::fork_worker(
     
     // Build a list of the output files names for use in output file monitoring
     // below. Output file names have ".jpg" or ".jpeg" replaced with ".pjg"
+    // in compression mode and vice versa in decompression mode.
     std::vector<std::string*> output_filenames;
     for (auto& filepath : *file_sublist)
     {
@@ -198,7 +200,17 @@ void PhotoCompressArchiver::fork_worker(
         uint32_t end_pos = filepath.string().find(".");
         std::string* filename = new std::string(filepath.string().begin(), 
                                                 filepath.string().begin() + end_pos);
-        (*filename) += ".pjg";
+                                                
+        if (m_decompress)
+        {
+            // Decompression mode
+            (*filename) += ".jpg";
+        }
+        else
+        {
+            // Compression mode
+            (*filename) += ".pjg";
+        }
                       
         output_filenames.push_back(filename);
     }
@@ -224,9 +236,9 @@ void PhotoCompressArchiver::fork_worker(
     {
         // This is the child process...
         // Set child process's stdout to the pipe entry
-        while ((dup2(filedes[1], STDOUT_FILENO) == -1) && (errno == EINTR)) {}
-        close(filedes[1]);
-        close(filedes[0]);
+        //~ while ((dup2(filedes[1], STDOUT_FILENO) == -1) && (errno == EINTR)) {}
+        //~ close(filedes[1]);
+        //~ close(filedes[0]);
         
         // Child after fork
         execv(PROG_NAME, (char **)exec_argv);
@@ -257,10 +269,19 @@ void PhotoCompressArchiver::fork_worker(
         // Check if timeout has occurred
         if (bailout_ctr == BAILOUT_MAX) 
         {
-            OUT(std::cerr << "T[" << tid << "] ERROR: timed out while waiting "
+            OUT(std::cerr << "T[" << tid << "] " << BOLD << RED << "ERROR: " 
+                          << ENDC << "timed out while waiting "
                           << "for output file: " 
                           << *output_filenames[output_idx] << "; aborting"
                           << std::endl;)
+                          
+            int status;
+            waitpid(pid, &status, 0);
+            
+            OUT(std::cerr << "T[" << tid << "] " << BOLD << RED << "ERROR: " 
+                          << ENDC << PURPLE << " RC => " << status << ENDC 
+                          << std::endl;)
+            
             return;
         }
                 
diff --git a/software/photo_compress_archiver/main.cc b/software/photo_compress_archiver/main.cc
index d993407..bc1ab7b 100644
--- a/software/photo_compress_archiver/main.cc
+++ b/software/photo_compress_archiver/main.cc
@@ -13,8 +13,8 @@ namespace bpo = boost::program_options;
 void header()
 {
     std::cout << BOLD << "Photo Compress Archiver -- " << version << "\n" << ENDC;
-    std::cout << "    Copyright 2017 - David Sorber\n";
-    std::cout << "    >>> Utilizing packJPG by Matthias Stirner\n" << std::endl;    
+    std::cout << "  Copyright 2017 - David Sorber\n";
+    std::cout << "  >>> Utilizing packJPG by Matthias Stirner\n" << std::endl;    
 }
 
 void usage(char** argv)
@@ -92,7 +92,7 @@ int main(int argc, char** argv)
     // Display header and 
     header();    
     uint32_t num_cores = std::thread::hardware_concurrency();
-    std::cout << "    [" << num_cores << " cores detected]\n";
+    std::cout << "[" << num_cores << " cores detected]\n";
     
     // Decode/store decompress option
     bool decompress = false;
