Explorar o código

Merge pull request #75 from tuckerpo/fix/errno_assignment

Fix: errno assignment should be comparison.
Jim Huang %!s(int64=3) %!d(string=hai) anos
pai
achega
c97348d2d5
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      examples/other/cat_nonblock.c

+ 1 - 1
examples/other/cat_nonblock.c

@@ -39,7 +39,7 @@ int main(int argc, char *argv[])
 
         /* If there's an error, report it and die */
         if (bytes == -1) {
-            if (errno = EAGAIN)
+            if (errno == EAGAIN)
                 puts("Normally I'd block, but you told me not to");
             else
                 puts("Another read error");