All of lore.kernel.org
 help / color / mirror / Atom feed
* Re: [PATCH lttng-tools] Fix: save: close fd of configuration file
       [not found] <1476828593-8761-1-git-send-email-jonathan.rajotte-julien@efficios.com>
@ 2016-10-18 22:13 ` Jonathan Rajotte Julien
  2016-10-19 19:49 ` Jérémie Galarneau
  1 sibling, 0 replies; 3+ messages in thread
From: Jonathan Rajotte Julien @ 2016-10-18 22:13 UTC (permalink / raw)
  To: lttng-dev; +Cc: jgalar

Hi,

This should be backported to 2.9,2.8,2.7.

Thanks

On 2016-10-18 06:09 PM, Jonathan Rajotte wrote:
> Signed-off-by: Jonathan Rajotte <jonathan.rajotte-julien@efficios.com>
> ---
>   src/bin/lttng-sessiond/save.c      | 7 +++++++
>   src/common/config/session-config.h | 4 ++--
>   2 files changed, 9 insertions(+), 2 deletions(-)
>
> diff --git a/src/bin/lttng-sessiond/save.c b/src/bin/lttng-sessiond/save.c
> index 9ac7712..1a879b2 100644
> --- a/src/bin/lttng-sessiond/save.c
> +++ b/src/bin/lttng-sessiond/save.c
> @@ -2053,6 +2053,13 @@ end:
>   		}
>   	}
>   
> +	if (file_opened) {
> +		ret = close(fd);
> +		if (ret) {
> +			PERROR("Closing XML session configuration");
> +		}
> +	}
> +
>   	return ret;
>   }
>   
> diff --git a/src/common/config/session-config.h b/src/common/config/session-config.h
> index c6439f7..f48ff74 100644
> --- a/src/common/config/session-config.h
> +++ b/src/common/config/session-config.h
> @@ -85,8 +85,8 @@ int config_parse_value(const char *value);
>   /*
>    * Create an instance of a configuration writer.
>    *
> - * fd_output File to which the XML content must be written. The file will be
> - * closed once the config_writer has been destroyed.
> + * fd_output File to which the XML content must be written. fd_output is
> + * owned by the caller.
>    *
>    * indent If other than 0 the XML will be pretty printed
>    * with indentation and newline.

-- 
Jonathan R. Julien
Efficios

_______________________________________________
lttng-dev mailing list
lttng-dev@lists.lttng.org
https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH lttng-tools] Fix: save: close fd of configuration file
       [not found] <1476828593-8761-1-git-send-email-jonathan.rajotte-julien@efficios.com>
  2016-10-18 22:13 ` [PATCH lttng-tools] Fix: save: close fd of configuration file Jonathan Rajotte Julien
@ 2016-10-19 19:49 ` Jérémie Galarneau
  1 sibling, 0 replies; 3+ messages in thread
From: Jérémie Galarneau @ 2016-10-19 19:49 UTC (permalink / raw)
  To: Jonathan Rajotte; +Cc: lttng-dev, Jeremie Galarneau

Merged in master, 2.9, 2.8 and 2.7.

Thanks!
Jérémie

On 18 October 2016 at 18:09, Jonathan Rajotte
<jonathan.rajotte-julien@efficios.com> wrote:
> Signed-off-by: Jonathan Rajotte <jonathan.rajotte-julien@efficios.com>
> ---
>  src/bin/lttng-sessiond/save.c      | 7 +++++++
>  src/common/config/session-config.h | 4 ++--
>  2 files changed, 9 insertions(+), 2 deletions(-)
>
> diff --git a/src/bin/lttng-sessiond/save.c b/src/bin/lttng-sessiond/save.c
> index 9ac7712..1a879b2 100644
> --- a/src/bin/lttng-sessiond/save.c
> +++ b/src/bin/lttng-sessiond/save.c
> @@ -2053,6 +2053,13 @@ end:
>                 }
>         }
>
> +       if (file_opened) {
> +               ret = close(fd);
> +               if (ret) {
> +                       PERROR("Closing XML session configuration");
> +               }
> +       }
> +
>         return ret;
>  }
>
> diff --git a/src/common/config/session-config.h b/src/common/config/session-config.h
> index c6439f7..f48ff74 100644
> --- a/src/common/config/session-config.h
> +++ b/src/common/config/session-config.h
> @@ -85,8 +85,8 @@ int config_parse_value(const char *value);
>  /*
>   * Create an instance of a configuration writer.
>   *
> - * fd_output File to which the XML content must be written. The file will be
> - * closed once the config_writer has been destroyed.
> + * fd_output File to which the XML content must be written. fd_output is
> + * owned by the caller.
>   *
>   * indent If other than 0 the XML will be pretty printed
>   * with indentation and newline.
> --
> 2.7.4
>



-- 
Jérémie Galarneau
EfficiOS Inc.
http://www.efficios.com
_______________________________________________
lttng-dev mailing list
lttng-dev@lists.lttng.org
https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH lttng-tools] Fix: save: close fd of configuration file
@ 2016-10-18 22:09 Jonathan Rajotte
  0 siblings, 0 replies; 3+ messages in thread
From: Jonathan Rajotte @ 2016-10-18 22:09 UTC (permalink / raw)
  To: lttng-dev; +Cc: jgalar

Signed-off-by: Jonathan Rajotte <jonathan.rajotte-julien@efficios.com>
---
 src/bin/lttng-sessiond/save.c      | 7 +++++++
 src/common/config/session-config.h | 4 ++--
 2 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/src/bin/lttng-sessiond/save.c b/src/bin/lttng-sessiond/save.c
index 9ac7712..1a879b2 100644
--- a/src/bin/lttng-sessiond/save.c
+++ b/src/bin/lttng-sessiond/save.c
@@ -2053,6 +2053,13 @@ end:
 		}
 	}
 
+	if (file_opened) {
+		ret = close(fd);
+		if (ret) {
+			PERROR("Closing XML session configuration");
+		}
+	}
+
 	return ret;
 }
 
diff --git a/src/common/config/session-config.h b/src/common/config/session-config.h
index c6439f7..f48ff74 100644
--- a/src/common/config/session-config.h
+++ b/src/common/config/session-config.h
@@ -85,8 +85,8 @@ int config_parse_value(const char *value);
 /*
  * Create an instance of a configuration writer.
  *
- * fd_output File to which the XML content must be written. The file will be
- * closed once the config_writer has been destroyed.
+ * fd_output File to which the XML content must be written. fd_output is
+ * owned by the caller.
  *
  * indent If other than 0 the XML will be pretty printed
  * with indentation and newline.
-- 
2.7.4

_______________________________________________
lttng-dev mailing list
lttng-dev@lists.lttng.org
https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-10-19 19:51 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <1476828593-8761-1-git-send-email-jonathan.rajotte-julien@efficios.com>
2016-10-18 22:13 ` [PATCH lttng-tools] Fix: save: close fd of configuration file Jonathan Rajotte Julien
2016-10-19 19:49 ` Jérémie Galarneau
2016-10-18 22:09 Jonathan Rajotte

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.