Compatibility with OSX
This commit is contained in:
parent
6ccbbdcb5e
commit
da47258fa6
@ -42,6 +42,7 @@ int main(int argc, char *argv[])
|
||||
{ NULL, 0, NULL, 0 }
|
||||
};
|
||||
|
||||
int sockfd = 0;
|
||||
int port = 10800; // Default port
|
||||
uint32_t address = INADDR_ANY; // Default listen address
|
||||
|
||||
@ -92,7 +93,7 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
|
||||
// Establish the socket
|
||||
int sockfd = socket(AF_INET, SOCK_STREAM, 0);
|
||||
sockfd = socket(AF_INET, SOCK_STREAM, 0);
|
||||
if(sockfd == -1){
|
||||
fprintf(stderr, "%s: cannot open socket - %s\n",
|
||||
exec_name, strerror(errno)
|
||||
@ -191,7 +192,7 @@ int main(int argc, char *argv[])
|
||||
// to create a filename
|
||||
char fnbuff[50];
|
||||
snprintf(&fnbuff[0], 50, "%s.%ld-%s.dat",
|
||||
timebuff, tvtime.tv_usec,
|
||||
timebuff, (long)tvtime.tv_usec,
|
||||
inet_ntoa(client.sin_addr)
|
||||
);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user