aboutsummaryrefslogtreecommitdiff
path: root/src/common/util.h
diff options
context:
space:
mode:
authormeejah <meejah@meejah.ca>2012-09-12 13:26:34 -0600
committerNick Mathewson <nickm@torproject.org>2012-09-17 10:02:24 -0400
commitd64bf286a175f590fc07f51f49584cf246eac9b2 (patch)
tree54374a24ab830b07ba7bbb9b2e50c2938fe38349 /src/common/util.h
parent99cb9696ac617a42a78d9ebfa3f169fd8e4a3d88 (diff)
downloadtor-d64bf286a175f590fc07f51f49584cf246eac9b2.tar
tor-d64bf286a175f590fc07f51f49584cf246eac9b2.tar.gz
Handle FIFOs in read_file_to_str
add read_file_to_str_until_eof which is used by read_file_to_str if the file happens to be a FIFO. change file_status() to return FN_FILE if st_mode matches S_IFIFO (on not-windows) so that init_key_from_file() will read from a FIFO.
Diffstat (limited to 'src/common/util.h')
-rw-r--r--src/common/util.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/common/util.h b/src/common/util.h
index a6944ac89..0cfc1b9d8 100644
--- a/src/common/util.h
+++ b/src/common/util.h
@@ -360,6 +360,9 @@ struct stat;
#endif
char *read_file_to_str(const char *filename, int flags, struct stat *stat_out)
ATTR_MALLOC;
+char *read_file_to_str_until_eof(int fd, size_t max_bytes_to_read,
+ size_t *sz_out)
+ ATTR_MALLOC;
const char *parse_config_line_from_str(const char *line,
char **key_out, char **value_out);
char *expand_filename(const char *filename);