diff options
| author | Michael Kerrisk <mtk.manpages@gmail.com> | 2007-06-20 21:39:45 +0000 |
|---|---|---|
| committer | Michael Kerrisk <mtk.manpages@gmail.com> | 2007-06-20 21:39:45 +0000 |
| commit | 29059a6548ec1683f4c91ec4d91d79cf735b6505 (patch) | |
| tree | d221fbcedfa0af3d699d60fbb914b96a95663591 /man2 | |
| parent | bb38b71d155299126b7c03de9003e029801b1e0d (diff) | |
| download | man-pages-29059a6548ec1683f4c91ec4d91d79cf735b6505.tar.gz | |
s/-/\\-/
Diffstat (limited to 'man2')
| -rw-r--r-- | man2/bind.2 | 10 | ||||
| -rw-r--r-- | man2/mprotect.2 | 8 | ||||
| -rw-r--r-- | man2/pipe.2 | 10 | ||||
| -rw-r--r-- | man2/stat.2 | 4 | ||||
| -rw-r--r-- | man2/sysctl.2 | 2 | ||||
| -rw-r--r-- | man2/tee.2 | 4 | ||||
| -rw-r--r-- | man2/wait.2 | 10 |
7 files changed, 27 insertions, 21 deletions
diff --git a/man2/bind.2 b/man2/bind.2 index a07bca42e4..2e1bc46dee 100644 --- a/man2/bind.2 +++ b/man2/bind.2 @@ -282,20 +282,20 @@ main(int argc, char *argv[]) socklen_t peer_addr_size; sfd = socket(AF_UNIX, SOCK_STREAM, 0); - if (sfd == -1) + if (sfd == \-1) die("socket"); memset(&my_addr, 0, sizeof(struct sockaddr_un)); /* Clear structure */ my_addr.sun_family = AF_UNIX; strncpy(my_addr.sun_path, MY_SOCK_PATH, - sizeof(my_addr.sun_path) - 1); + sizeof(my_addr.sun_path) \- 1); if (bind(sfd, (struct sockaddr *) &my_addr, - sizeof(struct sockaddr_un)) == -1) + sizeof(struct sockaddr_un)) == \-1) die("bind"); - if (listen(sfd, LISTEN_BACKLOG) == -1) + if (listen(sfd, LISTEN_BACKLOG) == \-1) die("listen"); /* Now we can accept incoming connections one @@ -304,7 +304,7 @@ main(int argc, char *argv[]) peer_addr_size = sizeof(struct sockaddr_un); cfd = accept(sfd, (struct sockaddr *) &peer_addr, &peer_addr_size) - if (cfd == -1) + if (cfd == \-1) die("accept"); /* Code to deal with incoming connection(s)... */ diff --git a/man2/mprotect.2 b/man2/mprotect.2 index 81b46ea39f..5af2f4b076 100644 --- a/man2/mprotect.2 +++ b/man2/mprotect.2 @@ -168,7 +168,7 @@ static void handler(int sig, siginfo_t *si, void *unused) { printf("Got SIGSEGV at address: 0x%lx\\n", - (long) si->si_addr); + (long) si\->si_addr); exit(EXIT_FAILURE); } @@ -182,11 +182,11 @@ main(int argc, char *argv[]) sa.sa_flags = SA_SIGINFO; sigemptyset(&sa.sa_mask); sa.sa_sigaction = handler; - if (sigaction(SIGSEGV, &sa, NULL) == -1) + if (sigaction(SIGSEGV, &sa, NULL) == \-1) die("sigaction"); pagesize = sysconf(_SC_PAGE_SIZE); - if (pagesize == -1) + if (pagesize == \-1) die("sysconf"); /* Allocate a buffer aligned on a page boundary; @@ -199,7 +199,7 @@ main(int argc, char *argv[]) printf("Start of region: 0x%lx\\n", (long) buffer); if (mprotect(buffer + pagesize * 2, pagesize, - PROT_NONE) == -1) + PROT_NONE) == \-1) die("mprotect"); for (p = buffer ; ; ) diff --git a/man2/pipe.2 b/man2/pipe.2 index 30e5f8d310..f67d8bae04 100644 --- a/man2/pipe.2 +++ b/man2/pipe.2 @@ -93,10 +93,16 @@ main(int argc, char *argv[]) assert(argc == 2); - if (pipe(pfd) == -1) { perror("pipe"); exit(EXIT_FAILURE); } + if (pipe(pfd) == \-1) { + perror("pipe"); + exit(EXIT_FAILURE); + } cpid = fork(); - if (cpid == -1) { perror("fork"); exit(EXIT_FAILURE); } + if (cpid == \-1) { + perror("fork"); + exit(EXIT_FAILURE); + } if (cpid == 0) { /* Child reads from pipe */ close(pfd[1]); /* Close unused write end */ diff --git a/man2/stat.2 b/man2/stat.2 index cfb157b199..ada80ac18a 100644 --- a/man2/stat.2 +++ b/man2/stat.2 @@ -403,7 +403,7 @@ main(int argc, char *argv[]) exit(EXIT_FAILURE); } - if (stat(argv[1], &sb) == -1) { + if (stat(argv[1], &sb) == \-1) { perror("stat"); exit(EXIT_SUCCESS); } @@ -420,7 +420,7 @@ main(int argc, char *argv[]) default: printf("unknown?\\n"); break; } - printf("I-node number: %ld\\n", (long) sb.st_ino); + printf("I\-node number: %ld\\n", (long) sb.st_ino); printf("Mode: %lo (octal)\\n", (unsigned long) sb.st_mode); diff --git a/man2/sysctl.2 b/man2/sysctl.2 index 8975a83457..48fa4c1a7e 100644 --- a/man2/sysctl.2 +++ b/man2/sysctl.2 @@ -147,7 +147,7 @@ main(void) osnamelth = sizeof(osname); - if (syscall(SYS__sysctl, &args) == -1) { + if (syscall(SYS__sysctl, &args) == \-1) { perror("_sysctl"); exit(EXIT_FAILURE); } diff --git a/man2/tee.2 b/man2/tee.2 index c1c259a65e..48e1f6815d 100644 --- a/man2/tee.2 +++ b/man2/tee.2 @@ -151,7 +151,7 @@ main(int argc, char *argv[]) assert(argc == 2); fd = open(argv[1], O_WRONLY | O_CREAT | O_TRUNC, 0644); - if (fd == -1) { + if (fd == \-1) { perror("open"); exit(EXIT_FAILURE); } @@ -182,7 +182,7 @@ main(int argc, char *argv[]) perror("splice"); break; } - len -= slen; + len \-= slen; } } while (1); diff --git a/man2/wait.2 b/man2/wait.2 index ebc4ba2c43..77946613d2 100644 --- a/man2/wait.2 +++ b/man2/wait.2 @@ -516,11 +516,11 @@ The following shell session demonstrates the use of the program: $ ./a.out & Child PID is 32360 [1] 32359 -$ kill -STOP 32360 +$ kill \-STOP 32360 stopped by signal 19 -$ kill -CONT 32360 +$ kill \-CONT 32360 continued -$ kill -TERM 32360 +$ kill \-TERM 32360 killed by signal 15 [1]+ Done ./a.out $ @@ -537,7 +537,7 @@ main(int argc, char *argv[]) int status; cpid = fork(); - if (cpid == -1) { + if (cpid == \-1) { perror("fork"); exit(EXIT_FAILURE); } @@ -551,7 +551,7 @@ main(int argc, char *argv[]) } else { /* Code executed by parent */ do { w = waitpid(cpid, &status, WUNTRACED | WCONTINUED); - if (w == -1) { + if (w == \-1) { perror("waitpid"); exit(EXIT_FAILURE); } |
