Mass reformat
This commit is contained in:
parent
4d27def35e
commit
df11e34235
27 changed files with 121 additions and 136 deletions
8
sock.c
8
sock.c
|
|
@ -29,8 +29,7 @@ int main(void) {
|
|||
};
|
||||
|
||||
// Bind socket
|
||||
if (bind(server_fd, (struct sockaddr *)&server_addr, sizeof(server_addr)) <
|
||||
0) {
|
||||
if (bind(server_fd, (struct sockaddr *)&server_addr, sizeof(server_addr)) < 0) {
|
||||
perror("bind failed");
|
||||
close(server_fd);
|
||||
return EXIT_FAILURE;
|
||||
|
|
@ -47,9 +46,8 @@ int main(void) {
|
|||
|
||||
// Accept one client connection
|
||||
struct sockaddr_in client_addr;
|
||||
socklen_t client_len = sizeof(client_addr);
|
||||
int client_fd =
|
||||
accept(server_fd, (struct sockaddr *)&client_addr, &client_len);
|
||||
socklen_t client_len = sizeof(client_addr);
|
||||
int client_fd = accept(server_fd, (struct sockaddr *)&client_addr, &client_len);
|
||||
if (client_fd < 0) {
|
||||
perror("accept failed");
|
||||
close(server_fd);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue