Fossil SCM

Make included jimsh work on MorphOS with ixemul

js 2025-05-26 21:28 morphos
Commit 084f17dcd62788499fe77dae6c90c1897004eb3b5156e5d380a893200fe1c674
1 file changed +14
--- autosetup/jimsh0.c
+++ autosetup/jimsh0.c
@@ -49,11 +49,15 @@
4949
#define vfork fork
5050
#define _POSIX_SOURCE
5151
#else
5252
#define _GNU_SOURCE
5353
#endif
54
+#ifndef __ixemul__
5455
#define HAVE_FORK
56
+#else
57
+#define HAVE_VFORK
58
+#endif
5559
#define HAVE_WAITPID
5660
#define HAVE_ISATTY
5761
#define HAVE_MKSTEMP
5862
#define HAVE_LINK
5963
#define HAVE_SYS_TIME_H
@@ -4513,10 +4517,20 @@
45134517
}
45144518
if (errno == ENOENT) {
45154519
45164520
continue;
45174521
}
4522
+
4523
+#if defined(__morphos__) && defined(__ixemul__)
4524
+ /*
4525
+ * MorphOS with ixemul returns ENOTDIR on SFS when the directory
4526
+ * already exists, but on RAM: it returns the correct EEXIST.
4527
+ */
4528
+ if (errno == ENOTDIR) {
4529
+ errno = EEXIST;
4530
+ }
4531
+#endif
45184532
45194533
if (errno == EEXIST) {
45204534
jim_stat_t sb;
45214535
45224536
if (Jim_Stat(path, &sb) == 0 && S_ISDIR(sb.st_mode)) {
45234537
--- autosetup/jimsh0.c
+++ autosetup/jimsh0.c
@@ -49,11 +49,15 @@
49 #define vfork fork
50 #define _POSIX_SOURCE
51 #else
52 #define _GNU_SOURCE
53 #endif
 
54 #define HAVE_FORK
 
 
 
55 #define HAVE_WAITPID
56 #define HAVE_ISATTY
57 #define HAVE_MKSTEMP
58 #define HAVE_LINK
59 #define HAVE_SYS_TIME_H
@@ -4513,10 +4517,20 @@
4513 }
4514 if (errno == ENOENT) {
4515
4516 continue;
4517 }
 
 
 
 
 
 
 
 
 
 
4518
4519 if (errno == EEXIST) {
4520 jim_stat_t sb;
4521
4522 if (Jim_Stat(path, &sb) == 0 && S_ISDIR(sb.st_mode)) {
4523
--- autosetup/jimsh0.c
+++ autosetup/jimsh0.c
@@ -49,11 +49,15 @@
49 #define vfork fork
50 #define _POSIX_SOURCE
51 #else
52 #define _GNU_SOURCE
53 #endif
54 #ifndef __ixemul__
55 #define HAVE_FORK
56 #else
57 #define HAVE_VFORK
58 #endif
59 #define HAVE_WAITPID
60 #define HAVE_ISATTY
61 #define HAVE_MKSTEMP
62 #define HAVE_LINK
63 #define HAVE_SYS_TIME_H
@@ -4513,10 +4517,20 @@
4517 }
4518 if (errno == ENOENT) {
4519
4520 continue;
4521 }
4522
4523 #if defined(__morphos__) && defined(__ixemul__)
4524 /*
4525 * MorphOS with ixemul returns ENOTDIR on SFS when the directory
4526 * already exists, but on RAM: it returns the correct EEXIST.
4527 */
4528 if (errno == ENOTDIR) {
4529 errno = EEXIST;
4530 }
4531 #endif
4532
4533 if (errno == EEXIST) {
4534 jim_stat_t sb;
4535
4536 if (Jim_Stat(path, &sb) == 0 && S_ISDIR(sb.st_mode)) {
4537

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button