From: Adam Dickmeiss Date: Tue, 28 Mar 1995 08:03:46 +0000 (+0000) Subject: Non-blocking open used when sync is set. X-Git-Url: http://lists.indexdata.dk/?a=commitdiff_plain;h=3749ca718a7b68dd7ea1bbbedc96be948f049a0e;p=egate.git Non-blocking open used when sync is set. --- diff --git a/util/gipc.c b/util/gipc.c index 8116745..bd224d0 100644 --- a/util/gipc.c +++ b/util/gipc.c @@ -2,7 +2,10 @@ * 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). * @@ -36,19 +39,23 @@ int gipc_open (GIP gip, const char *server, int sync) } 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; }