Page MenuHomeFreeBSD

D26168.id76136.diff
No OneTemporary

D26168.id76136.diff

Index: sbin/ggate/ggated/ggated.c
===================================================================
--- sbin/ggate/ggated/ggated.c
+++ sbin/ggate/ggated/ggated.c
@@ -349,6 +349,9 @@
flags = O_WRONLY;
else
flags = O_RDWR;
+ if (conn->c_diskfd != -1)
+ return (0);
+
conn->c_diskfd = open(ex->e_path, flags);
if (conn->c_diskfd == -1) {
error = errno;
@@ -452,6 +455,7 @@
free(conn);
return (NULL);
}
+ conn->c_diskfd = -1;
conn->c_token = cinit->gc_token;
ip = htonl(((struct sockaddr_in *)(void *)s)->sin_addr.s_addr);
conn->c_srcip = ip;
@@ -532,8 +536,10 @@
int error, pid;
pid = fork();
- if (pid > 0)
+ if (pid > 0) {
+ close(conn->c_diskfd);
return;
+ }
else if (pid == -1) {
g_gate_log(LOG_ERR, "Cannot fork: %s.", strerror(errno));
return;

File Metadata

Mime Type
text/plain
Expires
Mon, Jan 19, 3:36 PM (10 h, 54 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
27748593
Default Alt Text
D26168.id76136.diff (797 B)

Event Timeline