You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@qpid.apache.org by GitBox <gi...@apache.org> on 2019/11/04 17:18:43 UTC

[GitHub] [qpid-dispatch] ganeshmurthy commented on a change in pull request #608: DISPATCH-1467: enable AddressSanitizer build option (ASAN)

ganeshmurthy commented on a change in pull request #608: DISPATCH-1467: enable AddressSanitizer build option (ASAN)
URL: https://github.com/apache/qpid-dispatch/pull/608#discussion_r342169458
 
 

 ##########
 File path: router/src/main.c
 ##########
 @@ -179,43 +180,40 @@ static void daemon_process(const char *config_path, const char *python_pkgdir, b
 
 
             //
-            // If config path is not represented by its full path, then
-            // save current path before changing to /
+            // If config path is not a fully qualified path, then construct the
+            // fully qualified path to the config file.  This needs to be done
+            // since the daemon will set "/" to its working directory.
             //
             char *config_path_full = NULL;
             if (strncmp("/", config_path, 1)) {
-                char *cur_path = NULL;
-                size_t path_size = 256;
-                int getcwd_error = 0;
-                cur_path = (char *) calloc(path_size, sizeof(char));
+                size_t path_size = PATH_MAX;
+                char *cur_path = (char *) calloc(path_size, sizeof(char));
                 errno = 0;
 
                 while (getcwd(cur_path, path_size) == NULL) {
                     free(cur_path);
-                    if ( errno != ERANGE ) {
-                        // If unable to get current directory
-                        getcwd_error = 1;
-                        break;
+                    if (errno != ERANGE) {
+                        // Hard failure - can't recover from this
 
 Review comment:
   This change does not seem particularly related to this PR. Or is it? If not, can we make this change in a different commit ?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@qpid.apache.org
For additional commands, e-mail: dev-help@qpid.apache.org