aboutsummaryrefslogtreecommitdiff
path: root/init.c
diff options
context:
space:
mode:
authorjames <james@e7ae566f-a301-0410-adde-c780ea21d3b5>2008-07-18 07:15:27 +0000
committerjames <james@e7ae566f-a301-0410-adde-c780ea21d3b5>2008-07-18 07:15:27 +0000
commit6cd276ba3fced973e5006ccabcb51d5734721914 (patch)
tree4e0c3b9f0d2020e983387107457b3731b4650cad /init.c
parentgen_path will no longer silently truncate the generated (diff)
downloadopenvpn-6cd276ba3fced973e5006ccabcb51d5734721914.tar.xz
status_printf function will now set error flag on
output truncation or failure of write() to write the expected number of bytes. Raised STATUS_PRINTF_MAXLEN to 512 (from 256). git-svn-id: http://svn.openvpn.net/projects/openvpn/branches/BETA21/openvpn@3077 e7ae566f-a301-0410-adde-c780ea21d3b5
Diffstat (limited to '')
-rw-r--r--init.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/init.c b/init.c
index 218fae1..61b23e3 100644
--- a/init.c
+++ b/init.c
@@ -439,7 +439,7 @@ init_static (void)
return false;
#endif
-#if 0
+#ifdef GEN_PATH_TEST
{
struct gc_arena gc = gc_new ();
const char *fn = gen_path ("foo",
@@ -448,7 +448,20 @@ init_static (void)
printf ("%s\n", fn);
gc_free (&gc);
}
+ return false;
+#endif
+#ifdef STATUS_PRINTF_TEST
+ {
+ struct gc_arena gc = gc_new ();
+ const char *tmp_file = create_temp_filename ("/tmp", "foo", &gc);
+ struct status_output *so = status_open (tmp_file, 0, -1, NULL, STATUS_OUTPUT_WRITE);
+ status_printf (so, "%s", "foo");
+ status_printf (so, "%s", "bar");
+ if (!status_close (so))
+ msg (M_WARN, "STATUS_PRINTF_TEST: %s: write error", tmp_file);
+ gc_free (&gc);
+ }
return false;
#endif