diff options
author | schmidt <douglascraigschmidt@users.noreply.github.com> | 1999-08-19 15:06:29 +0000 |
---|---|---|
committer | schmidt <douglascraigschmidt@users.noreply.github.com> | 1999-08-19 15:06:29 +0000 |
commit | 3aabfcae9e4a05629294e8ec2dc4e21dd65683a2 (patch) | |
tree | 3258c0a933c7dbe3da03de20a2eef7dd07dad818 | |
parent | 89672e07dfcc84f3211643214a5dd6ac3400abe6 (diff) | |
download | ATCD-3aabfcae9e4a05629294e8ec2dc4e21dd65683a2.tar.gz |
ChangeLogTag:Thu Aug 19 09:34:41 1999 Douglas C. Schmidt <schmidt@tango.cs.wustl.edu>
-rw-r--r-- | ChangeLog-99b | 6 | ||||
-rw-r--r-- | ace/Service_Config.cpp | 44 | ||||
-rw-r--r-- | ace/Service_Config.h | 9 |
3 files changed, 36 insertions, 23 deletions
diff --git a/ChangeLog-99b b/ChangeLog-99b index 7339c398473..035212d247d 100644 --- a/ChangeLog-99b +++ b/ChangeLog-99b @@ -1,5 +1,11 @@ Thu Aug 19 09:34:41 1999 Douglas C. Schmidt <schmidt@tango.cs.wustl.edu> + * ace/Service_Config: Updated the failure result comment for + open() and cleaned up the return value and errno propagation for + open_i() when process_commandline_directives() fails. Thanks to + Jerry D. De Master <jdemaste@ipdinc.com> for reporting the bug + and suggesting a fix. + * ace/Service_Config.h: Moved the process_directives() method used to parse the svc.conf files out of the protected part of the class to the public part so that application programmers can diff --git a/ace/Service_Config.cpp b/ace/Service_Config.cpp index 94253f2d470..1a7ba388d85 100644 --- a/ace/Service_Config.cpp +++ b/ace/Service_Config.cpp @@ -605,18 +605,6 @@ ACE_Service_Config::open_i (const ASYS_TCHAR program_name[], // same size as the ACE_Service_Repository). ACE_Reactor::instance (); - // See if we need to load the static services. - if (ACE_Service_Config::no_static_svcs_ == 0 - && ACE_Service_Config::load_static_svcs () == -1) - result = -1; - else - { - int result = - ACE_Service_Config::process_commandline_directives (); - result = - ACE_Service_Config::process_directives () + result; - } - // There's no point in dealing with this on NT since it doesn't // really support signals very well... #if !defined (ACE_LACKS_UNIX_SIGNALS) @@ -627,18 +615,34 @@ ACE_Service_Config::open_i (const ASYS_TCHAR program_name[], ACE_ERROR ((LM_ERROR, ASYS_TEXT ("can't register signal handler\n"))); #endif /* ACE_LACKS_UNIX_SIGNALS */ + + // See if we need to load the static services. + if (ACE_Service_Config::no_static_svcs_ == 0 + && ACE_Service_Config::load_static_svcs () == -1) + result = -1; + else + { + if (ACE_Service_Config::process_commandline_directives () == -1) + result = -1; + else + result = ACE_Service_Config::process_directives (); + } } - ace_yy_delete_parse_buffer (); + { + // Make sure to save/restore errno properly. + ACE_Errno_Guard error (errno); - // Reset debugging back to the way it was when we came into into - // <open_i>. - if (debugging_enabled) - ACE_Log_Msg::enable_debug_messages (); - else - // Debugging was off when we entered <open_i>. - ACE_Log_Msg::disable_debug_messages (); + ace_yy_delete_parse_buffer (); + // Reset debugging back to the way it was when we came into into + // <open_i>. + if (debugging_enabled) + ACE_Log_Msg::enable_debug_messages (); + else + // Debugging was off when we entered <open_i>. + ACE_Log_Msg::disable_debug_messages (); + } return result; } diff --git a/ace/Service_Config.h b/ace/Service_Config.h index 45f733cd0b0..c27f8000dea 100644 --- a/ace/Service_Config.h +++ b/ace/Service_Config.h @@ -128,9 +128,12 @@ public: int ignore_static_svcs = 1, int ignore_default_svc_conf_file = 0); // Performs an open without parsing command-line arguments. If - // <ignore_default_svc_conf_file> is non-0 then the "svc.conf" file - // will be ignored. Returns number of errors that occurred on - // failure and 0 otherwise. + // <ignore_default_svc_conf_file> is non-0 then the <svc.conf> + // configuration file will be ignored. Returns zero upon success, + // -1 if the file is not found or cannot be opened (errno is set + // accordingly), otherwise returns the number of errors encountered + // loading the services in the specified svc.conf configuration + // file. static int open (int argc, ASYS_TCHAR *argv[], |