From 049df1bdbf55b52d65a64a2210654796f35ae0f0 Mon Sep 17 00:00:00 2001 From: malc Date: Sun, 11 Mar 2012 00:48:58 +0400 Subject: [PATCH] Cleanup spawn attributes/file actions --- link.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/link.c b/link.c index b0c4bf4..ef3d811 100644 --- a/link.c +++ b/link.c @@ -2616,6 +2616,16 @@ CAMLprim value ml_popen (value command_v, value fds_v) if ((ret = posix_spawn (NULL, "/bin/sh", &fa, &attr, argv, environ))) { unix_error (ret, "posix_spawn", command_v); } + + if ((ret = posix_spawnattr_destroy (&attr)) != 0) { + fprintf (stderr, "posix_spawnattr_destroy: %s\n", strerror (ret)); + } + + if ((ret = posix_spawn_file_actions_destroy (&fa)) != 0) { + fprintf (stderr, "posix_spawn_file_actions_destroy: %s\n", + strerror (ret)); + } + CAMLreturn (Val_unit); } #endif -- 2.11.4.GIT