Changeset f48b637 in mainline


Ignore:
Timestamp:
2011-06-14T16:05:02Z (13 years ago)
Author:
Jiří Zárevúcky <zarevucky.jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
0ffbed9
Parents:
60e3e85
Message:

Fix write bug in the preprocessor

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/app/pcc/cc/cpp/cpp.c

    r60e3e85 rf48b637  
    17081708}
    17091709
     1710ssize_t
     1711write_all(int fd, const void* buffer, size_t count)
     1712{
     1713        size_t remaining = count;
     1714        while (remaining > 0) {
     1715                ssize_t retval = write(ofd, buffer, remaining);
     1716                if (retval < 0) {
     1717                        return retval;
     1718                }
     1719                remaining -= retval;
     1720                buffer += retval;
     1721        }
     1722        return count;
     1723}
     1724
    17101725void
    17111726flbuf()
     
    17131728        if (obufp == 0)
    17141729                return;
    1715         if (Mflag == 0 && write(ofd, outbuf, obufp) < 0)
     1730        if (Mflag == 0 && write_all(ofd, outbuf, obufp) < 0)
    17161731                error("obuf write error");
    17171732        lastoch = outbuf[obufp-1];
Note: See TracChangeset for help on using the changeset viewer.