aboutsummaryrefslogtreecommitdiffstats
path: root/util/iobuf.c
diff options
context:
space:
mode:
authorWerner Koch <[email protected]>2004-10-13 18:08:39 +0000
committerWerner Koch <[email protected]>2004-10-13 18:08:39 +0000
commit161286635cfa84e661aaa55932bb811f272a5695 (patch)
treee9b49d152be94e6a2847ec303feab62880193955 /util/iobuf.c
parent* pkclist.c (do_edit_ownertrust): Different prompt when we're using direct (diff)
downloadgnupg-161286635cfa84e661aaa55932bb811f272a5695.tar.gz
gnupg-161286635cfa84e661aaa55932bb811f272a5695.zip
* configure.ac: Actually name the option --disable-finger and not
http. Add option --enable-selinux-support. * logger.c (g10_log_error_f, g10_log_fatal_f, g10_log_info_f) (g10_log_debug_f, print_prefix_f): Removed. * iobuf.c (iobuf_is_pipe_filename): New. (iobuf_get_fd): New.
Diffstat (limited to '')
-rw-r--r--util/iobuf.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/util/iobuf.c b/util/iobuf.c
index 26cde114f..3b1fe8636 100644
--- a/util/iobuf.c
+++ b/util/iobuf.c
@@ -1850,6 +1850,28 @@ iobuf_get_filelength( IOBUF a )
return 0;
}
+
+/* Return the file descriptor of the underlying file or -1 if it is
+ not available. */
+int
+iobuf_get_fd (IOBUF a)
+{
+ if (a->directfp)
+ return a->directfp? fileno(a->directfp) : -1;
+
+ for ( ; a; a = a->chain )
+ if (!a->chain && a->filter == file_filter)
+ {
+ file_filter_ctx_t *b = a->filter_ov;
+ FILEP_OR_FD fp = b->fp;
+
+ return my_fileno (fp);
+ }
+
+ return -1;
+}
+
+
/****************
* Tell the file position, where the next read will take place
*/