projects
/
egate.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
e5ac7ae
)
Non-blocking open used when sync is set.
author
Adam Dickmeiss
<adam@indexdata.dk>
Tue, 28 Mar 1995 08:03:46 +0000
(08:03 +0000)
committer
Adam Dickmeiss
<adam@indexdata.dk>
Tue, 28 Mar 1995 08:03:46 +0000
(08:03 +0000)
util/gipc.c
patch
|
blob
|
history
diff --git
a/util/gipc.c
b/util/gipc.c
index
8116745
..
bd224d0
100644
(file)
--- a/
util/gipc.c
+++ b/
util/gipc.c
@@
-2,7
+2,10
@@
* Europagate, 1995
*
* $Log: gipc.c,v $
* 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).
*
* 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
{
}
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)
}
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)
{
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;
}
return 0;
}