Fossil SCM
Make included jimsh work on MorphOS with ixemul
Commit
084f17dcd62788499fe77dae6c90c1897004eb3b5156e5d380a893200fe1c674
Parent
b9998eb62537165…
1 file changed
+14
+14
| --- autosetup/jimsh0.c | ||
| +++ autosetup/jimsh0.c | ||
| @@ -49,11 +49,15 @@ | ||
| 49 | 49 | #define vfork fork |
| 50 | 50 | #define _POSIX_SOURCE |
| 51 | 51 | #else |
| 52 | 52 | #define _GNU_SOURCE |
| 53 | 53 | #endif |
| 54 | +#ifndef __ixemul__ | |
| 54 | 55 | #define HAVE_FORK |
| 56 | +#else | |
| 57 | +#define HAVE_VFORK | |
| 58 | +#endif | |
| 55 | 59 | #define HAVE_WAITPID |
| 56 | 60 | #define HAVE_ISATTY |
| 57 | 61 | #define HAVE_MKSTEMP |
| 58 | 62 | #define HAVE_LINK |
| 59 | 63 | #define HAVE_SYS_TIME_H |
| @@ -4513,10 +4517,20 @@ | ||
| 4513 | 4517 | } |
| 4514 | 4518 | if (errno == ENOENT) { |
| 4515 | 4519 | |
| 4516 | 4520 | continue; |
| 4517 | 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 | |
| 4518 | 4532 | |
| 4519 | 4533 | if (errno == EEXIST) { |
| 4520 | 4534 | jim_stat_t sb; |
| 4521 | 4535 | |
| 4522 | 4536 | if (Jim_Stat(path, &sb) == 0 && S_ISDIR(sb.st_mode)) { |
| 4523 | 4537 |
| --- 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 |