Print this page
10067 Miscellaneous man page typos
Reviewed by: Robert Mustacchi <rm@joyent.com>
Reviewed by: Andy Fiddaman <andy@omniosce.org>
Reviewed by: Volker A. Brandt <vab@bb-c.de>


 167                         (void) close(sock);
 168                         (void) close(eport);
 169                         return (1);
 170                    }
 171                    if (port_get(eport, &pe, NULL) != 0)     {
 172                         perror("port_get");
 173                         (void) close(sock);
 174                         (void) close(eport);
 175                         return (1);
 176                    }
 177                    assert(pe.portev_source == PORT_SOURCE_FD);
 178                    assert(pe.portev_object == (uintptr_t)sock);
 179                    if (getsockopt(sock, SOL_SOCKET, SO_ERROR, &err, &sz) != 0) {
 180                         perror("getsockopt");
 181                         (void) close(sock);
 182                         (void) close(eport);
 183                         return (1);
 184                    }
 185                    if (err != 0) {
 186                         /* Asynch connect failed */
 187                         fprintf(stderr, "asnchronous connect: %s\n",
 188                             strerror(err));
 189                         (void) close(sock);
 190                         (void) close(eport);
 191                         return (1);
 192                    }
 193               }
 194 
 195               /* Read and write to the socket and then clean up */
 196 
 197               return (0);
 198          }
 199 
 200 RETURN VALUES
 201        If the connection or binding succeeds, 0 is returned. Otherwise, -1 is
 202        returned and sets errno to indicate the error.
 203 
 204 ERRORS
 205        The call fails if:
 206 
 207        EACCES




 167                         (void) close(sock);
 168                         (void) close(eport);
 169                         return (1);
 170                    }
 171                    if (port_get(eport, &pe, NULL) != 0)     {
 172                         perror("port_get");
 173                         (void) close(sock);
 174                         (void) close(eport);
 175                         return (1);
 176                    }
 177                    assert(pe.portev_source == PORT_SOURCE_FD);
 178                    assert(pe.portev_object == (uintptr_t)sock);
 179                    if (getsockopt(sock, SOL_SOCKET, SO_ERROR, &err, &sz) != 0) {
 180                         perror("getsockopt");
 181                         (void) close(sock);
 182                         (void) close(eport);
 183                         return (1);
 184                    }
 185                    if (err != 0) {
 186                         /* Asynch connect failed */
 187                         fprintf(stderr, "asynchronous connect: %s\n",
 188                             strerror(err));
 189                         (void) close(sock);
 190                         (void) close(eport);
 191                         return (1);
 192                    }
 193               }
 194 
 195               /* Read and write to the socket and then clean up */
 196 
 197               return (0);
 198          }
 199 
 200 RETURN VALUES
 201        If the connection or binding succeeds, 0 is returned. Otherwise, -1 is
 202        returned and sets errno to indicate the error.
 203 
 204 ERRORS
 205        The call fails if:
 206 
 207        EACCES