Permalink
Browse files

Merge pull request #698 from oneonestar/master

Remove useless for loop
  • Loading branch information...
2 parents 097c451 + aebc4b5 commit b3bedd4eae7e4f6824766b0e326caaed70c8e03b @sappo sappo committed on GitHub Jun 17, 2017
Showing with 9 additions and 11 deletions.
  1. +9 −11 examples/C/interrupt.c
View
@@ -54,17 +54,15 @@ int main (void)
perror("Creating self-pipe");
exit(1);
}
- for (int i = 0; i < 2; i++) {
- int flags = fcntl(pipefds[0], F_GETFL, 0);
- if (flags < 0) {
- perror ("fcntl(F_GETFL)");
- exit(1);
- }
- rc = fcntl (pipefds[0], F_SETFL, flags | O_NONBLOCK);
- if (rc != 0) {
- perror ("fcntl(F_SETFL)");
- exit(1);
- }
+ int flags = fcntl(pipefds[0], F_GETFL, 0);
+ if (flags < 0) {
+ perror ("fcntl(F_GETFL)");
+ exit(1);
+ }
+ rc = fcntl (pipefds[0], F_SETFL, flags | O_NONBLOCK);
+ if (rc != 0) {
+ perror ("fcntl(F_SETFL)");
+ exit(1);
}
s_catch_signals (pipefds[1]);

0 comments on commit b3bedd4

Please sign in to comment.