Changeset b5cf742a in mainline for uspace/app/nterm/conn.c
- Timestamp:
- 2013-06-28T16:22:42Z (12 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- edf0d27
- Parents:
- e52b4b5
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/nterm/conn.c
re52b4b5 rb5cf742a 103 103 goto error; 104 104 } 105 105 106 106 conn_fd = socket(PF_INET, SOCK_STREAM, 0); 107 107 if (conn_fd < 0) 108 108 goto error; 109 109 110 110 printf("Connecting to host %s port %u\n", addr_s, ntohs(addr.sin_port)); 111 111 112 112 rc = connect(conn_fd, (struct sockaddr *)&addr, sizeof(addr)); 113 113 if (rc != EOK) 114 114 goto error; 115 115 116 116 rcv_fid = fibril_create(rcv_fibril, NULL); 117 117 if (rcv_fid == 0) 118 118 goto error; 119 119 120 120 fibril_add_ready(rcv_fid); 121 121 122 122 return EOK; 123 123 124 124 error: 125 125 if (conn_fd >= 0) { … … 127 127 conn_fd = -1; 128 128 } 129 129 130 130 return EIO; 131 131 } … … 133 133 int conn_send(void *data, size_t size) 134 134 { 135 int rc; 136 137 rc = send(conn_fd, data, size, 0); 135 int rc = send(conn_fd, data, size, 0); 138 136 if (rc != EOK) 139 137 return EIO; 140 138 141 139 return EOK; 142 140 }
Note:
See TracChangeset
for help on using the changeset viewer.