diff options
author | Alan Coopersmith <alan.coopersmith@oracle.com> | 2013-04-21 14:01:12 -0700 |
---|---|---|
committer | Alan Coopersmith <alan.coopersmith@oracle.com> | 2013-04-21 14:02:35 -0700 |
commit | ba74b1a1dfa5d3411817e0c436b378945c410ec7 (patch) | |
tree | 12adc5518c97957c1f9fdb319e25db40474f3ed4 | |
parent | 73be08929d1d418370ae235e5261e64f72054cbf (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.c | 3 |
1 files changed, 1 insertions, 2 deletions
@@ -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 |