Alan Coopersmith
2018-11-18 22:43:42 UTC
Signed-off-by: Alan Coopersmith <***@oracle.com>
---
Xtranslcl.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/Xtranslcl.c b/Xtranslcl.c
index 9eddf37..26b7f63 100644
--- a/Xtranslcl.c
+++ b/Xtranslcl.c
@@ -773,11 +773,12 @@ TRANS(NAMEDOpenPipe)(const char *server_path)
prmsg(1, "NAMEDOpenPipe: Can't open %s\n", server_path);
return(-1);
}
- close(fd);
- if (chmod(server_path, (mode_t)0666) < 0) {
- prmsg(1, "NAMEDOpenPipe: Can't open %s\n", server_path);
+ if (fchmod(fd, (mode_t)0666) < 0) {
+ prmsg(1, "NAMEDOpenPipe: Can't chmod %s\n", server_path);
+ close(fd);
return(-1);
}
+ close(fd);
} else {
prmsg(1, "NAMEDOpenPipe: stat on %s failed\n", server_path);
return(-1);
---
Xtranslcl.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/Xtranslcl.c b/Xtranslcl.c
index 9eddf37..26b7f63 100644
--- a/Xtranslcl.c
+++ b/Xtranslcl.c
@@ -773,11 +773,12 @@ TRANS(NAMEDOpenPipe)(const char *server_path)
prmsg(1, "NAMEDOpenPipe: Can't open %s\n", server_path);
return(-1);
}
- close(fd);
- if (chmod(server_path, (mode_t)0666) < 0) {
- prmsg(1, "NAMEDOpenPipe: Can't open %s\n", server_path);
+ if (fchmod(fd, (mode_t)0666) < 0) {
+ prmsg(1, "NAMEDOpenPipe: Can't chmod %s\n", server_path);
+ close(fd);
return(-1);
}
+ close(fd);
} else {
prmsg(1, "NAMEDOpenPipe: stat on %s failed\n", server_path);
return(-1);
--
2.15.2
_______________________________________________
xorg-***@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: https://lists.x.org/mailman/listinf
2.15.2
_______________________________________________
xorg-***@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: https://lists.x.org/mailman/listinf