Make all the files executable on OS/2

On OS/2, an executable status is determined by an extension such as .exe
not real executable mode.

Script files without executable extensions such as .exe, cannot be
executed.
This commit is contained in:
KO Myung-Hun 2015-05-08 08:11:17 +09:00
parent 5ed2481df2
commit a3fdbc6802
1 changed files with 4 additions and 0 deletions

4
exec.c
View File

@ -1232,6 +1232,10 @@ search_access(const char *fn, int mode)
if (access(fn, mode) < 0)
/* file exists, but we can't access it */
return (errno);
#ifdef __OS2__
/* Treat all the files as executables on OS/2 */
sb.st_mode |= S_IXUSR | S_IXGRP | S_IXOTH;
#endif
if (mode == X_OK && (!S_ISREG(sb.st_mode) ||
!(sb.st_mode & (S_IXUSR|S_IXGRP|S_IXOTH))))
/* access(2) may say root can execute everything */