Ignore:
Timestamp:
12/29/12 10:03:12 (11 years ago)
Author:
István Váradi <ivaradi@…>
Branch:
default
Phase:
public
Message:

Moved the storage of the error code to where it belongs

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/xplcommon/posix/WritingBuffer.cc

    r6 r14  
    3434#include "BufferedWaitable.h"
    3535
    36 #include <cerrno>
    37 
    3836#include <poll.h>
    3937
     
    6664    ssize_t result = waitable.write(getData() + offset, toWrite);
    6765    if (result<static_cast<ssize_t>(toWrite)) {
    68         if (result>=0 || errno==EAGAIN || errno==EWOULDBLOCK) {
     66        if (result<0 && waitable.failed()) {
     67            waitable.events &= ~POLLOUT;
     68        } else {
    6969            waitable.events |= POLLOUT;
    7070            if (result>0) offset += result;
    71         } else {
    72             waitable.events &= ~POLLOUT;
    73             setErrorCode(errno);
    7471        }
    7572        return false;
Note: See TracChangeset for help on using the changeset viewer.