Advertisement
Guest User

Untitled

a guest
Apr 21st, 2018
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.46 KB | None | 0 0
  1. --- a.c 2018-04-21 14:14:59.246666844 +0300
  2. +++ b.c 2018-04-21 14:16:11.146666867 +0300
  3. @@ -57,11 +57,12 @@
  4. fds[mode] = open(argv[mode + 1], O_RDONLY);
  5. }
  6. if (fds[mode] == -2) {
  7. + mode = -1;
  8. continue;
  9. }
  10. u8 buf[16];
  11. isize rd = read(fds[mode], &buf, 16);
  12. - if (rd == -1) {
  13. + if (rd <= 0) {
  14. fds[mode] = -2;
  15. mode = -1;
  16. continue;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement