aboutsummaryrefslogtreecommitdiffstats
path: root/daemon.c
diff options
context:
space:
mode:
Diffstat (limited to 'daemon.c')
-rw-r--r--daemon.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/daemon.c b/daemon.c
index c588ae47..db6ee78b 100644
--- a/daemon.c
+++ b/daemon.c
@@ -205,4 +205,16 @@ nottyDetach:
return(0);
}
+flag isafile(int fd)
+/* is the given fd attached to a file? (used to control logging) */
+{
+ struct stat stbuf;
+
+ if (fstat(fd, &stbuf))
+ return(0);
+ else if (stbuf.st_mode & (S_IFREG | S_IFBLK))
+ return(1);
+ return(0);
+}
+
/* daemon.c ends here */