Displaying 4 results from an estimated 4 matches for "cleanup_free_string_vector".
2020 Jun 02
0
[PATCH nbdkit 2/5] vddk: Move reexec code to a new file.
...tl.h>
+
+#define NBDKIT_API_VERSION 2
+#include <nbdkit-plugin.h>
+
+#include "cleanup.h"
+#include "vector.h"
+
+#include "vddk.h"
+
+char *reexeced; /* orig LD_LIBRARY_PATH on reexec */
+
+DEFINE_VECTOR_TYPE(string_vector, char *);
+
+#define CLEANUP_FREE_STRING_VECTOR \
+ __attribute__((cleanup (cleanup_free_string_vector)))
+
+static void
+cleanup_free_string_vector (string_vector *v)
+{
+ string_vector_iter (v, (void *) free);
+ free (v->ptr);
+}
+
+/* Perform a re-exec that temporarily modifies LD_LIBRARY_PATH. Does
+ * not return on success; on failur...
2020 Jun 02
0
[PATCH nbdkit 3/5] vddk: Miscellaneous improvements to reexec code.
...sible buffer (string). */
+DEFINE_VECTOR_TYPE(buffer, char);
+
+#define CLEANUP_FREE_BUFFER \
+ __attribute__((cleanup (cleanup_free_buffer)))
+
+static void
+cleanup_free_buffer (buffer *v)
+{
+ free (v->ptr);
+}
+
+/* List of strings. */
DEFINE_VECTOR_TYPE(string_vector, char *);
#define CLEANUP_FREE_STRING_VECTOR \
@@ -68,11 +81,13 @@ cleanup_free_string_vector (string_vector *v)
static void
perform_reexec (const char *env, const char *prepend)
{
+ static const char cmdline_file[] = "/proc/self/cmdline";
+ static const char exe_file[] = "/proc/self/exe";
CLEANUP_FREE char *librar...
2020 Jun 02
9
[PATCH nbdkit 0/5] vddk: Fix password parameter.
Probably needs a bit of cleanup, but seems like it is generally the
right direction.
One thing I've noticed is that the expect test randomly (but rarely)
hangs :-( I guess something is racey but I don't know what at the
moment.
Rich.
2020 Apr 19
2
[PATCH nbdkit 1/2] vddk: Use new vector library to allocate the argv list.
..."vector.h"
#include "vddk-structs.h"
@@ -256,12 +257,23 @@ vddk_config (const char *key, const char *value)
* the caller prefers to proceed as if this had not been attempted.
* Thus, no return value is needed.
*/
+DEFINE_VECTOR_TYPE(string_vector, char *);
+
+#define CLEANUP_FREE_STRING_VECTOR \
+ __attribute__((cleanup (cleanup_free_string_vector)))
+
+static void
+cleanup_free_string_vector (string_vector *v)
+{
+ string_vector_iter (v, (void *) free);
+ free (v->ptr);
+}
+
static void
perform_reexec (const char *env, const char *prepend)
{
CLEANUP_FREE char *library = NULL...