faubackup2/src/common output_handling.cpp,1.4,1.5

Martin Waitz <[email protected]> Wed, 15 Jun 2005 07:47:09 +0000
Newsgroups gmane.comp.sysutils.backup.faubackup.cvs
Message-ID <[email protected]>
Update of /cvsroot/faubackup/faubackup2/src/common
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23441/src/common

Modified Files:
	output_handling.cpp 
Log Message:
factor out error-exit code.
It probably should be moved somewhere else but that can wait.


Index: output_handling.cpp
===================================================================
RCS file: /cvsroot/faubackup/faubackup2/src/common/output_handling.cpp,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** output_handling.cpp	14 Jun 2005 20:23:33 -0000	1.4
--- output_handling.cpp	15 Jun 2005 07:47:07 -0000	1.5
***************
*** 26,29 ****
--- 26,37 ----
  
  
+ static void fatal(void)
+ {
+ 	bigBrother.killAll();
+ 	if(tempdir != "")
+ 		dir_finalize(tempdir, destinationdir);
+ 	exit(EXIT_FAILURE);
+ }
+ 
  void MessageHandling::critical(string message, int errNo)
  {
***************
*** 33,44 ****
  	else
  		cerr << endl;
- 	cerr << "exiting..." << endl;
- 	bigBrother.killAll();
  	error++;
! 	if(tempdir != "")
! 		dir_finalize(tempdir, destinationdir);
! 	exit(EXIT_FAILURE);
! 
  }
  void MessageHandling::non_critical(string message, int errNo)
  {
--- 41,48 ----
  	else
  		cerr << endl;
  	error++;
! 	fatal();
  }
+ 
  void MessageHandling::non_critical(string message, int errNo)
  {



-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click