* Europagate, 1995
*
* $Log: gipc.c,v $
- * Revision 1.1 1995/03/27 08:24:59 adam
+ * Revision 1.2 1995/03/28 08:03:46 adam
+ * Non-blocking open used when sync is set.
+ *
+ * Revision 1.1 1995/03/27 08:24:59 adam
* New module gip: Gateway IPc module.
* New module gw-db: Gateway hash-db module (user information table).
*
}
else
{
- gip->wfd = open (server, O_WRONLY);
- gip->rfd = open (gip->name, O_RDONLY);
+ gip->wfd = open (server, O_WRONLY|O_NONBLOCK);
+ gip->rfd = open (gip->name, O_RDONLY|O_NONBLOCK);
}
if (gip->rfd == -1)
return -1;
if (gip->wfd == -1)
- return -1;
+ return -2;
+ fcntl (gip->wfd, F_SETFL, ~(O_NONBLOCK|O_APPEND));
+ fcntl (gip->rfd, F_SETFL, ~(O_NONBLOCK|O_APPEND));
return 0;
}
int gipc_close (GIP gip)
{
- close (gip->rfd);
- close (gip->wfd);
+ if (gip->rfd != -1)
+ close (gip->rfd);
+ if (gip->wfd != -1)
+ close (gip->wfd);
return 0;
}