Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Consistently use a space in 'if (...)' and 'while (...)'.

  • Loading branch information...
commit 6c5d2316d18fb22688cac97fbda2338020d0e597 1 parent 0274231
@nelhage authored
Showing with 8 additions and 8 deletions.
  1. +2 −2 attach.c
  2. +4 −4 ptrace.c
  3. +2 −2 reptyr.c
View
4 attach.c
@@ -107,7 +107,7 @@ int *get_child_tty_fds(struct ptrace_child *child, int statfd, int *count) {
while ((d = readdir(dir)) != NULL) {
if (d->d_name[0] == '.') continue;
snprintf(buf, sizeof buf, "/proc/%d/fd/%s", child->pid, d->d_name);
- if(stat(buf, &st) < 0)
+ if (stat(buf, &st) < 0)
continue;
if (st.st_rdev == child_status.ctty
@@ -145,7 +145,7 @@ void move_process_group(struct ptrace_child *child, pid_t from, pid_t to) {
return;
while ((d = readdir(dir)) != NULL) {
- if(d->d_name[0] == '.') continue;
+ if (d->d_name[0] == '.') continue;
pid = strtol(d->d_name, &p, 10);
if (*p) continue;
if (getpgid(pid) == from) {
View
8 ptrace.c
@@ -117,7 +117,7 @@ int ptrace_wait(struct ptrace_child *child) {
}
if (WIFEXITED(child->status) || WIFSIGNALED(child->status)) {
child->state = ptrace_exited;
- } else if(WIFSTOPPED(child->status)) {
+ } else if (WIFSTOPPED(child->status)) {
int sig = WSTOPSIG(child->status);
if (sig & 0x80) {
child->state = (child->state == ptrace_at_syscall) ?
@@ -138,7 +138,7 @@ int ptrace_wait(struct ptrace_child *child) {
int ptrace_advance_to_state(struct ptrace_child *child,
enum child_state desired) {
int err;
- while(child->state != desired) {
+ while (child->state != desired) {
switch(desired) {
case ptrace_after_syscall:
case ptrace_at_syscall:
@@ -161,7 +161,7 @@ int ptrace_advance_to_state(struct ptrace_child *child,
}
if (err < 0)
return err;
- if(ptrace_wait(child) < 0)
+ if (ptrace_wait(child) < 0)
return -1;
}
return 0;
@@ -205,7 +205,7 @@ unsigned long ptrace_remote_syscall(struct ptrace_child *child,
offsetof(struct user, regs.r), \
(v)) < 0) \
return -1; \
- } while(0)
+ } while (0)
if (arch_set_syscall(child, sysno) < 0)
return -1;
View
4 reptyr.c
@@ -157,7 +157,7 @@ void check_yama_ptrace_scope(void) {
return;
}
}
- } else if(errno == ENOENT)
+ } else if (errno == ENOENT)
return;
fprintf(stderr, "The kernel denied permission while attaching. If your uid matches\n");
fprintf(stderr, "the target's, check the value of /proc/sys/kernel/yama/ptrace_scope.\n");
@@ -176,7 +176,7 @@ int main(int argc, char **argv) {
usage(argv[0]);
return 2;
}
- if(argv[arg][0] == '-') {
+ if (argv[arg][0] == '-') {
switch(argv[arg][1]) {
case 'h':
usage(argv[0]);
Please sign in to comment.
Something went wrong with that request. Please try again.