summary refs log tree commit diff
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2017-07-16 12:48:41 -0400
committerJune McEnroe <june@causal.agency>2017-07-16 12:48:41 -0400
commit1d13c041e8db4a6ad4d113cc44900501b63b8c16 (patch)
tree916d6c279b556da5ad88411514e108a833671187
parentSend ^L on attach, rmcup reset on detach (diff)
downloadsrc-1d13c041e8db4a6ad4d113cc44900501b63b8c16.tar.gz
src-1d13c041e8db4a6ad4d113cc44900501b63b8c16.zip
Fix dtch portability
-rwxr-xr-xhome/.bin/dtch.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/home/.bin/dtch.c b/home/.bin/dtch.c
index ac7164fd..2c19e1d2 100755
--- a/home/.bin/dtch.c
+++ b/home/.bin/dtch.c
@@ -1,7 +1,7 @@
 #if 0
 set -e
 bin=$(dirname $0)
-cc -Wall -Wextra -pedantic $@ -o $bin/dtch $0
+cc -Wall -Wextra -pedantic $@ -lutil -o $bin/dtch $0
 ln -f $bin/dtch $bin/atch
 exit
 #endif
@@ -22,7 +22,14 @@ exit
 #include <sysexits.h>
 #include <termios.h>
 #include <unistd.h>
+
+#if defined __FreeBSD__
+#include <libutil.h>
+#elif defined __linux__
+#include <pty.h>
+#else
 #include <util.h>
+#endif
 
 static struct passwd *getUser(void) {
     uid_t uid = getuid();