Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/Cldeetr.c
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ int main(int argc, char *argv[])
strcpy(Ename, if_data.ifc_req[0].ifr_name);

flags = fcntl(ether_fd, F_GETFL, 0);
flags = fcntl(ether_fd, F_SETFL, flags | FASYNC | FNDELAY);
fcntl(ether_fd, F_SETFL, flags | FASYNC | FNDELAY);

#ifdef DEBUG
printf("init_ether: **** Ethernet starts ****\n");
Expand Down
5 changes: 1 addition & 4 deletions src/chardev.c
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,6 @@ LispPTR CHAR_openfile(LispPTR *args)
#ifndef DOS
register int fd; /* return value of open system call. */
register int flags; /* open system call's argument */
register int rval;
struct stat statbuf;
char pathname[MAXPATHLEN];

Expand All @@ -104,9 +103,7 @@ LispPTR CHAR_openfile(LispPTR *args)
}
/* Prevent I/O requests from blocking -- make them error */
/* if no char is available, or there's no room in pipe. */
rval = fcntl(fd, F_GETFL, 0);
rval |= FNDELAY;
rval = fcntl(fd, F_SETFL, rval);
fcntl(fd, F_SETFL, fcntl(fd, F_GETFL, 0) | FNDELAY);

return (GetSmallp(fd));
#endif /* DOS */
Expand Down
2 changes: 1 addition & 1 deletion src/ether.c
Original file line number Diff line number Diff line change
Expand Up @@ -823,7 +823,7 @@ void init_ether() {
}

flags = fcntl(ether_fd, F_GETFL, 0);
flags = fcntl(ether_fd, F_SETFL, flags | O_NDELAY);
fcntl(ether_fd, F_SETFL, flags | O_NDELAY);

} else {
I_Give_Up:
Expand Down
4 changes: 2 additions & 2 deletions src/ldeether.c
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ int main(int argc, char *argv[]) {
}

flags = fcntl(ether_fd, F_GETFL, 0);
flags = fcntl(ether_fd, F_SETFL, flags | O_NDELAY);
fcntl(ether_fd, F_SETFL, flags | O_NDELAY);

#else
/* N O T D L P I C O D E */
Expand Down Expand Up @@ -211,7 +211,7 @@ int main(int argc, char *argv[]) {
strcpy(Ename, if_data.ifc_req[0].ifr_name);

flags = fcntl(ether_fd, F_GETFL, 0);
flags = fcntl(ether_fd, F_SETFL, flags | FASYNC | FNDELAY);
fcntl(ether_fd, F_SETFL, flags | FASYNC | FNDELAY);

#endif /* USE_DLPI */
#ifdef DEBUG
Expand Down
2 changes: 1 addition & 1 deletion src/oldeether.c
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ int main(int argc, char *argv[])
strcpy(Ename, if_data.ifc_req[0].ifr_name);

flags = fcntl(ether_fd, F_GETFL, 0);
flags = fcntl(ether_fd, F_SETFL, flags | FASYNC | FNDELAY);
fcntl(ether_fd, F_SETFL, flags | FASYNC | FNDELAY);

#ifdef DEBUG
printf("init_ether: **** Ethernet starts ****\n");
Expand Down
2 changes: 1 addition & 1 deletion src/osmsg.c
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ void mess_init() {
#ifdef LOGINT
LogFileFd = cons_pty; /* was kept as an fd_set, but doesn't need to be */
flags = fcntl(cons_pty, F_GETFL, 0);
flags = fcntl(cons_pty, F_SETFL, (flags | FASYNC | FNDELAY));
fcntl(cons_pty, F_SETFL, (flags | FASYNC | FNDELAY));
if (fcntl(cons_pty, F_SETOWN, getpid()) == -1) {
#ifdef DEBUG
perror("fcntl F_SETOWN of log PTY");
Expand Down
21 changes: 10 additions & 11 deletions src/unixcomm.c
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,7 @@ int FindAvailablePty(char *Master, char *Slave) {
flags = fcntl(res, F_GETFL, 0);
flags |= FNDELAY;

flags = fcntl(res, F_SETFL, flags);
fcntl(res, F_SETFL, flags);
return (res);
}
#ifndef FULLSLAVENAME
Expand Down Expand Up @@ -452,8 +452,7 @@ LispPTR Unix_handlecomm(LispPTR *args) {
}
res = fcntl(PipeFD, F_GETFL, 0);
res |= FNDELAY;
res = fcntl(PipeFD, F_SETFL, res);
if (res < 0) {
if (fcntl(PipeFD, F_SETFL, res) == -1) {
perror("setting up fifo to nodelay");
return (NIL);
}
Expand Down Expand Up @@ -615,7 +614,7 @@ LispPTR Unix_handlecomm(LispPTR *args) {
case 11: /* Fork PTY process */
{
char MasterFD[20], SlavePTY[32];
int Master, res, slot;
int Master, flags, slot;
unsigned short len;

Master = FindAvailablePty(MasterFD, SlavePTY);
Expand Down Expand Up @@ -651,9 +650,9 @@ LispPTR Unix_handlecomm(LispPTR *args) {
DBPRINT(("Pipe/fork result = %d.\n", d[3]));
if (d[3] == 1) {
/* Set up the IO not to block */
res = fcntl(Master, F_GETFL, 0);
res |= FNDELAY;
res = fcntl(Master, F_SETFL, res);
flags = fcntl(Master, F_GETFL, 0);
flags |= FNDELAY;
fcntl(Master, F_SETFL, flags);

UJ[slot].type = UJSHELL; /* so we can find them */
UJ[slot].PID = (d[1] << 8) | d[2];
Expand Down Expand Up @@ -833,7 +832,7 @@ LispPTR Unix_handlecomm(LispPTR *args) {
case 12: /* create Unix socket */

{
int res, sockFD;
int flags, sockFD;
struct sockaddr_un sock;

/* First open the socket */
Expand Down Expand Up @@ -862,9 +861,9 @@ LispPTR Unix_handlecomm(LispPTR *args) {
DBPRINT(("Socket %d bound to name %s.\n", sockFD, shcom));
if (listen(sockFD, 1) < 0) perror("Listen");
/* Set up the IO not to block */
res = fcntl(sockFD, F_GETFL, 0);
res |= FNDELAY;
res = fcntl(sockFD, F_SETFL, res);
flags = fcntl(sockFD, F_GETFL, 0);
flags |= FNDELAY;
fcntl(sockFD, F_SETFL, flags);

/* things seem sane, fill out the rest of the UJ slot and return */
UJ[sockFD].status = -1;
Expand Down
8 changes: 4 additions & 4 deletions src/unixfork.c
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ of the packet received except:
int fork_Unix() {
int LispToUnix[2], /* Incoming pipe from LISP */
UnixToLisp[2], /* Outgoing pipe to LISP */
UnixPID, LispPipeIn, LispPipeOut, res, slot;
UnixPID, LispPipeIn, LispPipeOut, flags, slot;
pid_t pid;

char IOBuf[4];
Expand Down Expand Up @@ -292,9 +292,9 @@ int fork_Unix() {
close(LispToUnix[1]);
close(UnixToLisp[0]);

res = fcntl(LispPipeIn, F_GETFL, 0);
res &= (65535 - FNDELAY);
res = fcntl(LispPipeIn, F_SETFL, res);
flags = fcntl(LispPipeIn, F_GETFL, 0);
flags &= (65535 - FNDELAY);
fcntl(LispPipeIn, F_SETFL, flags);

while (1) {
ssize_t len;
Expand Down