diff options
| author | Michael Kerrisk <mtk.manpages@gmail.com> | 2020-12-27 11:42:50 +0100 |
|---|---|---|
| committer | Michael Kerrisk <mtk.manpages@gmail.com> | 2020-12-27 12:32:44 +0100 |
| commit | 46b20ca1bb0f338c6e8d805faab262ef32502d24 (patch) | |
| tree | b2b4d0a339920698166a8ba3323e4c6bac897cf4 /man7/unix.7 | |
| parent | c6beb8a167044b025e9c95610773a5764ccff760 (diff) | |
| download | man-pages-46b20ca1bb0f338c6e8d805faab262ef32502d24.tar.gz | |
ioctl_ns.2, keyctl.2, memfd_create.2, pidfd_send_signal.2, poll.2, seccomp.2, signalfd.2, timerfd_create.2, unshare.2, dlinfo.3, duplocale.3, fopencookie.3, getgrouplist.3, getifaddrs.3, getprotoent_r.3, getservent_r.3, insque.3, printf.3, pthread_attr_init.3, pthread_cancel.3, pthread_create.3, pthread_mutexattr_setrobust.3, pthread_setaffinity_np.3, qsort.3, sem_wait.3, core.5, elf.5, aio.7, epoll.7, pkeys.7, system_data_types.7, unix.7: Use periods more consistently inside code comments
In general, complete sentences in free-standing comments
should be terminated by periods.
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
Diffstat (limited to 'man7/unix.7')
| -rw-r--r-- | man7/unix.7 | 38 |
1 files changed, 19 insertions, 19 deletions
diff --git a/man7/unix.7 b/man7/unix.7 index 40edeb90d7..c3372e28fb 100644 --- a/man7/unix.7 +++ b/man7/unix.7 @@ -978,7 +978,7 @@ main(int argc, char *argv[]) int result; char buffer[BUFFER_SIZE]; - /* Create local socket */ + /* Create local socket. */ connection_socket = socket(AF_UNIX, SOCK_SEQPACKET, 0); if (connection_socket == \-1) { @@ -994,7 +994,7 @@ main(int argc, char *argv[]) memset(&name, 0, sizeof(name)); - /* Bind socket to socket name */ + /* Bind socket to socket name. */ name.sun_family = AF_UNIX; strncpy(name.sun_path, SOCKET_NAME, sizeof(name.sun_path) \- 1); @@ -1018,11 +1018,11 @@ main(int argc, char *argv[]) exit(EXIT_FAILURE); } - /* This is the main loop for handling connections */ + /* This is the main loop for handling connections. */ for (;;) { - /* Wait for incoming connection */ + /* Wait for incoming connection. */ data_socket = accept(connection_socket, NULL, NULL); if (data_socket == \-1) { @@ -1033,7 +1033,7 @@ main(int argc, char *argv[]) result = 0; for (;;) { - /* Wait for next data packet */ + /* Wait for next data packet. */ ret = read(data_socket, buffer, sizeof(buffer)); if (ret == \-1) { @@ -1041,11 +1041,11 @@ main(int argc, char *argv[]) exit(EXIT_FAILURE); } - /* Ensure buffer is 0\-terminated */ + /* Ensure buffer is 0\-terminated. */ buffer[sizeof(buffer) \- 1] = 0; - /* Handle commands */ + /* Handle commands. */ if (!strncmp(buffer, "DOWN", sizeof(buffer))) { down_flag = 1; @@ -1056,12 +1056,12 @@ main(int argc, char *argv[]) break; } - /* Add received summand */ + /* Add received summand. */ result += atoi(buffer); } - /* Send result */ + /* Send result. */ sprintf(buffer, "%d", result); ret = write(data_socket, buffer, sizeof(buffer)); @@ -1070,11 +1070,11 @@ main(int argc, char *argv[]) exit(EXIT_FAILURE); } - /* Close socket */ + /* Close socket. */ close(data_socket); - /* Quit on DOWN command */ + /* Quit on DOWN command. */ if (down_flag) { break; @@ -1083,7 +1083,7 @@ main(int argc, char *argv[]) close(connection_socket); - /* Unlink the socket */ + /* Unlink the socket. */ unlink(SOCKET_NAME); @@ -1111,7 +1111,7 @@ main(int argc, char *argv[]) int data_socket; char buffer[BUFFER_SIZE]; - /* Create local socket */ + /* Create local socket. */ data_socket = socket(AF_UNIX, SOCK_SEQPACKET, 0); if (data_socket == \-1) { @@ -1127,7 +1127,7 @@ main(int argc, char *argv[]) memset(&addr, 0, sizeof(addr)); - /* Connect socket to socket address */ + /* Connect socket to socket address. */ addr.sun_family = AF_UNIX; strncpy(addr.sun_path, SOCKET_NAME, sizeof(addr.sun_path) \- 1); @@ -1139,7 +1139,7 @@ main(int argc, char *argv[]) exit(EXIT_FAILURE); } - /* Send arguments */ + /* Send arguments. */ for (int i = 1; i < argc; ++i) { ret = write(data_socket, argv[i], strlen(argv[i]) + 1); @@ -1149,7 +1149,7 @@ main(int argc, char *argv[]) } } - /* Request result */ + /* Request result. */ strcpy(buffer, "END"); ret = write(data_socket, buffer, strlen(buffer) + 1); @@ -1158,7 +1158,7 @@ main(int argc, char *argv[]) exit(EXIT_FAILURE); } - /* Receive result */ + /* Receive result. */ ret = read(data_socket, buffer, sizeof(buffer)); if (ret == \-1) { @@ -1166,13 +1166,13 @@ main(int argc, char *argv[]) exit(EXIT_FAILURE); } - /* Ensure buffer is 0\-terminated */ + /* Ensure buffer is 0\-terminated. */ buffer[sizeof(buffer) \- 1] = 0; printf("Result = %s\en", buffer); - /* Close socket */ + /* Close socket. */ close(data_socket); |
