Skip to content

Commit

Permalink
comments: grammar fixes and clarifications
Browse files Browse the repository at this point in the history
  • Loading branch information
gperciva authored and cperciva committed Nov 30, 2023
1 parent f2627f3 commit b1d8828
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 8 deletions.
8 changes: 4 additions & 4 deletions events/events_network.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
* for it to be larger than size_t unless there's an undocumented limit on
* the number of descriptors which can be polled (since poll takes an array,
* the size of which must fit into a size_t); and nfds_t should be able to
* the value INT_MAX + 1 (in case every possible file descriptor is in use
* and being polled for).
* store the value INT_MAX + 1 (in case every possible file descriptor is in
* use and being polled for).
*/
CTASSERT((nfds_t)(-1) <= (size_t)(-1));
CTASSERT((nfds_t)((size_t)(INT_MAX) + 1) == (size_t)(INT_MAX) + 1);
Expand Down Expand Up @@ -65,7 +65,7 @@ static size_t fdscanpos;
* S[i].reader != NULL <==> (fds[S[i].pollpos].events & POLLIN) != 0
* S[i].writer != NULL <==> (fds[S[i].pollpos].events & POLLOUT) != 0
* 5. We don't have events ready which we don't want:
* (fds[j].revents & (POLLIN | POLLOUT) & (~fds[j].events])) == 0
* (fds[j].revents & (POLLIN | POLLOUT) & (~fds[j].events)) == 0
* 6. Returned events are in position to be scanned later:
* fds[j].revents != 0 ==> f < fdscanpos.
*/
Expand Down Expand Up @@ -451,7 +451,7 @@ events_network_get(void)
break;
}

/* Are we ready for reading? */
/* Are we ready for writing? */
if (fds[fdscanpos].revents & POLLOUT) {
r = socketlist_get(S,
(size_t)fds[fdscanpos].fd)->writer;
Expand Down
2 changes: 1 addition & 1 deletion network_ssl/network_ssl.c
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ docallback(int (* callback)(void *, ssize_t), void * cookie, ssize_t len,

/*
* Zero the callback pointer; the callback might want to request
* another read/write operation so we need to get out of the way.
* another read/write operation, so we need to get out of the way.
*/
*callback_ptr = NULL;

Expand Down
4 changes: 2 additions & 2 deletions network_ssl/network_ssl_compat.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#ifdef NETWORK_SSL_COMPAT_TLS_CLIENT_METHOD
/**
* network_ssl_compat_TLS_client_method(void):
* Create a SSL_METHOD.
* Create an SSL_METHOD.
*
* COMPATIBILITY: Behave like TLS_client_method().
*/
Expand All @@ -35,7 +35,7 @@ network_ssl_compat_CTL_set_min_proto_version(SSL_CTX * ctx, int version)
{
long options;

/* This the only version currently supported in this file. */
/* This is the only version currently supported in this file. */
assert(version == TLS1_2_VERSION);

/* Disable all protocols lower than TLS1_2_VERSION. */
Expand Down
2 changes: 1 addition & 1 deletion network_ssl/network_ssl_compat.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
#ifdef NETWORK_SSL_COMPAT_TLS_CLIENT_METHOD
/**
* network_ssl_compat_TLS_client_method(void):
* Create a SSL_METHOD.
* Create an SSL_METHOD.
*
* COMPATIBILITY: Behave like TLS_client_method().
*/
Expand Down
2 changes: 2 additions & 0 deletions util/sock.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ sock_resolve_unix(const char * addr)
if ((sa_un = calloc(1, sizeof(struct sockaddr_un))) == NULL)
goto err0;
sa_un->sun_family = AF_UNIX;

/* Safely copy addr into the structure. */
if (strlen(addr) >= sizeof(sa_un->sun_path)) {
warn0("socket path too long: %s", addr);
goto err1;
Expand Down

0 comments on commit b1d8828

Please sign in to comment.