1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-10-31 06:12:43 +00:00
serenity/Ports/oksh/patches/remove_redeclarations.patch
Manuel Palenzuela 8b0f1f816b Ports: Added an oksh port
Currently has some problems such as not killing jobs when (ctrl + c)
and depends on an implementation of sigsuspend.
2021-04-06 08:10:18 +02:00

101 lines
3.1 KiB
Diff

diff --git a/jobs.c b/jobs.c
index 121c0cf..b30d105 100644
--- a/jobs.c
+++ b/jobs.c
@@ -30,6 +30,7 @@
#include "sh.h"
#include "tty.h"
+#include "portable.h"
/* Order important! */
#define PRUNNING 0
diff --git a/portable.h b/portable.h
index 899c974..864e112 100644
--- a/portable.h
+++ b/portable.h
@@ -61,10 +61,8 @@
#define _PW_NAME_LEN MAXLOGNAME
#elif defined(__sun)
#define _PW_NAME_LEN LOGNAME_MAX
-#elif defined(__hpux)
-#define _PW_NAME_LEN 8
#else
-#define _PW_NAME_LEN MAXLOGNAME - 1
+#define _PW_NAME_LEN 8
#endif /* __linux__ || __CYGWIN__ || _AIX || __NetBSD__ || __sun || __midipix__ || __HAIKU__ */
#endif /* !_PW_NAME_LEN */
@@ -116,6 +114,15 @@
#define nice(x) (int)0
#endif /* __HAIKU__ */
+#ifdef __serenity__
+#define _PATH_DEFPATH "/usr/bin:/usr/local/bin"
+#define _PATH_STDPATH "/usr/bin:/bin:/usr/sbin:/sbin:"
+#define _CS_PATH 1
+#define WCOREFLAG 0200
+#define WCOREDUMP(x) ((x) & WCOREFLAG)
+#define nice(x) (int)0
+#endif
+
#ifndef HAVE_SETRESGID
#define setresgid(x, y, z) setgid(x); setegid(y); setgid(z)
#endif /* !HAVE_SETRESGID */
@@ -128,30 +135,6 @@
#define srand_deterministic(x) srand(x)
#endif /* !HAVE_SRAND_DETERMINISTIC */
-#ifndef HAVE_TIMERADD
-#define timeradd(tvp, uvp, vvp) \
- do { \
- (vvp)->tv_sec = (tvp)->tv_sec + (uvp)->tv_sec; \
- (vvp)->tv_usec = (tvp)->tv_usec + (uvp)->tv_usec; \
- if ((vvp)->tv_usec >= 1000000) { \
- (vvp)->tv_sec++; \
- (vvp)->tv_usec -= 1000000; \
- } \
- } while (0)
-#endif /* !HAVE_TIMERADD */
-
-#ifndef HAVE_TIMERSUB
-#define timersub(tvp, uvp, vvp) \
- do { \
- (vvp)->tv_sec = (tvp)->tv_sec - (uvp)->tv_sec; \
- (vvp)->tv_usec = (tvp)->tv_usec - (uvp)->tv_usec; \
- if ((vvp)->tv_usec < 0) { \
- (vvp)->tv_sec--; \
- (vvp)->tv_usec += 1000000; \
- } \
- } while (0)
-#endif /* !HAVE_TIMERSUB */
-
/* struct stat compatibility */
#ifndef HAVE_ST_MTIM
#ifndef HAVE_ST_MTIMESPEC
@@ -240,9 +223,9 @@ int strunvis(char *, const char *);
#undef NSIG
#endif /* NSIG */
#define NSIG 33
-#ifndef HAVE_SIGLIST
-extern const char *const sys_siglist[NSIG];
-#endif /* !HAVE_SIGLIST */
+//#ifndef HAVE_SIGLIST
+//extern const char *const sys_siglist[NSIG];
+//#endif /* !HAVE_SIGLIST */
#ifndef HAVE_SIGNAME
extern const char *const sys_signame[NSIG];
#endif /* !HAVE_SIGNAME */
diff --git a/siglist.c b/siglist.c
index 790d7da..d8e3519 100644
--- a/siglist.c
+++ b/siglist.c
@@ -30,7 +30,7 @@
#include "pconfig.h"
-#ifndef HAVE_SIGLIST
+#if 0
#include <signal.h>