summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Coopersmith <alan.coopersmith@oracle.com>2013-04-21 14:01:12 -0700
committerAlan Coopersmith <alan.coopersmith@oracle.com>2013-04-21 14:02:35 -0700
commitba74b1a1dfa5d3411817e0c436b378945c410ec7 (patch)
tree12adc5518c97957c1f9fdb319e25db40474f3ed4
parent73be08929d1d418370ae235e5261e64f72054cbf (diff)
Use fstat() on the fd from open(), instead of stat() on the same pathname
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
-rw-r--r--xconsole.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/xconsole.c b/xconsole.c
index 67e81aa..f7edac9 100644
--- a/xconsole.c
+++ b/xconsole.c
@@ -288,8 +288,7 @@ OpenConsole(void)
if (input) {
struct stat sbuf;
- if (!stat(app_resources.file, &sbuf) &&
- S_ISREG( sbuf.st_mode ) )
+ if ((fstat(fd, &sbuf) == 0) && S_ISREG(sbuf.st_mode))
regularFile = TRUE;
}
else