Skip to content


Subversion checkout URL

You can clone with
Download ZIP


Fix amqpspawn #7

merged 2 commits into from

2 participants


No description provided.


if amqpspawn crashed or was restarted, socket descriptor would still be held open by new child processes.
By set FD_CLOEXEC, process to be closed connection after the fork.

@rmt rmt merged commit ad71013 into rmt:master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
Showing with 2 additions and 1 deletion.
  1. +2 −1  amqpspawn.c
3  amqpspawn.c
@@ -185,7 +185,7 @@ int main(int argc, char **argv) {
char const *username = "guest";
char const *password = "guest";
char const *program = NULL;
- char const *program_args = NULL;
+ char const *program_args = "";
amqp_bytes_t queue = AMQP_EMPTY_BYTES;
int sockfd;
@@ -321,6 +321,7 @@ int main(int argc, char **argv) {
conn = amqp_new_connection();
die_on_error(sockfd = amqp_open_socket(hostname, port), "Opening socket");
+ fcntl(sockfd, F_SETFD, FD_CLOEXEC);
amqp_set_sockfd(conn, sockfd);
die_on_amqp_error(amqp_login(conn, vhost,
0, /* channel_max */
Something went wrong with that request. Please try again.