Changeset 14:3caa1d3122db in xplcommon for src/xplcommon/posix/Socket.cc


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/Socket.cc

    r6 r14  
    3232#include "Socket.h"
    3333
    34 #include <cstdio>
    35 
    3634#include <unistd.h>
    3735#include <sys/socket.h>
     
    4543int Socket::socket(int domain, int type, int protocol)
    4644{
    47     int fd = ::socket(domain, type, protocol);
    48     if (fd<0) {
    49         perror("xplcommon::posix::Socket::socket: socket");
    50     }
    51     return fd;
     45    return ::socket(domain, type, protocol);
    5246}
    5347
     
    5650Socket::~Socket()
    5751{
    58     ::close(fd);
     52    if (fd>=0) ::close(fd);
    5953}
    6054
Note: See TracChangeset for help on using the changeset viewer.