Skip to content

Commit

Permalink
Use the stored error value
Browse files Browse the repository at this point in the history
This resolves a static analysis warning about the value stored to `error` never being read, and following uses seem to indicate this individual case might be a typo.
  • Loading branch information
tonyarnold committed Jul 27, 2020
1 parent 7e9f6fa commit 8cfde22
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion peertalk/PTChannel.m
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ - (void)connectToPort:(in_port_t)port IPv4Address:(in_addr_t)address callback:(v
if (fd == -1) {
perror("socket(AF_INET, SOCK_STREAM, 0) failed");
error = errno;
if (callback) callback([[NSError alloc] initWithDomain:NSPOSIXErrorDomain code:errno userInfo:nil], nil);
if (callback) callback([[NSError alloc] initWithDomain:NSPOSIXErrorDomain code:error userInfo:nil], nil);
return;
}

Expand Down

0 comments on commit 8cfde22

Please sign in to comment.