Commit b07c1369 authored by David Johnson's avatar David Johnson
Browse files

*** empty log message ***

parent 92958dbe
......@@ -12,6 +12,7 @@
#include <netinet/tcp.h>
#include <arpa/inet.h>
#include <sys/socket.h>
#include <string.h>
#include "mtp.h"
......@@ -64,7 +65,9 @@ int main(int argc, char *argv[])
else {
int fd;
#ifndef linux
sin.sin_len = sizeof(sin);
#endif
sin.sin_family = AF_INET;
sin.sin_port = htons(port);
if ((fd = socket(AF_INET, SOCK_STREAM, 0)) == -1) {
......
......@@ -12,6 +12,7 @@
#include <netinet/tcp.h>
#include <arpa/inet.h>
#include <sys/socket.h>
#include <string.h>
#include "mtp.h"
......@@ -32,7 +33,9 @@ int main(int argc, char *argv[])
int on_off = 1;
memset(&sin, 0, sizeof(sin));
#ifndef linux
sin.sin_len = sizeof(sin);
#endif
sin.sin_family = AF_INET;
sin.sin_port = htons(port);
sin.sin_addr.s_addr = INADDR_ANY;
......
......@@ -138,7 +138,9 @@ static int mygethostbyname(struct sockaddr_in *host_addr,
assert(strlen(host) > 0);
memset(host_addr, 0, sizeof(struct sockaddr_in));
#ifndef linux
host_addr->sin_len = sizeof(struct sockaddr_in);
#endif
host_addr->sin_family = AF_INET;
host_addr->sin_port = htons(port);
if( (host_ent = gethostbyname(host)) != NULL ) {
......@@ -170,7 +172,6 @@ static struct gorobot_conn *find_gorobot(int robot_id)
{
struct gorobot_conn *retval = NULL;
int lpc;
assert(robot_id >= 0);
for (lpc = 0; (lpc < rmc_config->num_robots) && !retval; lpc++) {
......
......@@ -253,7 +253,9 @@ int main(int argc, char *argv[])
}
memset(&sin, 0, sizeof(sin));
#ifndef linux
sin.sin_len = sizeof(sin);
#endif
sin.sin_family = AF_INET;
sin.sin_port = htons(port);
sin.sin_addr.s_addr = INADDR_ANY;
......
......@@ -137,7 +137,9 @@ static int mygethostbyname(struct sockaddr_in *host_addr,
assert(strlen(host) > 0);
memset(host_addr, 0, sizeof(struct sockaddr_in));
#ifndef linux
host_addr->sin_len = sizeof(struct sockaddr_in);
#endif
host_addr->sin_family = AF_INET;
host_addr->sin_port = htons(port);
if( (host_ent = gethostbyname(host)) != NULL ) {
......@@ -234,7 +236,9 @@ static int parse_client_options(int *argcp, char **argvp[])
*argcp = argc + 1;
*argvp = argv - 1;
#ifndef linux
optreset = 1;
#endif
optind = 1;
return retval;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment