- /* Connect */
- PARA_NOTICE_LOG("connecting to %s...\n",
- args_info.hostname_arg);
- if (para_connect(sockfd, &their_addr) < 0)
- exit(EXIT_FAILURE);
- /* Receive Welcome message */
- if ((numbytes = recv_buffer(sockfd, buf, sizeof(buf))) < 0)
- exit(EXIT_FAILURE);
+ /* connect */
+ PARA_NOTICE_LOG("connecting to %s\n", args_info.hostname_arg);
+ ret = para_connect(sockfd, &their_addr);
+ if (ret < 0)
+ goto out;
+ /* receive welcome message */
+ ret = recv_buffer(sockfd, buf, sizeof(buf));
+ if (ret < 0)
+ goto out;