From a5584c6b575b6239d048b5adb260068a6783dbad Mon Sep 17 00:00:00 2001 From: TingPing Date: Sat, 28 Feb 2015 06:42:20 -0500 Subject: Clean up some ifdefs Thankfully somebody already made a define for this, they just never used it... --- src/common/text.c | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) (limited to 'src/common/text.c') diff --git a/src/common/text.c b/src/common/text.c index ae18b8e6..e8243833 100644 --- a/src/common/text.c +++ b/src/common/text.c @@ -176,11 +176,7 @@ scrollback_shrink (session *sess) p++; } -#ifdef WIN32 - fh = g_open (file, O_CREAT | O_TRUNC | O_APPEND | O_WRONLY | _O_BINARY, 0644); -#else - fh = g_open (file, O_CREAT | O_TRUNC | O_APPEND | O_WRONLY, 0644); -#endif + fh = g_open (file, O_CREAT | O_TRUNC | O_APPEND | O_WRONLY | OFLAGS, 0644); g_free (file); if (fh == -1) { @@ -236,7 +232,7 @@ scrollback_save (session *sess, char *text) if ((buf = scrollback_get_filename (sess)) == NULL) return; - sess->scrollfd = g_open (buf, O_CREAT | O_APPEND | O_WRONLY, 0644); + sess->scrollfd = g_open (buf, O_CREAT | O_APPEND | O_WRONLY | OFLAGS, 0644); g_free (buf); if (sess->scrollfd == -1) return; @@ -595,11 +591,7 @@ log_open_file (char *servname, char *channame, char *netname) if (!file) return -1; -#ifdef WIN32 - fd = g_open (file, O_CREAT | O_APPEND | O_WRONLY | _O_BINARY, S_IREAD|S_IWRITE); -#else - fd = g_open (file, O_CREAT | O_APPEND | O_WRONLY, 0644); -#endif + fd = g_open (file, O_CREAT | O_APPEND | O_WRONLY | OFLAGS, 0644); g_free (file); if (fd == -1) -- cgit 1.4.1