summaryrefslogtreecommitdiff
path: root/mactelnetd.c
diff options
context:
space:
mode:
authorHåkon Nessjøen <haakon.nessjoen@gmail.com>2013-06-30 22:55:34 +0200
committerHåkon Nessjøen <haakon.nessjoen@gmail.com>2013-06-30 22:55:34 +0200
commitada2248de61130b216b0a332f9b19227541befea (patch)
tree3c59e94f3897a1f3cc3a06a6d0f7f6f428d9824e /mactelnetd.c
parentb037a49dd3bd8874c91c437b8acc59b4423f0dcc (diff)
downloadMAC-Telnet-ada2248de61130b216b0a332f9b19227541befea.tar.gz
MAC-Telnet-ada2248de61130b216b0a332f9b19227541befea.zip
Fix some erroneous ifdefs
Diffstat (limited to 'mactelnetd.c')
-rw-r--r--mactelnetd.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/mactelnetd.c b/mactelnetd.c
index b90ce2f..c338678 100644
--- a/mactelnetd.c
+++ b/mactelnetd.c
@@ -39,13 +39,13 @@
#include <string.h>
#ifdef __linux__
#include <linux/if_ether.h>
+#include <sys/mman.h>
#else
#include <sys/time.h>
#endif
#include <sys/ioctl.h>
#include <sys/stat.h>
#include <sys/sysinfo.h>
-#include <sys/mman.h>
#include <pwd.h>
#include <utmp.h>
#include <syslog.h>
@@ -386,7 +386,7 @@ static void user_login(struct mt_connection *curconn, struct mt_mactelnet_hdr *p
if ((user = find_user(curconn->username)) != NULL) {
md5_state_t state;
-#ifdef _POSIX_MEMLOCK_RANGE
+#if defined(__linux__) && defined(_POSIX_MEMLOCK_RANGE)
mlock(md5data, sizeof(md5data));
mlock(md5sum, sizeof(md5sum));
if (user->password != NULL) {
@@ -598,7 +598,7 @@ static void handle_data_packet(struct mt_connection *curconn, struct mt_mactelne
} else if (cpkt.cptype == MT_CPTYPE_PASSWORD) {
-#ifdef _POSIX_MEMLOCK_RANGE
+#if defined(__linux__) && defined(_POSIX_MEMLOCK_RANGE)
mlock(curconn->trypassword, 17);
#endif
memcpy(curconn->trypassword, cpkt.data, 17);