Home My Page Projects Code Snippets Project Openings SML/NJ
Summary Activity Forums Tracker Lists Tasks Docs Surveys News SCM Files

SCM Repository

[smlnj] Diff of /sml/trunk/src/runtime/c-libs/smlnj-sockets/getpeername.c
ViewVC logotype

Diff of /sml/trunk/src/runtime/c-libs/smlnj-sockets/getpeername.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 740, Mon Nov 27 14:32:11 2000 UTC revision 741, Mon Nov 27 14:35:47 2000 UTC
# Line 19  Line 19 
19   */   */
20  ml_val_t _ml_Sock_getpeername (ml_state_t *msp, ml_val_t arg)  ml_val_t _ml_Sock_getpeername (ml_state_t *msp, ml_val_t arg)
21  {  {
22      char            data[MAX_SOCK_ADDR_SZB];      char            addr[MAX_SOCK_ADDR_SZB];
23      struct sockaddr *addr;      int             addrLen = MAX_SOCK_ADDR_SZB;
     int             addrLen;  
24    
25      addr = (struct sockaddr *)data;      if (getpeername (INT_MLtoC(arg), (struct sockaddr *)addr, &addrLen) < 0)
     addrLen = MAX_SOCK_ADDR_SZB;  
     if (getpeername (INT_MLtoC(arg), addr, &addrLen) < 0)  
26          return RAISE_SYSERR(msp, sts);          return RAISE_SYSERR(msp, sts);
27      else {      else {
         ml_val_t        af = ML_SysConst (msp, &_Sock_AddrFamily,  
                                 ntohs(addr->sa_family));  
28          ml_val_t        cdata = ML_CData(msp, addr, addrLen);          ml_val_t        cdata = ML_CData(msp, addr, addrLen);
29          ml_val_t        addr, res;          ml_val_t        res;
30    
31          SEQHDR_ALLOC (msp, addr, DESC_word8vec, cdata, addrLen);          SEQHDR_ALLOC (msp, res, DESC_word8vec, cdata, addrLen);
         REC_ALLOC2 (msp, res, af, addr);  
32          return res;          return res;
33      }      }
34    

Legend:
Removed from v.740  
changed lines
  Added in v.741

root@smlnj-gforge.cs.uchicago.edu
ViewVC Help
Powered by ViewVC 1.0.0