diff options
author | elliott_c <ocielliottc@users.noreply.github.com> | 2004-11-18 13:39:45 +0000 |
---|---|---|
committer | elliott_c <ocielliottc@users.noreply.github.com> | 2004-11-18 13:39:45 +0000 |
commit | f66674fb65030d074692789172eca366f5d40d1b (patch) | |
tree | e9ad5d095be04da96208ccf24d4f4c4ac2645388 | |
parent | 63586fd09e6e1ed56386590db17f2c0837ceaaa6 (diff) | |
download | ATCD-f66674fb65030d074692789172eca366f5d40d1b.tar.gz |
ChangeLogTag: Thu Nov 18 07:38:34 2004 Chad Elliott <elliott_c@ociweb.com>
-rw-r--r-- | ChangeLog | 7 | ||||
-rw-r--r-- | ace/Service_Config.cpp | 15 |
2 files changed, 21 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog index aa7005efef9..c38957ef5db 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +Thu Nov 18 07:38:34 2004 Chad Elliott <elliott_c@ociweb.com> + + * ace/Service_Config.cpp: + + Distinguish between the existence of and the file permissions for + the default service configurator file (svc.conf). + Thu Nov 18 07:10:26 2004 Chad Elliott <elliott_c@ociweb.com> * examples/Logger/Acceptor-server/Logger_Acceptor_Server.mpc: diff --git a/ace/Service_Config.cpp b/ace/Service_Config.cpp index f47536dfbfc..f3313e09799 100644 --- a/ace/Service_Config.cpp +++ b/ace/Service_Config.cpp @@ -21,6 +21,7 @@ #include "ace/OS_NS_stdio.h" #include "ace/XML_Svc_Conf.h" #include "ace/OS_NS_time.h" +#include "ace/OS_NS_sys_stat.h" ACE_RCSID (ace, Service_Config, @@ -424,7 +425,19 @@ ACE_Service_Config::process_file (const ACE_TCHAR file[]) ACE_LIB_TEXT ("%p\n"), file)); - errno = ENOENT; + // Use stat to find out if the file exists. I didn't use access() + // because stat is better supported on most non-unix platforms. + ACE_stat exists; + if (ACE_OS::stat (file, &exists) == 0) + { + // If it exists, but we couldn't open it for reading then + // we must not have permission to read it. + errno = EPERM; + } + else + { + errno = ENOENT; + } result = -1; } else |