about summary refs log tree commit diff homepage
path: root/tools/klee-replay/file-creator.c
diff options
context:
space:
mode:
authorGleb Popov <6yearold@gmail.com>2019-03-30 16:34:13 +0400
committerMartinNowack <martin.nowack@gmail.com>2019-04-02 09:12:56 +0100
commit7948a03c62890333ae3848b626efb9340a542beb (patch)
tree72950cfc5abbbaa62eddecc35a761e2cc449fce0 /tools/klee-replay/file-creator.c
parent0b33d74f465991e94d8dafb6eeaf4b69af0a1887 (diff)
downloadklee-7948a03c62890333ae3848b626efb9340a542beb.tar.gz
Fix klee-replay tool on FreeBSD.
Diffstat (limited to 'tools/klee-replay/file-creator.c')
-rw-r--r--tools/klee-replay/file-creator.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/tools/klee-replay/file-creator.c b/tools/klee-replay/file-creator.c
index b8f9addd..a218e6b0 100644
--- a/tools/klee-replay/file-creator.c
+++ b/tools/klee-replay/file-creator.c
@@ -25,6 +25,8 @@
 #include <pty.h>
 #elif defined(HAVE_UTIL_H)
 #include <util.h>
+#elif defined(HAVE_LIBUTIL_H)
+#include <libutil.h>
 #endif
 
 #if defined(__APPLE__)
@@ -114,7 +116,7 @@ static int create_char_dev(const char *fname, exe_disk_file_t *dfile,
   ts->c_oflag = 5;
   ts->c_cflag = 1215;
   ts->c_lflag = 35287;
-#ifndef __APPLE__
+#ifdef __GLIBC__
   ts->c_line = 0;
 #endif
   ts->c_cc[0] = '\x03';
@@ -168,7 +170,7 @@ static int create_char_dev(const char *fname, exe_disk_file_t *dfile,
         int res = tcgetattr(aslave, &mode);
         assert(!res);
         mode.c_iflag = IGNBRK;
-#if defined(__APPLE__)
+#if defined(__APPLE__) || defined(__FreeBSD__)
         mode.c_oflag &= ~(ONLCR | OCRNL | ONLRET);
 #else
         mode.c_oflag &= ~(OLCUC | ONLCR | OCRNL | ONLRET);