Explorar el Código

Fix: errno assignment should be comparison.

Tucker Polomik hace 3 años
padre
commit
a183cc72f0
Se han modificado 1 ficheros con 1 adiciones y 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 there's an error, report it and die */
         if (bytes == -1) {
         if (bytes == -1) {
-            if (errno = EAGAIN)
+            if (errno == EAGAIN)
                 puts("Normally I'd block, but you told me not to");
                 puts("Normally I'd block, but you told me not to");
             else
             else
                 puts("Another read error");
                 puts("Another read error");