File tree Expand file tree Collapse file tree
src/hal/drivers/mesa-hostmot2 Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -746,19 +746,23 @@ static int init_board(hm2_eth_t *board, const char *board_ip) {
746746}
747747
748748static int close_board (hm2_eth_t * board ) {
749-
749+ int ret ;
750750 board -> llio .reset (& board -> llio );
751751
752752 if (use_iptables ()) clear_iptables ();
753753
754754 if (board -> req .arp_flags & ATF_PERM ) {
755- int ret = ioctl_siocdarp (board );
755+ ret = ioctl_siocdarp (board );
756756 if (ret < 0 ) perror ("ioctl SIOCDARP" );
757757 }
758- int ret = shutdown (board -> sockfd , SHUT_RDWR );
759- if (ret < 0 )
758+ ret = shutdown (board -> sockfd , SHUT_RDWR );
759+ if (ret == -1 )
760+ LL_PRINT ("ERROR: can't shutdown socket: %s\n" , strerror (errno ));
761+
762+ ret = close (board -> sockfd );
763+ if (ret == -1 )
760764 LL_PRINT ("ERROR: can't close socket: %s\n" , strerror (errno ));
761-
765+
762766 return ret < 0 ? - errno : 0 ;
763767}
764768
You can’t perform that action at this time.
0 commit comments