Port: Use LTTNG_NAME_MAX instead of NAME_MAX
authorMichael Jeanson <mjeanson@efficios.com>
Wed, 14 Oct 2015 18:31:03 +0000 (14:31 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Mon, 19 Oct 2015 03:39:53 +0000 (23:39 -0400)
Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
14 files changed:
include/lttng/constant.h
include/lttng/domain.h
include/lttng/handle.h
include/lttng/load-internal.h
include/lttng/save-internal.h
include/lttng/session.h
include/lttng/snapshot-internal.h
src/bin/lttng-relayd/main.c
src/bin/lttng-relayd/session.h
src/bin/lttng-relayd/stream.c
src/common/mi-lttng.h
src/common/sessiond-comm/relayd.h
src/lib/lttng-ctl/load.c
src/lib/lttng-ctl/save.c

index 10f1bf694503fc5e42d9a20632fb5c5c9c2fdce7..edf4c3a8dd97d9b189aae0d4779418fe1f17dc09 100644 (file)
@@ -54,4 +54,6 @@
 #define LTTNG_MAX_PID                          INT32_MAX
 #define LTTNG_MAX_PID_STR                      "2147483647"
 
+#define LTTNG_NAME_MAX                         255
+
 #endif /* LTTNG_CONSTANT_H */
index 3ee04191c45411b11cab7c782b44795280ac88ff..bff134a84f4c13cfe80cb2c0f9e2446419147b1c 100644 (file)
@@ -54,7 +54,7 @@ struct lttng_domain {
 
        union {
                pid_t pid;
-               char exec_name[NAME_MAX];
+               char exec_name[LTTNG_NAME_MAX];
                char padding[LTTNG_DOMAIN_PADDING2];
        } attr;
 };
index b1057efe530bc2865bbc3a2dad6d1a5c75b36a31..a313e79632fd9457f48c494cbef2ba4b2b5e1486 100644 (file)
@@ -31,7 +31,7 @@ extern "C" {
  */
 #define LTTNG_HANDLE_PADDING1              16
 struct lttng_handle {
-       char session_name[NAME_MAX];
+       char session_name[LTTNG_NAME_MAX];
        struct lttng_domain domain;
 
        char padding[LTTNG_HANDLE_PADDING1];
index 85f0afa542f194e12494accc50ef4de136ac3a4a..78cf86a2dc314037c9f4a962164a02f59d9de983 100644 (file)
@@ -22,6 +22,7 @@
 #include <limits.h>
 #include <stdint.h>
 
+#include <lttng/constant.h>
 #include <common/macros.h>
 
 /*
@@ -29,7 +30,7 @@
  */
 struct lttng_load_session_attr {
        /* Name of the session to load, empty string means all. */
-       char session_name[NAME_MAX];
+       char session_name[LTTNG_NAME_MAX];
        /* URL of the session configuration file to load. */
        char input_url[PATH_MAX];
        /* Overwrite the session if it exists. */
index f4a56f8667f878805db888cb1ca47be81aef47d1..e2528be641d53dacf99d84db760c036f5f918c87 100644 (file)
@@ -21,6 +21,7 @@
 #include <limits.h>
 #include <stdint.h>
 
+#include <lttng/constant.h>
 #include <common/macros.h>
 
 /*
@@ -28,7 +29,7 @@
  */
 struct lttng_save_session_attr {
        /* Name of the session to save, empty string means all. */
-       char session_name[NAME_MAX];
+       char session_name[LTTNG_NAME_MAX];
        /* Destination of the session configuration. See lttng(1) for URL format. */
        char configuration_url[PATH_MAX];
        /* Overwrite the session configuration file if it exists. */
index e0594d2e82e452bf072d90899b945b2afc31be3c..4e515ad7703bc03b3bb5530118063f29ac7051f5 100644 (file)
@@ -32,7 +32,7 @@ extern "C" {
  */
 #define LTTNG_SESSION_PADDING1             12
 struct lttng_session {
-       char name[NAME_MAX];
+       char name[LTTNG_NAME_MAX];
        /* The path where traces are written */
        char path[PATH_MAX];
        uint32_t enabled;       /* enabled/started: 1, disabled/stopped: 0 */
index a14564b3b03c4bc9a1ccd195f7fbce336a0b9f12..b7391c228f084b1e7b732282010b763da1c48dd0 100644 (file)
@@ -20,6 +20,7 @@
 
 #include <limits.h>
 #include <stdint.h>
+#include <lttng/constant.h>
 
 /*
  * Object used for the snapshot API. This is opaque to the public library.
@@ -37,7 +38,7 @@ struct lttng_snapshot_output {
         */
        uint64_t max_size;
        /* Name of the output so it can be recognized easily when listing them. */
-       char name[NAME_MAX];
+       char name[LTTNG_NAME_MAX];
        /* Destination of the output. See lttng(1) for URL format. */
        char ctrl_url[PATH_MAX];
        /* Destination of the output. See lttng(1) for URL format. */
index 0c7ef8d76c0449afba1aa314cf33db87a3af2368..28e52696e568760c898cf7c49a8a79068f5a3add 100644 (file)
@@ -1068,12 +1068,12 @@ static int relay_create_session(struct lttcomm_relayd_hdr *recv_hdr,
        int ret = 0, send_ret;
        struct relay_session *session;
        struct lttcomm_relayd_status_session reply;
-       char session_name[NAME_MAX];
+       char session_name[LTTNG_NAME_MAX];
        char hostname[HOST_NAME_MAX];
        uint32_t live_timer = 0;
        bool snapshot = false;
 
-       memset(session_name, 0, NAME_MAX);
+       memset(session_name, 0, LTTNG_NAME_MAX);
        memset(hostname, 0, HOST_NAME_MAX);
 
        memset(&reply, 0, sizeof(reply));
index 1a37cfee2069800be941eeb4f875354270c1ecdc..de1e44f0d7fd36410349a7c1f1ecbcac8bc3c76b 100644 (file)
@@ -26,6 +26,7 @@
 #include <urcu/list.h>
 #include <urcu/ref.h>
 
+#include <lttng/constant.h>
 #include <common/hashtable/hashtable.h>
 
 /*
@@ -38,7 +39,7 @@ struct relay_session {
         * It is used to match a set of streams to their session.
         */
        uint64_t id;
-       char session_name[NAME_MAX];
+       char session_name[LTTNG_NAME_MAX];
        char hostname[HOST_NAME_MAX];
        uint32_t live_timer;
 
index 8825d094ce57b389662667bfd5d567ca0ed77cfd..02bf9dd54995ed2aab6d026ecb578d9127610908 100644 (file)
@@ -149,7 +149,7 @@ struct relay_stream *stream_create(struct ctf_trace *trace,
                DBG("Tracefile %s/%s created", stream->path_name, stream->channel_name);
        }
 
-       if (!strncmp(stream->channel_name, DEFAULT_METADATA_NAME, NAME_MAX)) {
+       if (!strncmp(stream->channel_name, DEFAULT_METADATA_NAME, LTTNG_NAME_MAX)) {
                stream->is_metadata = 1;
        }
 
index c3976681e76fcfe6a90adf134a50aa4c05bec971..55ea68d73b9b0c2468a9b4bfe8aa1852215f791f 100644 (file)
@@ -39,13 +39,13 @@ struct mi_writer {
  * Version information for the machine interface.
  */
 struct mi_lttng_version {
-       char version[NAME_MAX]; /* Version number of package */
+       char version[LTTNG_NAME_MAX]; /* Version number of package */
        uint32_t version_major; /* LTTng-Tools major version number */
        uint32_t version_minor; /* LTTng-Tools minor version number */
        uint32_t version_patchlevel; /* LTTng-Tools patchlevel version number */
-       char version_commit[NAME_MAX]; /* Commit hash of the current version */
-       char version_name[NAME_MAX];
-       char package_url[NAME_MAX]; /* Define to the home page for this package. */
+       char version_commit[LTTNG_NAME_MAX]; /* Commit hash of the current version */
+       char version_name[LTTNG_NAME_MAX];
+       char package_url[LTTNG_NAME_MAX]; /* Define to the home page for this package. */
 };
 
 /* Strings related to command */
index ff56d3a26fe1aff3bec9b678b020cea0da4c6de7..1152d28e907676aa6e06ed046ae62c5e5da977df 100644 (file)
@@ -168,7 +168,7 @@ struct lttcomm_relayd_index {
  * Create session in 2.4 adds additionnal parameters for live reading.
  */
 struct lttcomm_relayd_create_session_2_4 {
-       char session_name[NAME_MAX];
+       char session_name[LTTNG_NAME_MAX];
        char hostname[HOST_NAME_MAX];
        uint32_t live_timer;
        uint32_t snapshot;
index 3599503e51ad5b08eba677a01b213a107bad7ad1..29998cda303e5c1894cff26ca4b90c26aa244cc8 100644 (file)
@@ -84,7 +84,7 @@ int lttng_load_session_attr_set_session_name(
                size_t len;
 
                len = strlen(session_name);
-               if (len >= NAME_MAX) {
+               if (len >= LTTNG_NAME_MAX) {
                        ret = -LTTNG_ERR_INVALID;
                        goto error;
                }
index 8f8cbb639ae7c7874857d2fb977d69c12af6a03b..d2a7e67c55a14b75719ada6355b970039f292f9c 100644 (file)
@@ -83,7 +83,7 @@ int lttng_save_session_attr_set_session_name(
                size_t len;
 
                len = strlen(session_name);
-               if (len >= NAME_MAX) {
+               if (len >= LTTNG_NAME_MAX) {
                        ret = -LTTNG_ERR_INVALID;
                        goto error;
                }
This page took 0.046844 seconds and 5 git commands to generate.