mirror of
https://github.com/yann64/haikuports.git
synced 2026-04-08 21:00:05 +02:00
126 lines
3.1 KiB
Plaintext
126 lines
3.1 KiB
Plaintext
From 83b25f7ce001e702d8b2a793b971f3a6620724b8 Mon Sep 17 00:00:00 2001
|
|
From: Al Hoang <3811822-hoanga@users.noreply.gitlab.com>
|
|
Date: Fri, 29 Apr 2022 23:23:46 -0500
|
|
Subject: compile under haiku
|
|
|
|
* mtimespec -> mtim
|
|
* tcsetattr flags
|
|
* no d_type
|
|
* add haiku to configure
|
|
* haiku.h
|
|
|
|
diff --git a/fileio.c b/fileio.c
|
|
index 3185222..75d3191 100644
|
|
--- a/fileio.c
|
|
+++ b/fileio.c
|
|
@@ -67,7 +67,7 @@ ffstat(FILE *ffp, struct buffer *bp)
|
|
bp->b_fi.fi_mode = sb.st_mode | 0x8000;
|
|
bp->b_fi.fi_uid = sb.st_uid;
|
|
bp->b_fi.fi_gid = sb.st_gid;
|
|
- bp->b_fi.fi_mtime = sb.st_mtimespec;
|
|
+ bp->b_fi.fi_mtime = sb.st_mtim;
|
|
/* Clear the ignore flag */
|
|
bp->b_flag &= ~(BFIGNDIRTY | BFDIRTY);
|
|
}
|
|
@@ -519,17 +519,12 @@ make_file_list(char *buf)
|
|
if (strncmp(cp, dent->d_name, len) != 0)
|
|
continue;
|
|
isdir = 0;
|
|
- if (dent->d_type == DT_DIR) {
|
|
- isdir = 1;
|
|
- } else if (dent->d_type == DT_LNK ||
|
|
- dent->d_type == DT_UNKNOWN) {
|
|
struct stat statbuf;
|
|
|
|
if (fstatat(dirfd(dirp), dent->d_name, &statbuf, 0) < 0)
|
|
continue;
|
|
if (S_ISDIR(statbuf.st_mode))
|
|
isdir = 1;
|
|
- }
|
|
|
|
if ((current = malloc(sizeof(struct list))) == NULL) {
|
|
free_file_list(last);
|
|
@@ -582,8 +577,8 @@ fchecktime(struct buffer *bp)
|
|
if (stat(bp->b_fname, &sb) == -1)
|
|
return (TRUE);
|
|
|
|
- if (bp->b_fi.fi_mtime.tv_sec != sb.st_mtimespec.tv_sec ||
|
|
- bp->b_fi.fi_mtime.tv_nsec != sb.st_mtimespec.tv_nsec)
|
|
+ if (bp->b_fi.fi_mtime.tv_sec != sb.st_mtim.tv_sec ||
|
|
+ bp->b_fi.fi_mtime.tv_nsec != sb.st_mtim.tv_nsec)
|
|
return (FALSE);
|
|
|
|
return (TRUE);
|
|
diff --git a/tags.c b/tags.c
|
|
index 5376364..66017ec 100644
|
|
--- a/tags.c
|
|
+++ b/tags.c
|
|
@@ -8,7 +8,7 @@
|
|
|
|
#include <sys/queue.h>
|
|
#include <sys/stat.h>
|
|
-#if defined(__linux__) || defined(__DragonFly__) || defined(__APPLE__)
|
|
+#if defined(__linux__) || defined(__DragonFly__) || defined(__APPLE__) || defined(__HAIKU__)
|
|
#include "tree.h"
|
|
#else
|
|
#include <sys/tree.h>
|
|
diff --git a/ttyio.c b/ttyio.c
|
|
index 54ddd8e..12262fc 100644
|
|
--- a/ttyio.c
|
|
+++ b/ttyio.c
|
|
@@ -76,7 +76,7 @@ ttraw(void)
|
|
newtty.c_oflag &= ~OPOST;
|
|
newtty.c_lflag &= ~(ECHO | ECHONL | ICANON | ISIG | IEXTEN);
|
|
|
|
- if (tcsetattr(0, TCSASOFT | TCSADRAIN, &newtty) == -1) {
|
|
+ if (tcsetattr(0, TCSADRAIN, &newtty) == -1) {
|
|
dobeep();
|
|
ewprintf("ttopen can't tcsetattr");
|
|
return (FALSE);
|
|
@@ -110,7 +110,7 @@ int
|
|
ttcooked(void)
|
|
{
|
|
ttflush();
|
|
- if (tcsetattr(0, TCSASOFT | TCSADRAIN, &oldtty) == -1) {
|
|
+ if (tcsetattr(0, TCSADRAIN, &oldtty) == -1) {
|
|
dobeep();
|
|
ewprintf("ttclose can't tcsetattr");
|
|
return (FALSE);
|
|
diff --git a/configure b/configure
|
|
index 4e5afb5..def1ba0 100755
|
|
--- a/configure
|
|
+++ b/configure
|
|
@@ -360,7 +360,7 @@ fi
|
|
printf "checking for OS... "
|
|
|
|
if [ $terminfo -eq 0 ] ; then
|
|
- libs="-lncursesw"
|
|
+ libs="-lncursesw -lbsd -lnetwork"
|
|
else
|
|
libs=""
|
|
fi
|
|
@@ -416,6 +416,8 @@ cat << EOF > config.h
|
|
#include "netbsd.h"
|
|
#elif defined(__DragonFly__)
|
|
#include "dragonfly.h"
|
|
+#elif defined(__HAIKU__)
|
|
+#include "haiku.h"
|
|
#endif
|
|
|
|
EOF
|
|
diff --git a/haiku.h b/haiku.h
|
|
new file mode 100644
|
|
index 0000000..d4e8eba
|
|
--- /dev/null
|
|
+++ b/haiku.h
|
|
@@ -0,0 +1,6 @@
|
|
+/*
|
|
+ * haiku-specific support.
|
|
+ */
|
|
+
|
|
+#include <time.h>
|
|
+#include <stdio.h>
|
|
--
|
|
2.30.2
|
|
|