Revision: 78047
          http://sourceforge.net/p/brlcad/code/78047
Author:   brlcad
Date:     2021-01-06 23:33:22 +0000 (Wed, 06 Jan 2021)
Log Message:
-----------
we reopen file descriptors, so really shouldn't be using the numbers direct.

Modified Paths:
--------------
    brlcad/trunk/src/util/bwmod.c

Modified: brlcad/trunk/src/util/bwmod.c
===================================================================
--- brlcad/trunk/src/util/bwmod.c       2021-01-06 23:32:34 UTC (rev 78046)
+++ brlcad/trunk/src/util/bwmod.c       2021-01-06 23:33:22 UTC (rev 78047)
@@ -387,7 +387,7 @@
        mk_trans_tbl();
     }
 
-    while ((n = read(0, (void *)ibuf, (unsigned)sizeof(ibuf))) > 0) {
+    while ((n = read(fileno(stdin), (void *)ibuf, (unsigned)sizeof(ibuf))) > 
0) {
        /* translate */
        for (p = ibuf, q = &ibuf[n]; p < q; ++p) {
            long i = *p;
@@ -410,7 +410,7 @@
            }
        }
        /* output */
-       if (write(1, (void *)ibuf, (unsigned)n) != n) {
+       if (write(fileno(stdout), (void *)ibuf, (unsigned)n) != n) {
            fprintf(stderr, "%s: Error writing stdout\n",
                    progname);
            bu_exit(-1, NULL);

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.



_______________________________________________
BRL-CAD Source Commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/brlcad-commits

Reply via email to