X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=lttng%2Fconf.c;h=57aaf7b2ddd5d726b70cf1b27a60f6f2eebcbe13;hb=2e0ac66c6c13c670bca92e7a333358554769f638;hp=9e3a626ba34d5112fa83d15e6ca24585a37b8dd9;hpb=beb8c75afd91bc32f2e7a9c124c9a21ecffd1486;p=lttng-tools.git diff --git a/lttng/conf.c b/lttng/conf.c index 9e3a626ba..57aaf7b2d 100644 --- a/lttng/conf.c +++ b/lttng/conf.c @@ -148,19 +148,12 @@ error: /* * config_get_default_path * - * Return the default path to config directory which is the current working - * directory. User must free() the returned allocated string. + * Return the HOME directory path. The output is dup so the user MUST + * free(3) the returned string. */ char *config_get_default_path(void) { - char *alloc_path; - - alloc_path = getcwd(NULL, 0); - if (alloc_path == NULL) { - perror("getcwd"); - } - - return alloc_path; + return strdup(getenv("HOME")); } /* @@ -180,11 +173,6 @@ void config_destroy(char *path) perror("remove config file"); } - ret = rmdir(path); - if (ret < 0) { - perror("rmdir config dir"); - } - free(config_path); }