aboutsummaryrefslogtreecommitdiff
path: root/src/or/geoip.c
diff options
context:
space:
mode:
authorAlexander Færøy <ahf@torproject.org>2017-03-08 23:11:42 +0100
committerAlexander Færøy <ahf@torproject.org>2017-03-09 00:10:18 +0100
commit02fc0a5ecfc917e9261596816e926468db976453 (patch)
tree8d8c32a5d77138d12843bbde26302b6d6b16c603 /src/or/geoip.c
parent02ef06516e64c1559b24123d7c7d164b76110c9a (diff)
downloadtor-02fc0a5ecfc917e9261596816e926468db976453.tar.gz
tor-02fc0a5ecfc917e9261596816e926468db976453.zip
Remove fgets() compatbility function and related tests.
This patch removes the `tor_fgets()` wrapper around `fgets(3)` since it is no longer needed. The function was created due to inconsistency between the returned values of `fgets(3)` on different versions of Unix when using `fgets(3)` on non-blocking file descriptors, but with the recent changes in bug #21654 we switch from unbuffered to direct I/O on non-blocking file descriptors in our utility module. We continue to use `fgets(3)` directly in the geoip and dirserv module since this usage is considered safe. This patch also removes the test-case that was created to detect differences in the implementation of `fgets(3)` as well as the changes file since these changes was not included in any releases yet. See: https://bugs.torproject.org/21654
Diffstat (limited to 'src/or/geoip.c')
-rw-r--r--src/or/geoip.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/or/geoip.c b/src/or/geoip.c
index a8dc807c19..74811ea643 100644
--- a/src/or/geoip.c
+++ b/src/or/geoip.c
@@ -346,7 +346,7 @@ geoip_load_file(sa_family_t family, const char *filename)
(family == AF_INET) ? "IPv4" : "IPv6", filename);
while (!feof(f)) {
char buf[512];
- if (tor_fgets(buf, (int)sizeof(buf), f) == NULL)
+ if (fgets(buf, (int)sizeof(buf), f) == NULL)
break;
crypto_digest_add_bytes(geoip_digest_env, buf, strlen(buf));
/* FFFF track full country name. */