Compatibility with OSX

This commit is contained in:
Christopher Ramey 2015-03-05 20:54:45 +00:00 committed by cdramey
parent 6ccbbdcb5e
commit da47258fa6

View File

@ -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)
);