Skip to content

Commit

Permalink
check if creating unix domain socket failed
Browse files Browse the repository at this point in the history
  • Loading branch information
akohlmey committed Nov 17, 2023
1 parent e59a665 commit a4da559
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/MISC/fix_ipi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ static void open_socket(int &sockfd, int inet, int port, char *host, Error *erro

// creates socket
sockfd = socket(res->ai_family, res->ai_socktype, res->ai_protocol);
if (sockfd < 0) error->one(FLERR, "Error opening socket");
if (sockfd < 0) error->one(FLERR, "Error creating socket for fix ipi");

// makes connection
if (connect(sockfd, res->ai_addr, res->ai_addrlen) < 0)
Expand All @@ -116,6 +116,7 @@ static void open_socket(int &sockfd, int inet, int port, char *host, Error *erro

// creates the socket
sockfd = socket(AF_UNIX, SOCK_STREAM, 0);
if (sockfd < 0) error->one(FLERR, "Error creating socket for fix ipi");

// connects
if (connect(sockfd, (struct sockaddr *) &serv_addr, sizeof(serv_addr)) < 0)
Expand Down

0 comments on commit a4da559

Please sign in to comment.