Make errors retrievable from tor_socketpair; resolve bug 163.

svn:r4509
This commit is contained in:
Nick Mathewson
2005-06-30 07:17:38 +00:00
parent 584a0ae397
commit d85bfe83bf
4 changed files with 42 additions and 42 deletions
+3 -3
View File
@@ -301,11 +301,11 @@ spawn_cpuworker(void)
int *fdarray;
int fd;
connection_t *conn;
int err;
fdarray = tor_malloc(sizeof(int)*2);
if (tor_socketpair(AF_UNIX, SOCK_STREAM, 0, fdarray) < 0) {
log(LOG_ERR, "Couldn't construct socketpair: %s",
tor_socket_strerror(tor_socket_errno(-1)));
if ((err = tor_socketpair(AF_UNIX, SOCK_STREAM, 0, fdarray)) < 0) {
log(LOG_ERR, "Couldn't construct socketpair: %s", tor_socket_strerror(-err));
tor_cleanup();
tor_free(fdarray);
exit(1);