aboutsummaryrefslogtreecommitdiff
path: root/src/or
diff options
context:
space:
mode:
authorRobert Ransom <rransom.8774@gmail.com>2011-07-18 18:12:31 -0700
committerNick Mathewson <nickm@torproject.org>2011-07-19 11:11:34 -0400
commitf021df58246b5cb9b1312e5339f484462ba94b02 (patch)
tree29177ae1f45be33100dbf69e2413e60e8aa1d924 /src/or
parent866a2828bdcb88398ee8332e918e9a9028397156 (diff)
downloadtor-f021df58246b5cb9b1312e5339f484462ba94b02.tar
tor-f021df58246b5cb9b1312e5339f484462ba94b02.tar.gz
Specify text or binary mode in every start_writing_to_stdio_file call
Diffstat (limited to 'src/or')
-rw-r--r--src/or/geoip.c4
-rw-r--r--src/or/rendservice.c6
-rw-r--r--src/or/rephist.c2
3 files changed, 7 insertions, 5 deletions
diff --git a/src/or/geoip.c b/src/or/geoip.c
index c621ea818..c51142c82 100644
--- a/src/or/geoip.c
+++ b/src/or/geoip.c
@@ -976,7 +976,7 @@ geoip_dirreq_stats_write(time_t now)
data_v2 = geoip_get_client_history(GEOIP_CLIENT_NETWORKSTATUS_V2);
data_v3 = geoip_get_client_history(GEOIP_CLIENT_NETWORKSTATUS);
format_iso_time(written, now);
- out = start_writing_to_stdio_file(filename, OPEN_FLAGS_APPEND,
+ out = start_writing_to_stdio_file(filename, OPEN_FLAGS_APPEND | O_TEXT,
0600, &open_file);
if (!out)
goto done;
@@ -1309,7 +1309,7 @@ geoip_entry_stats_write(time_t now)
filename = get_datadir_fname2("stats", "entry-stats");
data = geoip_get_client_history(GEOIP_CLIENT_CONNECT);
format_iso_time(written, now);
- out = start_writing_to_stdio_file(filename, OPEN_FLAGS_APPEND,
+ out = start_writing_to_stdio_file(filename, OPEN_FLAGS_APPEND | O_TEXT,
0600, &open_file);
if (!out)
goto done;
diff --git a/src/or/rendservice.c b/src/or/rendservice.c
index d9a936471..8a0171170 100644
--- a/src/or/rendservice.c
+++ b/src/or/rendservice.c
@@ -635,13 +635,15 @@ rend_service_load_keys(void)
}
/* Prepare client_keys and hostname files. */
- if (!(cfile = start_writing_to_stdio_file(cfname, OPEN_FLAGS_REPLACE,
+ if (!(cfile = start_writing_to_stdio_file(cfname,
+ OPEN_FLAGS_REPLACE | O_TEXT,
0600, &open_cfile))) {
log_warn(LD_CONFIG, "Could not open client_keys file %s",
escaped(cfname));
goto err;
}
- if (!(hfile = start_writing_to_stdio_file(fname, OPEN_FLAGS_REPLACE,
+ if (!(hfile = start_writing_to_stdio_file(fname,
+ OPEN_FLAGS_REPLACE | O_TEXT,
0600, &open_hfile))) {
log_warn(LD_CONFIG, "Could not open hostname file %s", escaped(fname));
goto err;
diff --git a/src/or/rephist.c b/src/or/rephist.c
index b7341f3c0..24447004e 100644
--- a/src/or/rephist.c
+++ b/src/or/rephist.c
@@ -2500,7 +2500,7 @@ rep_hist_buffer_stats_write(time_t now)
if (check_private_dir(statsdir, CPD_CREATE, get_options()->User) < 0)
goto done;
filename = get_datadir_fname2("stats", "buffer-stats");
- out = start_writing_to_stdio_file(filename, OPEN_FLAGS_APPEND,
+ out = start_writing_to_stdio_file(filename, OPEN_FLAGS_APPEND | O_TEXT,
0600, &open_file);
if (!out)
goto done;