Change file properties to not execute, move socket creatio after sync

in a2pid.c
This commit is contained in:
David Schmenk 2013-06-20 10:13:53 -07:00
parent 474ad076c3
commit c27596aac7
9 changed files with 17 additions and 17 deletions

0
src/A2PI.PO Executable file → Normal file
View File

2
src/Makefile Executable file → Normal file
View File

@ -1,4 +1,4 @@
BIN=a2pid a2mon dskread dskwrite bintomon
BIN=a2serclk a2pid a2mon dskread dskwrite bintomon
all: $(BIN)

0
src/a2lib.c Executable file → Normal file
View File

0
src/a2mon.c Executable file → Normal file
View File

32
src/a2pid.c Executable file → Normal file
View File

@ -662,22 +662,6 @@ void main(int argc, char **argv)
evrely.type = EV_REL;
evrely.code = REL_Y;
evsync.type = EV_SYN;
/*
* Open socket.
*/
prlog("a2pid: Open server socket\n");
bzero(&servaddr, sizeof(servaddr));
servaddr.sin_family = AF_INET;
servaddr.sin_port = htons(6502);
servaddr.sin_addr.s_addr = htonl(INADDR_ANY);
srvfd = socket(PF_INET, SOCK_STREAM, IPPROTO_TCP);
if (srvfd < 0)
die("error: socket create");
if (bind(srvfd,(struct sockaddr *)&servaddr, sizeof(servaddr)) < 0)
die("error: bind socket");
if (listen(srvfd, 1) < 0)
die("error: listen socket");
reqfd = 0;
/*
* Open serial port.
*/
@ -720,6 +704,22 @@ void main(int argc, char **argv)
}
newtio.c_cc[VMIN] = 3; /* blocking read until 3 chars received */
tcsetattr(a2fd, TCSANOW, &newtio);
/*
* Open socket.
*/
prlog("a2pid: Open server socket\n");
bzero(&servaddr, sizeof(servaddr));
servaddr.sin_family = AF_INET;
servaddr.sin_port = htons(6502);
servaddr.sin_addr.s_addr = htonl(INADDR_ANY);
srvfd = socket(PF_INET, SOCK_STREAM, IPPROTO_TCP);
if (srvfd < 0)
die("error: socket create");
if (bind(srvfd,(struct sockaddr *)&servaddr, sizeof(servaddr)) < 0)
die("error: bind socket");
if (listen(srvfd, 1) < 0)
die("error: listen socket");
reqfd = 0;
FD_ZERO(&openset);
FD_SET(a2fd, &openset);
FD_SET(srvfd, &openset);

0
src/a2slideshow.mon Executable file → Normal file
View File

0
src/bintomon.c Executable file → Normal file
View File

0
src/dskread.c Executable file → Normal file
View File

0
src/dskwrite.c Executable file → Normal file
View File