aboutsummaryrefslogtreecommitdiffstats
path: root/man7
diff options
context:
space:
mode:
Diffstat (limited to 'man7')
-rw-r--r--man7/aio.710
-rw-r--r--man7/inotify.76
-rw-r--r--man7/sock_diag.73
-rw-r--r--man7/unix.73
-rw-r--r--man7/user_namespaces.74
5 files changed, 11 insertions, 15 deletions
diff --git a/man7/aio.7 b/man7/aio.7
index a9586a6943..ff099885ef 100644
--- a/man7/aio.7
+++ b/man7/aio.7
@@ -295,7 +295,7 @@ int
main(int argc, char *argv[])
{
struct sigaction sa;
- int s, j;
+ int s;
int numReqs; /* Total number of queued I/O requests */
int openReqs; /* Number of I/O requests still in progress */
@@ -334,7 +334,7 @@ main(int argc, char *argv[])
/* Open each file specified on the command line, and queue
a read request on the resulting file descriptor */
- for (j = 0; j < numReqs; j++) {
+ for (int j = 0; j < numReqs; j++) {
ioList[j].reqNum = j;
ioList[j].status = EINPROGRESS;
ioList[j].aiocbp = &aiocbList[j];
@@ -377,7 +377,7 @@ main(int argc, char *argv[])
printf("got SIGQUIT; canceling I/O requests: \en");
- for (j = 0; j < numReqs; j++) {
+ for (int j = 0; j < numReqs; j++) {
if (ioList[j].status == EINPROGRESS) {
printf(" Request %d on descriptor %d:", j,
ioList[j].aiocbp\->aio_fildes);
@@ -401,7 +401,7 @@ main(int argc, char *argv[])
in progress */
printf("aio_error():\en");
- for (j = 0; j < numReqs; j++) {
+ for (int j = 0; j < numReqs; j++) {
if (ioList[j].status == EINPROGRESS) {
printf(" for request %d (descriptor %d): ",
j, ioList[j].aiocbp\->aio_fildes);
@@ -433,7 +433,7 @@ main(int argc, char *argv[])
/* Check status return of all I/O requests */
printf("aio_return():\en");
- for (j = 0; j < numReqs; j++) {
+ for (int j = 0; j < numReqs; j++) {
ssize_t s;
s = aio_return(ioList[j].aiocbp);
diff --git a/man7/inotify.7 b/man7/inotify.7
index 9b2d7a4e5a..2414409457 100644
--- a/man7/inotify.7
+++ b/man7/inotify.7
@@ -942,9 +942,7 @@ handle_events(int fd, int *wd, int argc, char* argv[])
char buf[4096]
__attribute__ ((aligned(__alignof__(struct inotify_event))));
const struct inotify_event *event;
- int i;
ssize_t len;
- char *ptr;
/* Loop while events can be read from inotify file descriptor. */
@@ -967,7 +965,7 @@ handle_events(int fd, int *wd, int argc, char* argv[])
/* Loop over all events in the buffer */
- for (ptr = buf; ptr < buf + len;
+ for (char *ptr = buf; ptr < buf + len;
ptr += sizeof(struct inotify_event) + event\->len) {
event = (const struct inotify_event *) ptr;
@@ -983,7 +981,7 @@ handle_events(int fd, int *wd, int argc, char* argv[])
/* Print the name of the watched directory */
- for (i = 1; i < argc; ++i) {
+ for (int i = 1; i < argc; ++i) {
if (wd[i] == event\->wd) {
printf("%s/", argv[i]);
break;
diff --git a/man7/sock_diag.7 b/man7/sock_diag.7
index a5816ceca5..89d4b404ae 100644
--- a/man7/sock_diag.7
+++ b/man7/sock_diag.7
@@ -711,13 +711,12 @@ print_diag(const struct unix_diag_msg *diag, unsigned int len)
return \-1;
}
- struct rtattr *attr;
unsigned int rta_len = len \- NLMSG_LENGTH(sizeof(*diag));
unsigned int peer = 0;
size_t path_len = 0;
char path[sizeof(((struct sockaddr_un *) 0)\->sun_path) + 1];
- for (attr = (struct rtattr *) (diag + 1);
+ for (struct rtattr *attr = (struct rtattr *) (diag + 1);
RTA_OK(attr, rta_len); attr = RTA_NEXT(attr, rta_len)) {
switch (attr\->rta_type) {
case UNIX_DIAG_NAME:
diff --git a/man7/unix.7 b/man7/unix.7
index 30b0e754d4..f61b514240 100644
--- a/man7/unix.7
+++ b/man7/unix.7
@@ -1063,7 +1063,6 @@ int
main(int argc, char *argv[])
{
struct sockaddr_un addr;
- int i;
int ret;
int data_socket;
char buffer[BUFFER_SIZE];
@@ -1098,7 +1097,7 @@ main(int argc, char *argv[])
/* Send arguments. */
- for (i = 1; i < argc; ++i) {
+ for (int i = 1; i < argc; ++i) {
ret = write(data_socket, argv[i], strlen(argv[i]) + 1);
if (ret == \-1) {
perror("write");
diff --git a/man7/user_namespaces.7 b/man7/user_namespaces.7
index 954a508871..2e3db5fbfd 100644
--- a/man7/user_namespaces.7
+++ b/man7/user_namespaces.7
@@ -1149,13 +1149,13 @@ usage(char *pname)
static void
update_map(char *mapping, char *map_file)
{
- int fd, j;
+ int fd;
size_t map_len; /* Length of \(aqmapping\(aq */
/* Replace commas in mapping string with newlines */
map_len = strlen(mapping);
- for (j = 0; j < map_len; j++)
+ for (int j = 0; j < map_len; j++)
if (mapping[j] == \(aq,\(aq)
mapping[j] = \(aq\en\(aq;