}
output->enabled = obj->enabled;
output->net_seq_index = obj->net_seq_index;
- memcpy(output->subdir, obj->subdir, PATH_MAX);
+ memcpy(output->subdir, obj->subdir, sizeof(output->subdir));
output->snapshot = obj->snapshot;
output->relay_major_version = obj->relay_major_version;
output->relay_minor_version = obj->relay_minor_version;
* Subdirectory path name used for both local and network
* consumer (/kernel or /ust).
*/
- char subdir[PATH_MAX];
+ char subdir[LTTNG_PATH_MAX];
/*
* Hashtable of consumer_socket index by the file descriptor value. For
unsigned int snapshot:1;
union {
- char session_root_path[PATH_MAX];
+ char session_root_path[LTTNG_PATH_MAX];
struct consumer_net net;
} dst;
* Sub-directory below the session_root_path where the next chunk of
* trace will be stored (\0 before the first session rotation).
*/
- char chunk_path[PATH_MAX];
+ char chunk_path[LTTNG_PATH_MAX];
};
struct consumer_socket *consumer_find_socket(int key,
usess->consumer->dst.session_root_path[0] != '\0') {
char *tmp_path;
- tmp_path = zmalloc(PATH_MAX * sizeof(char));
+ tmp_path = zmalloc(LTTNG_PATH_MAX);
if (!tmp_path) {
ERR("Alloc tmp_path");
goto error_unlock;
}
- ret = snprintf(tmp_path, PATH_MAX, "%s%s%s",
+ ret = snprintf(tmp_path, LTTNG_PATH_MAX, "%s%s%s",
usess->consumer->dst.session_root_path,
usess->consumer->chunk_path,
usess->consumer->subdir);
- if (ret >= PATH_MAX) {
+ if (ret >= LTTNG_PATH_MAX) {
ERR("Local destination path exceeds the maximal allowed length of %i bytes (needs %i bytes) with path = \"%s%s%s\"",
- PATH_MAX, ret,
+ LTTNG_PATH_MAX, ret,
usess->consumer->dst.session_root_path,
usess->consumer->chunk_path,
usess->consumer->subdir);
health_code_update();
- /* Allocate our self the string to make sure we never exceed PATH_MAX. */
- pathname = zmalloc(PATH_MAX);
+ /*
+ * Allocate the string ourself to make sure we never exceed
+ * LTTNG_PATH_MAX.
+ */
+ pathname = zmalloc(LTTNG_PATH_MAX);
if (!pathname) {
goto error;
}
/* Get correct path name destination */
if (consumer->type == CONSUMER_DST_LOCAL) {
/* Set application path to the destination path */
- ret = snprintf(pathname, PATH_MAX, "%s%s%s%s",
+ ret = snprintf(pathname, LTTNG_PATH_MAX, "%s%s%s%s",
consumer->dst.session_root_path,
consumer->chunk_path,
consumer->subdir, ua_sess->path);
}
}
} else {
- ret = snprintf(pathname, PATH_MAX, "%s%s%s%s",
+ ret = snprintf(pathname, LTTNG_PATH_MAX, "%s%s%s%s",
consumer->dst.net.base_dir,
consumer->chunk_path,
consumer->subdir,