aboutsummaryrefslogtreecommitdiffstats
path: root/daemon.c
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>2000-07-02 18:25:50 +0000
committerEric S. Raymond <esr@thyrsus.com>2000-07-02 18:25:50 +0000
commitd8539b4e42699b69ca0ea2742239fa0ba34b245a (patch)
tree770f7971dda1ea0281ef2bf4331aa261fe6ad725 /daemon.c
parent571ff3b860a1031836739f219e031ccb358ff4ba (diff)
downloadfetchmail-d8539b4e42699b69ca0ea2742239fa0ba34b245a.tar.gz
fetchmail-d8539b4e42699b69ca0ea2742239fa0ba34b245a.tar.bz2
fetchmail-d8539b4e42699b69ca0ea2742239fa0ba34b245a.zip
Better OpenSSL support.
svn path=/trunk/; revision=2924
Diffstat (limited to 'daemon.c')
-rw-r--r--daemon.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/daemon.c b/daemon.c
index db6ee78b..64b1c90d 100644
--- a/daemon.c
+++ b/daemon.c
@@ -210,9 +210,14 @@ flag isafile(int fd)
{
struct stat stbuf;
- if (fstat(fd, &stbuf))
+ /*
+ * We'd like just to return 1 on (S_IFREG | S_IFBLK),
+ * but weirdly enough, Linux ptys seem to have S_IFBLK
+ * so this test would fail when run on an xterm.
+ */
+ if (isatty(fd) || fstat(fd, &stbuf))
return(0);
- else if (stbuf.st_mode & (S_IFREG | S_IFBLK))
+ else if (stbuf.st_mode & (S_IFREG))
return(1);
return(0);
}