Changeset 1173 for trunk/src


Ignore:
Timestamp:
Feb 4, 2004, 11:37:02 PM (22 years ago)
Author:
bird
Message:

Initial logging stuff.

Location:
trunk/src/emx/src/libsocket
Files:
30 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/emx/src/libsocket/_getsockhandle.c

    • Property cvs2svn:cvs-rev changed from 1.1 to 1.2
    r1172 r1173  
    3333#include <sys/socket.h>
    3434#include <emx/io.h>
     35#include <emx/libclog.h>
    3536#include "socket.h"
    3637
     
    4546int _getsockhandle(int socket)
    4647{
     48    LIBCLOG_ENTER("socket=%d\n", socket);
    4749    PLIBCSOCKETFH   pFHSocket = __libsocket_FH(socket);
    4850    if (pFHSocket)
    49         return pFHSocket->iSocket;
    50     return -1;
     51        LIBCLOG_RETURN_INT(pFHSocket->iSocket);
     52    LIBCLOG_RETURN_INT(-1);
    5153}
  • trunk/src/emx/src/libsocket/_impsockhandle.c

    • Property cvs2svn:cvs-rev changed from 1.1 to 1.2
    r1172 r1173  
    3434#include <sys/fcntl.h>
    3535#include <emx/io.h>
     36#include <emx/libclog.h>
    3637#include "socket.h"
    3738
     
    4748int _impsockhandle(int os2socket, int flags)
    4849{
     50    LIBCLOG_ENTER("os2socket=%d flags=%#x\n", os2socket, flags);
    4951    PLIBCSOCKETFH   pFH;
    5052    int             iType;
     
    6062    {
    6163        __libsocket_setErrno(EBADF);
    62         return -1;
     64        LIBCLOG_RETURN_INT(-1);
    6365    }
    6466
     
    6870    rc = __libc_FHAllocate(-1, O_RDWR | F_SOCKET, sizeof(LIBCSOCKETFH), &__libsocket_gSocketOps, (PLIBCFH*)&pFH, &fh);
    6971    if (rc)
    70         return -1;
     72        LIBCLOG_RETURN_INT(-1);
    7173    pFH->iSocket = os2socket;
    72     return fh;
     74    LIBCLOG_RETURN_INT(fh);
    7375}
    7476
  • trunk/src/emx/src/libsocket/accept.c

    • Property cvs2svn:cvs-rev changed from 1.2 to 1.3
    r1172 r1173  
    3333#include <sys/fcntl.h>
    3434#include <emx/io.h>
     35#include <emx/libclog.h>
    3536#include "socket.h"
    3637
    3738int accept(int socket, struct sockaddr *addr, int *addrlen)
    3839{
     40    LIBCLOG_ENTER("socket=%d socketaddr=%p addrlen=%p\n",
     41                  socket, addr, addrlen);
    3942    PLIBCSOCKETFH   pFHSocket = __libsocket_FH(socket);
    4043    int             s;
     
    5154            {
    5255                pFH->iSocket = s;
    53                 return fh;
     56                LIBCLOG_RETURN_INT(fh);
    5457            }
    5558            else
     
    6164    }
    6265
    63     return -1;
     66    LIBCLOG_RETURN_INT(-1);
    6467}
    6568
  • trunk/src/emx/src/libsocket/bind.c

    • Property cvs2svn:cvs-rev changed from 1.2 to 1.3
    r1172 r1173  
    3333#include <sys/fcntl.h>
    3434#include <emx/io.h>
     35#include <emx/libclog.h>
    3536#include "socket.h"
    3637
    3738int bind(int socket, const struct sockaddr *addr, int addrlen)
    3839{
     40    LIBCLOG_ENTER("socket=%d addr=%p addrlen=%d\n", socket, addr, addrlen);
    3941    PLIBCSOCKETFH   pFHSocket = __libsocket_FH(socket);
    4042    if (pFHSocket)
     
    4345        rc = __libsocket_bind(pFHSocket->iSocket, addr, addrlen);
    4446        if (rc >= 0)
    45             return rc;
     47            LIBCLOG_RETURN_INT(rc);
    4648        __libsocket_setLibcErrno();
    4749    }
    4850
    49     return -1;
     51    LIBCLOG_RETURN_INT(-1);
    5052}
    5153
  • trunk/src/emx/src/libsocket/connect.c

    • Property cvs2svn:cvs-rev changed from 1.2 to 1.3
    r1172 r1173  
    3333#include <sys/fcntl.h>
    3434#include <emx/io.h>
     35#include <emx/libclog.h>
    3536#include "socket.h"
    3637
    3738int connect(int socket, const struct sockaddr *addr, int addrlen)
    3839{
     40    LIBCLOG_ENTER("socket=%d addr=%p addrlen=%d\n", socket, addr, addrlen);
    3941    PLIBCSOCKETFH   pFHSocket = __libsocket_FH(socket);
    4042    if (pFHSocket)
     
    4345        rc = __libsocket_connect(pFHSocket->iSocket, addr, addrlen);
    4446        if (rc >= 0)
    45             return rc;
     47            LIBCLOG_RETURN_INT(rc);
    4648        __libsocket_setLibcErrno();
    4749    }
    4850
    49     return -1;
     51    LIBCLOG_RETURN_INT(-1);
    5052}
    5153
  • trunk/src/emx/src/libsocket/getpeername.c

    • Property cvs2svn:cvs-rev changed from 1.1 to 1.2
    r1172 r1173  
    3333#include <sys/fcntl.h>
    3434#include <emx/io.h>
     35#include <emx/libclog.h>
    3536#include "socket.h"
    3637
    3738int getpeername(int socket, struct sockaddr *addr, int *addrlen)
    3839{
     40    LIBCLOG_ENTER("socket=%d addr=%p addrlen=%d\n", socket, addr, addrlen);
    3941    PLIBCSOCKETFH   pFHSocket = __libsocket_FH(socket);
    4042    if (pFHSocket)
     
    4345        rc = __libsocket_getpeername(pFHSocket->iSocket, addr, addrlen);
    4446        if (rc >= 0)
    45             return rc;
     47            LIBCLOG_RETURN_INT(rc);
    4648        __libsocket_setLibcErrno();
    4749    }
    4850
    49     return -1;
     51    LIBCLOG_RETURN_INT(-1);
    5052}
    5153
  • trunk/src/emx/src/libsocket/getsockname.c

    • Property cvs2svn:cvs-rev changed from 1.1 to 1.2
    r1172 r1173  
    3333#include <sys/fcntl.h>
    3434#include <emx/io.h>
     35#include <emx/libclog.h>
    3536#include "socket.h"
    3637
    3738int getsockname(int socket, struct sockaddr *addr, int *addrlen)
    3839{
     40    LIBCLOG_ENTER("socket=%d addr=%p addrlen=%d\n", socket, addr, addrlen);
    3941    PLIBCSOCKETFH   pFHSocket = __libsocket_FH(socket);
    4042    if (pFHSocket)
     
    4345        rc = __libsocket_getsockname(pFHSocket->iSocket, addr, addrlen);
    4446        if (rc >= 0)
    45             return rc;
     47            LIBCLOG_RETURN_INT(rc);
    4648        __libsocket_setLibcErrno();
    4749    }
    4850
    49     return -1;
     51    LIBCLOG_RETURN_INT(-1);
    5052}
    5153
  • trunk/src/emx/src/libsocket/getsockopt.c

    • Property cvs2svn:cvs-rev changed from 1.1 to 1.2
    r1172 r1173  
    3333#include <sys/fcntl.h>
    3434#include <emx/io.h>
     35#include <emx/libclog.h>
    3536#include "socket.h"
    3637
    3738int getsockopt(int socket, int level, int optname, void *optval, int *optlen)
    3839{
     40    LIBCLOG_ENTER("socket=%d level=%#x optname=%#x optval=%p optlen=%d\n",
     41                  socket, level, optname, optval, optlen);
    3942    PLIBCSOCKETFH   pFHSocket = __libsocket_FH(socket);
    4043    if (pFHSocket)
     
    4346        rc = __libsocket_getsockopt(pFHSocket->iSocket, level, optname, optval, optlen);
    4447        if (rc >= 0)
    45             return rc;
     48            LIBCLOG_RETURN_INT(rc);
    4649        __libsocket_setLibcErrno();
    4750    }
    4851
    49     return -1;
     52    LIBCLOG_RETURN_INT(-1);
    5053}
    5154
  • trunk/src/emx/src/libsocket/herror.c

    • Property cvs2svn:cvs-rev changed from 1.3 to 1.4
    r1172 r1173  
    99#include <sys/types.h>
    1010#include <netdb.h>
     11#include <emx/libclog.h>
    1112
    1213extern int h_errno;
     
    1415void TCPCALL herror(const char *string)
    1516{
     17  LIBCLOG_ENTER("string=%p={%25s}\n", string, string);
    1618  int e = h_errno;
    1719  const char *msg;
     
    4143    default:
    4244      fprintf (stderr, "Unknown error %d\n", e);
    43       return;
     45      LIBCLOG_RETURN_VOID();
    4446    }
    4547  fputs (msg, stderr);
    4648  fputc ('\n', stderr);
     49  LIBCLOG_RETURN_VOID();
    4750}
  • trunk/src/emx/src/libsocket/listen.c

    • Property cvs2svn:cvs-rev changed from 1.2 to 1.3
    r1172 r1173  
    3333#include <sys/fcntl.h>
    3434#include <emx/io.h>
     35#include <emx/libclog.h>
    3536#include "socket.h"
    3637
    3738int listen(int socket, int backlog)
    3839{
     40    LIBCLOG_ENTER("socket=%d backlog=%d\n", socket, backlog);
    3941    PLIBCSOCKETFH   pFHSocket = __libsocket_FH(socket);
    4042    if (pFHSocket)
     
    4345        rc = __libsocket_listen(pFHSocket->iSocket, backlog);
    4446        if (rc >= 0)
    45             return rc;
     47            LIBCLOG_RETURN_INT(rc);
    4648        __libsocket_setLibcErrno();
    4749    }
    4850
    49     return -1;
     51    LIBCLOG_RETURN_INT(-1);
    5052}
    5153
  • trunk/src/emx/src/libsocket/os2_ioctl.c

    • Property cvs2svn:cvs-rev changed from 1.1 to 1.2
    r1172 r1173  
    3434#include <sys/fcntl.h>
    3535#include <emx/io.h>
     36#include <emx/libclog.h>
    3637#include "socket.h"
    3738
     
    4243#endif
    4344{
     45    LIBCLOG_ENTER("socket=%d request=%#x arg=%p len_arg=%d\n", socket, (int)request, arg, len_arg);
    4446    PLIBCSOCKETFH   pFHSocket = __libsocket_FH(socket);
    4547    if (pFHSocket)
     
    5254#endif
    5355        if (rc >= 0)
    54             return rc;
     56            LIBCLOG_RETURN_INT(rc);
    5557        __libsocket_setLibcErrno();
    5658    }
    57     return -1;
     59    LIBCLOG_RETURN_INT(-1);
    5860}
    5961
  • trunk/src/emx/src/libsocket/os2_select.c

    • Property cvs2svn:cvs-rev changed from 1.1 to 1.2
    r1172 r1173  
    3333#include <sys/fcntl.h>
    3434#include <emx/io.h>
     35#include <emx/libclog.h>
    3536#include "socket.h"
    3637
    3738int os2_select(int *s, int nreads, int nwrites, int nexcepts, long timeout)
    3839{
     40    LIBCLOG_ENTER("s=%p nreads=%d nwrites=%d nexcepts=%d timeout=%ld\n", s, nreads, nwrites, nexcepts, timeout);
    3941    int     cSockets;
    4042    int    *aSockets;
     
    5052    {
    5153        __libsocket_setErrno(ENOMEM);
    52         return -1;
     54        LIBCLOG_RETURN_INT(-1);
    5355    }
    5456    for (i = 0; i < cSockets; i++)
     
    5860        {
    5961            __libsocket_setErrno(EBADF);
    60             return -1;
     62            LIBCLOG_RETURN_INT(-1);
    6163        }
    6264        aSockets[i] = pFHSocket->iSocket;
     
    6870    rc = __libsocket_os2_select(aSockets, nreads, nwrites, nexcepts, timeout);
    6971    if (rc >= 0)
    70         return rc;
     72        LIBCLOG_RETURN_INT(rc);
    7173    __libsocket_setLibcErrno();
    72     return -1;
     74    LIBCLOG_RETURN_INT(-1);
    7375}
    7476
  • trunk/src/emx/src/libsocket/recv.c

    • Property cvs2svn:cvs-rev changed from 1.2 to 1.3
    r1172 r1173  
    3333#include <sys/fcntl.h>
    3434#include <emx/io.h>
     35#include <emx/libclog.h>
    3536#include "socket.h"
    3637
    3738int recv(int socket, void *buf, int len, int flags)
    3839{
     40    LIBCLOG_ENTER("socket=%d buf=%p len=%d flags=%#x\n", socket, buf, len, flags);
    3941    PLIBCSOCKETFH   pFHSocket = __libsocket_FH(socket);
    4042    if (pFHSocket)
     
    4345        rc = __libsocket_recv(pFHSocket->iSocket, buf, len, flags);
    4446        if (rc >= 0)
    45             return rc;
     47            LIBCLOG_RETURN_INT(rc);
    4648        __libsocket_setLibcErrno();
    4749    }
    4850
    49     return -1;
     51    LIBCLOG_RETURN_INT(-1);
    5052}
    5153
  • trunk/src/emx/src/libsocket/recvfrom.c

    • Property cvs2svn:cvs-rev changed from 1.2 to 1.3
    r1172 r1173  
    3333#include <sys/fcntl.h>
    3434#include <emx/io.h>
     35#include <emx/libclog.h>
    3536#include "socket.h"
    3637
    3738int recvfrom(int socket, void *buf, int len, int flags, struct sockaddr *from, int *fromlen)
    3839{
     40    LIBCLOG_ENTER("socket=%d buf=%p len=%d flags=%#x from=%p from=%d\n",
     41                  socket, buf, len, flags, from, fromlen);
    3942    PLIBCSOCKETFH   pFHSocket = __libsocket_FH(socket);
    4043    if (pFHSocket)
     
    4346        rc = __libsocket_recvfrom(pFHSocket->iSocket, buf, len, flags, from, fromlen);
    4447        if (rc >= 0)
    45             return rc;
     48            LIBCLOG_RETURN_INT(rc);
    4649        __libsocket_setLibcErrno();
    4750    }
    4851
    49     return -1;
     52    LIBCLOG_RETURN_INT(-1);
    5053}
    5154
  • trunk/src/emx/src/libsocket/recvmsg.c

    • Property cvs2svn:cvs-rev changed from 1.1 to 1.2
    r1172 r1173  
    3333#include <sys/fcntl.h>
    3434#include <emx/io.h>
     35#include <emx/libclog.h>
    3536#include "socket.h"
    3637
    3738int recvmsg(int socket, struct msghdr *msg, int flags)
    3839{
     40    LIBCLOG_ENTER("socket=%d msg=%p flags=%d\n", socket, msg, flags);
    3941    PLIBCSOCKETFH   pFHSocket = __libsocket_FH(socket);
    4042    if (pFHSocket)
     
    4345        rc = __libsocket_recvmsg(pFHSocket->iSocket, msg, flags);
    4446        if (rc >= 0)
    45             return rc;
     47            LIBCLOG_RETURN_INT(rc);
    4648        __libsocket_setLibcErrno();
    4749    }
    4850
    49     return -1;
     51    LIBCLOG_RETURN_INT(-1);
    5052}
    5153
  • trunk/src/emx/src/libsocket/send.c

    • Property cvs2svn:cvs-rev changed from 1.2 to 1.3
    r1172 r1173  
    3333#include <sys/fcntl.h>
    3434#include <emx/io.h>
     35#include <emx/libclog.h>
    3536#include "socket.h"
    3637
    3738int send(int socket, const void *buf, int len, int flags)
    3839{
     40    LIBCLOG_ENTER("socket=%d buf=%p len=%d flags=%#x\n", socket, buf, len, flags);
    3941    PLIBCSOCKETFH   pFHSocket = __libsocket_FH(socket);
    4042    if (pFHSocket)
     
    4345        rc = __libsocket_send(pFHSocket->iSocket, buf, len, flags);
    4446        if (rc >= 0)
    45             return rc;
     47            LIBCLOG_RETURN_INT(rc);
    4648        __libsocket_setLibcErrno();
    4749    }
    4850
    49     return -1;
     51    LIBCLOG_RETURN_INT(-1);
    5052}
    5153
  • trunk/src/emx/src/libsocket/sendmsg.c

    • Property cvs2svn:cvs-rev changed from 1.1 to 1.2
    r1172 r1173  
    3333#include <sys/fcntl.h>
    3434#include <emx/io.h>
     35#include <emx/libclog.h>
    3536#include "socket.h"
    3637
    3738int sendmsg(int socket, const struct msghdr *msg, int flags)
    3839{
     40    LIBCLOG_ENTER("socket=%d msg=%p flags=%#x\n", socket, msg, flags);
    3941    PLIBCSOCKETFH   pFHSocket = __libsocket_FH(socket);
    4042    if (pFHSocket)
     
    4345        rc = __libsocket_sendmsg(pFHSocket->iSocket, msg, flags);
    4446        if (rc >= 0)
    45             return rc;
     47            LIBCLOG_RETURN_INT(rc);
    4648        __libsocket_setLibcErrno();
    4749    }
    4850
    49     return -1;
     51    LIBCLOG_RETURN_INT(-1);
    5052}
    5153
  • trunk/src/emx/src/libsocket/sendto.c

    • Property cvs2svn:cvs-rev changed from 1.2 to 1.3
    r1172 r1173  
    3333#include <sys/fcntl.h>
    3434#include <emx/io.h>
     35#include <emx/libclog.h>
    3536#include "socket.h"
    3637
    3738int sendto(int socket, const void *buf, int len, int flags, const struct sockaddr *to, int tolen)
    3839{
     40    LIBCLOG_ENTER("socket=%d buf=%p len=%d flags=%#x to=%p tolen=%p\n",
     41                  socket, buf, len, flags, to, tolen);
    3942    PLIBCSOCKETFH   pFHSocket = __libsocket_FH(socket);
    4043    if (pFHSocket)
     
    4346        rc = __libsocket_sendto(pFHSocket->iSocket, buf, len, flags, to, tolen);
    4447        if (rc >= 0)
    45             return rc;
     48            LIBCLOG_RETURN_INT(rc);
    4649        __libsocket_setLibcErrno();
    4750    }
    4851
    49     return -1;
     52    LIBCLOG_RETURN_INT(-1);
    5053}
    5154
  • trunk/src/emx/src/libsocket/setsockopt.c

    • Property cvs2svn:cvs-rev changed from 1.1 to 1.2
    r1172 r1173  
    3333#include <sys/fcntl.h>
    3434#include <emx/io.h>
     35#include <emx/libclog.h>
    3536#include "socket.h"
    3637
    3738int setsockopt(int socket, int level, int optname, const void *optval, int optlen)
    3839{
     40    LIBCLOG_ENTER("socket=%d level=%#x optname=%#x optval=%p optlen=%p\n",
     41                  socket, level, optname, optval, optlen);
    3942    PLIBCSOCKETFH   pFHSocket = __libsocket_FH(socket);
    4043    if (pFHSocket)
     
    4346        rc = __libsocket_setsockopt(pFHSocket->iSocket, level, optname, optval, optlen);
    4447        if (rc >= 0)
    45             return rc;
     48            LIBCLOG_RETURN_INT(rc);
    4649        __libsocket_setLibcErrno();
    4750    }
    4851
    49     return -1;
     52    LIBCLOG_RETURN_INT(-1);
    5053}
    5154
  • trunk/src/emx/src/libsocket/shutdown.c

    • Property cvs2svn:cvs-rev changed from 1.2 to 1.3
    r1172 r1173  
    3333#include <sys/fcntl.h>
    3434#include <emx/io.h>
     35#include <emx/libclog.h>
    3536#include "socket.h"
    3637
    3738int shutdown(int socket, int how)
    3839{
     40    LIBCLOG_ENTER("socket=%d how=%d\n", socket, how);
    3941    PLIBCSOCKETFH   pFHSocket = __libsocket_FH(socket);
    4042    if (pFHSocket)
     
    4345        rc = __libsocket_shutdown(pFHSocket->iSocket, how);
    4446        if (rc >= 0)
    45             return rc;
     47            LIBCLOG_RETURN_INT(rc);
    4648        __libsocket_setLibcErrno();
    4749    }
    4850
    49     return -1;
     51    LIBCLOG_RETURN_INT(-1);
    5052}
    5153
  • trunk/src/emx/src/libsocket/so_cancel.c

    • Property cvs2svn:cvs-rev changed from 1.1 to 1.2
    r1172 r1173  
    3333#include <sys/fcntl.h>
    3434#include <emx/io.h>
     35#include <emx/libclog.h>
    3536#include "socket.h"
    3637
    3738int so_cancel(int socket)
    3839{
     40    LIBCLOG_ENTER("socket=%d\n", socket);
    3941    PLIBCSOCKETFH   pFHSocket = __libsocket_FH(socket);
    4042    if (pFHSocket)
     
    4345        rc = __libsocket_so_cancel(pFHSocket->iSocket);
    4446        if (rc >= 0)
    45             return rc;
     47            LIBCLOG_RETURN_INT(rc);
    4648        __libsocket_setLibcErrno();
    4749    }
    4850
    49     return -1;
     51    LIBCLOG_RETURN_INT(-1);
    5052}
    5153
  • trunk/src/emx/src/libsocket/so_ioctl.c

    • Property cvs2svn:cvs-rev changed from 1.3 to 1.4
    r1172 r1173  
    3535#include <sys/ioccom.h>
    3636#include <emx/io.h>
     37#include <emx/libclog.h>
    3738#include "socket.h"
    3839
    3940int TCPCALL so_ioctl(int socket, unsigned long request, ...)
    4041{
     42    LIBCLOG_ENTER("socket=%d request=%#lx arg=%#lx\n", socket, request, (&request)[1]);
    4143    PLIBCSOCKETFH   pFHSocket = __libsocket_FH(socket);
    4244    if (pFHSocket)
     
    4446        va_list args;
    4547        int     iArg;
     48        int     rc;
    4649        va_start(args, request);
    4750        iArg = va_arg(args, int);
    4851        va_end(args);
    49         return ioctl(socket, request, iArg);
     52        rc = ioctl(socket, request, iArg);
     53        LIBCLOG_RETURN_INT(rc);
    5054    }
    51     return -1;
     55    LIBCLOG_RETURN_INT(-1);
    5256}
    5357
  • trunk/src/emx/src/libsocket/so_readv.c

    • Property cvs2svn:cvs-rev changed from 1.1 to 1.2
    r1172 r1173  
    3333#include <sys/fcntl.h>
    3434#include <emx/io.h>
     35#include <emx/libclog.h>
    3536#include "socket.h"
    3637
    3738ssize_t so_readv(int socket, struct iovec *iov, int iovcnt)
    3839{
     40    LIBCLOG_ENTER("socket=%d iov=%p iovcnt=%d\n", socket, iov, iovcnt);
    3941    PLIBCSOCKETFH   pFHSocket = __libsocket_FH(socket);
    4042    if (pFHSocket)
     
    4345        rc = __libsocket_so_readv(pFHSocket->iSocket, iov, iovcnt);
    4446        if (rc >= 0)
    45             return rc;
     47            LIBCLOG_RETURN_INT(rc);
    4648        __libsocket_setLibcErrno();
    4749    }
    4850
    49     return -1;
     51    LIBCLOG_RETURN_INT(-1);
    5052}
    5153
  • trunk/src/emx/src/libsocket/so_writev.c

    • Property cvs2svn:cvs-rev changed from 1.1 to 1.2
    r1172 r1173  
    3333#include <sys/fcntl.h>
    3434#include <emx/io.h>
     35#include <emx/libclog.h>
    3536#include "socket.h"
    3637
    3738ssize_t so_writev(int socket, struct iovec *iov, int iovcnt)
    3839{
     40    LIBCLOG_ENTER("socket=%d iov=%p iovcnt=%d\n", socket, iov, iovcnt);
    3941    PLIBCSOCKETFH   pFHSocket = __libsocket_FH(socket);
    4042    if (pFHSocket)
     
    4345        rc = __libsocket_so_writev(pFHSocket->iSocket, iov, iovcnt);
    4446        if (rc >= 0)
    45             return rc;
     47            LIBCLOG_RETURN_INT(rc);
    4648        __libsocket_setLibcErrno();
    4749    }
    4850
    49     return -1;
     51    LIBCLOG_RETURN_INT(-1);
    5052}
    5153
  • trunk/src/emx/src/libsocket/soabort.c

    • Property cvs2svn:cvs-rev changed from 1.1 to 1.2
    r1172 r1173  
    3333#include <sys/fcntl.h>
    3434#include <emx/io.h>
     35#include <emx/libclog.h>
    3536#include "socket.h"
    3637
     
    4041int soabort(int socket)
    4142{
     43    LIBCLOG_ENTER("socket=%d\n", socket);
    4244    PLIBCSOCKETFH   pFHSocket = __libsocket_FH(socket);
    4345    if (pFHSocket)
     
    4648        rc = __libsocket_soabort(pFHSocket->iSocket);
    4749        if (rc >= 0)
    48             return rc;
     50            LIBCLOG_RETURN_INT(rc);
    4951        __libsocket_setLibcErrno();
    5052    }
    5153
    52     return -1;
     54    LIBCLOG_RETURN_INT(-1);
    5355}
    5456
  • trunk/src/emx/src/libsocket/sock_errno.c

    • Property cvs2svn:cvs-rev changed from 1.3 to 1.4
    r1172 r1173  
    1818#include <sys/fcntl.h>
    1919#include <emx/io.h>
     20#include <emx/libclog.h>
    2021#include "socket.h"
    2122
     
    3031int _System sock_errno(void)
    3132{
     33    LIBCLOG_ENTER("void\n");
    3234    /* get the OS/2 error. */
    3335    int err = os2_sock_errno();
    3436    if (err > EOS2_TCPIP_OFFSET && err < EOS2_TCPIP_OFFSET + 1000)
    3537        err -= EOS2_TCPIP_OFFSET;
    36     return err;
     38    LIBCLOG_RETURN_INT(err);
    3739}
    3840
  • trunk/src/emx/src/libsocket/socket.c

    • Property cvs2svn:cvs-rev changed from 1.2 to 1.3
    r1172 r1173  
    3333#include <sys/fcntl.h>
    3434#include <emx/io.h>
     35#include <emx/libclog.h>
    3536#include "socket.h"
    3637
     
    3839int socket(int af, int type, int protocol)
    3940{
     41    LIBCLOG_ENTER("af=%d type=%d protocol=%d\n", af, type, protocol);
    4042    int s;
    4143
     
    5052        {
    5153            pFH->iSocket = s;
    52             return fh;
     54            LIBCLOG_RETURN_INT(fh);
    5355        }
    5456        else
     
    5961        __libsocket_setLibcErrno();
    6062
    61     return -1;
     63    LIBCLOG_RETURN_INT(-1);
    6264}
    6365
  • trunk/src/emx/src/libsocket/socketops.c

    • Property cvs2svn:cvs-rev changed from 1.3 to 1.4
    r1172 r1173  
    5050#include <sys/filio.h>
    5151#include <emx/io.h>
     52#include <emx/libclog.h>
    5253#include "socket.h"
    5354
     
    140141static int __libsocket_ops_Close(PLIBCFH pFH, int fh)
    141142{
     143    LIBCLOG_ENTER("pFH=%p fh=%d\n", pFH, fh);
    142144    PLIBCSOCKETFH   pSocketFH = (PLIBCSOCKETFH)pFH;
    143145    int             rc;
    144146    rc = __libsocket_soclose(pSocketFH->iSocket);
    145147    if (rc)
    146         return -__libsocket_getSocketErrno();
    147     return 0;
     148    {
     149        rc = -__libsocket_getSocketErrno();
     150        LIBCLOG_RETURN_INT(rc);
     151    }
     152    LIBCLOG_RETURN_INT(0);
    148153}
    149154
     
    160165static int __libsocket_ops_Read(PLIBCFH pFH, int fh, void *pvBuf, size_t cbRead, size_t *pcbRead)
    161166{
     167    LIBCLOG_ENTER("pFH=%p fh=%d pvBuf=%p cbRead=%d pcbRead=%p\n", pFH, fh, pvBuf, cbRead, pcbRead);
    162168    PLIBCSOCKETFH   pSocketFH = (PLIBCSOCKETFH)pFH;
    163169    int             rc;
     
    167173    {
    168174        *pcbRead = 0;
    169         return -__libsocket_getSocketErrno();
     175        rc = -__libsocket_getSocketErrno();
     176        LIBCLOG_RETURN_INT(rc);
    170177    }
    171178
    172179    *pcbRead = rc;
    173     return 0;
     180    LIBCLOG_RETURN_INT(0);
    174181}
    175182
     
    185192static int __libsocket_ops_Write(PLIBCFH pFH, int fh, const void *pvBuf, size_t cbWrite, size_t *pcbWritten)
    186193{
     194    LIBCLOG_ENTER("pFH=%p fh=%d pvBuf=%p cbWrite=%d pcbWritten=%p\n", pFH, fh, pvBuf, cbWrite, pcbWritten);
    187195    PLIBCSOCKETFH   pSocketFH = (PLIBCSOCKETFH)pFH;
    188196    int             rc;
     
    192200    {
    193201        *pcbWritten = 0;
    194         return -__libsocket_getSocketErrno();
     202        rc = -__libsocket_getSocketErrno();
     203        LIBCLOG_RETURN_INT(rc);
    195204    }
    196205
    197206    *pcbWritten = rc;
    198     return 0;
     207    LIBCLOG_RETURN_INT(0);
    199208}
    200209
     
    213222static int __libsocket_ops_Duplicate(PLIBCFH pFH, int fh, int *pfhNew)
    214223{
    215     return -ENOSYS;
     224    LIBCLOG_ENTER("pFH=%p fh=%d pfhNew=%p\n", pFH, fh, pfhNew);
     225    LIBCLOG_RETURN_INT(-ENOSYS);
    216226}
    217227
     
    230240static int __libsocket_ops_FileControl(PLIBCFH pFH, int fh, int iIOControl, int iArg, int *prc)
    231241{
     242    LIBCLOG_ENTER("pFH=%p fh=%d iIOControl=%#x iArg=%#x prc=%p\n", pFH, fh, iIOControl, iArg, prc);
    232243    /*PLIBCSOCKETFH   pSocketFH = (PLIBCSOCKETFH)pFH;*/
    233     return -ENOSYS;
     244    LIBCLOG_RETURN_INT(-ENOSYS);
    234245}
    235246
     
    248259static int __libsocket_ops_IOControl(PLIBCFH pFH, int fh, int iIOControl, int iArg, int *prc)
    249260{
     261    LIBCLOG_ENTER("pFH=%p fh=%d iIOControl=%#x iArg=%#x prc=%p\n", pFH, fh, iIOControl, iArg, prc);
    250262    PLIBCSOCKETFH   pSocketFH = (PLIBCSOCKETFH)pFH;
    251263    char           *pchArg = (char *)iArg;
     
    521533    {   /*  */
    522534        *prc = -1;
    523         return -ENOSYS;
     535        LIBCLOG_RETURN_INT(-ENOSYS);
    524536    }
    525537
     
    528540    *prc = rc;
    529541    if (rc < 0)
    530         return -__libsocket_getSocketErrno();
    531     return 0;
    532 
    533     return -ENOSYS;
     542    {
     543        rc = -__libsocket_getSocketErrno();
     544        LIBCLOG_RETURN_INT(rc);
     545    }
     546    LIBCLOG_RETURN_INT(0);
    534547}
    535548
     
    551564static int __libsocket_ops_Select(int cFHs, struct fd_set *pRead, struct fd_set *pWrite, struct fd_set *pExcept, struct timeval *tv, int *prc)
    552565{
     566    LIBCLOG_ENTER("cFHs=%d pRead=%p pWrite=%p pExcept=%p tv=%p prc=%d\n",
     567                  cFHs, pRead, pWrite, pExcept, tv, prc);
    553568    int rc;
    554569    int saved_errno = errno;
     
    557572    rc = rc >= 0 ? 0 : -errno;
    558573    errno = saved_errno;
    559     return rc;
    560 }
    561 
     574    LIBCLOG_RETURN_INT(rc);
     575}
     576
  • trunk/src/emx/src/libsocket/socketpair.c

    • Property cvs2svn:cvs-rev changed from 1.2 to 1.3
    r1172 r1173  
    2828#include <sys/fcntl.h>
    2929#include <emx/io.h>
     30#include <emx/libclog.h>
    3031#include "socket.h"
    3132
     
    4445int     TCPCALL socketpair(int af, int type, int flags, int *osfd)
    4546{
     47    LIBCLOG_ENTER("af=%d type=%p flags=%#x osfd=%p\n", af, type, flags, osfd);
    4648#ifdef TCPV40HDRS
    4749    int     rc;
     
    5658    {
    5759        socket(0xfffdadb, type, 0); /*EAFNOSUPPORT;*/
    58         return -1;
     60        LIBCLOG_RETURN_INT(-1);
    5961    }
    6062    if (type != SOCK_STREAM)
    6163    {
    6264        socket(af, 0x1230fd, 0); /*EPROTOTYPE;*/
    63         return -1;
     65        LIBCLOG_RETURN_INT(-1);
    6466    }
    6567
     
    106108    osfd[0] = sock1accept;
    107109    osfd[1] = sock2;
    108     return 0;
     110    LIBCLOG_RETURN_INT(0);
    109111
    110112failure:
     
    115117    if (sock2 >= 0)
    116118        soclose(sock2);
    117     return -1;
     119    LIBCLOG_RETURN_INT(-1);
    118120
    119121#else
     
    127129    {
    128130        __libsocket_setLibcErrno();
    129         return -1;
     131        LIBCLOG_RETURN_INT(-1);
    130132    }
    131133
     
    143145            osfd[0] = fh1;
    144146            osfd[1] = fh2;
    145             return 0;
     147            LIBCLOG_RETURN_INT(0);
    146148        }
    147149        __libc_FHClose(fh1);
     
    150152    __libsocket_soclose(osfd[0]);
    151153    __libsocket_soclose(osfd[1]);
    152     return -1;
     154    LIBCLOG_RETURN_INT(-1);
    153155#endif
    154156}
  • trunk/src/emx/src/libsocket/soclose.c

    • Property cvs2svn:cvs-rev changed from 1.1 to 1.2
    r1172 r1173  
    3333#include <sys/fcntl.h>
    3434#include <emx/io.h>
     35#include <emx/libclog.h>
    3536#include "socket.h"
    3637
    3738int soclose(int socket)
    3839{
     40    LIBCLOG_ENTER("socket=%d\n", socket);
    3941    PLIBCSOCKETFH   pFHSocket = __libsocket_FH(socket);
    4042    if (pFHSocket)
    4143    {
    4244        if (!__libc_FHClose(socket))
    43             return 0;
     45            LIBCLOG_RETURN_INT(0);
    4446        __libsocket_setSocketErrno();
    4547    }
    4648
    47     return -1;
     49    LIBCLOG_RETURN_INT(-1);
    4850}
    4951
Note: See TracChangeset for help on using the changeset viewer.