Skip to content

Commit

Permalink
Fixes for compatibility with 32-bit architectures
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnoKing committed Feb 16, 2024
1 parent e57cb41 commit ff34ceb
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
18 changes: 9 additions & 9 deletions src/cmd/ksh93/bltins/read.c
Original file line number Diff line number Diff line change
Expand Up @@ -50,13 +50,13 @@

struct read_save
{
char **argv;
char *prompt;
int fd;
int plen;
int flags;
ssize_t len;
long timeout;
char **argv;
char *prompt;
int fd;
int plen;
int flags;
ssize_t len;
Sflong_t timeout;
};

int b_read(int argc,char *argv[], Shbltin_t *context)
Expand All @@ -66,7 +66,7 @@ int b_read(int argc,char *argv[], Shbltin_t *context)
const char *msg = e_file+4;
int r, flags=0, fd=0;
ssize_t len=0;
long timeout = 1000L*sh.st.tmout;
Sflong_t timeout = 1000*(Sflong_t)sh.st.tmout;
int save_prompt, fixargs=context->invariant;
struct read_save *rp;
static char default_prompt[3] = {ESC,ESC};
Expand Down Expand Up @@ -212,7 +212,7 @@ static void timedout(void *handle)
* <flags> is union of -A, -r, -s, and contains delimiter if not '\n'
* <timeout> is the number of milliseconds until timeout
*/
int sh_readline(char **names, volatile int fd, int flags, ssize_t size, long timeout)
int sh_readline(char **names, volatile int fd, int flags, ssize_t size, Sflong_t timeout)
{
ssize_t c;
unsigned char *cp;
Expand Down
2 changes: 1 addition & 1 deletion src/cmd/ksh93/include/defs.h
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ extern int sh_outtype(Sfio_t*);
extern char *sh_mactry(char*);
extern int sh_mathstd(const char*);
extern void sh_printopts(Shopt_t,int,Shopt_t*);
extern int sh_readline(char**,volatile int,int,ssize_t,long);
extern int sh_readline(char**,volatile int,int,ssize_t,Sflong_t);
extern Sfio_t *sh_sfeval(char*[]);
extern void sh_setmatch(const char*,int,int,int[],int);
extern void sh_scope(struct argnod*, int);
Expand Down
2 changes: 1 addition & 1 deletion src/cmd/ksh93/sh/xec.c
Original file line number Diff line number Diff line change
Expand Up @@ -1993,7 +1993,7 @@ int sh_exec(const Shnode_t *t, int flags)
save_prompt = sh.nextprompt;
sh.nextprompt = 3;
sh.timeout = 0;
sh.exitval=sh_readline(&null_pointer,0,1,0,1000L*sh.st.tmout);
sh.exitval=sh_readline(&null_pointer,0,1,0,1000*(Sflong_t)sh.st.tmout);
sh.nextprompt = save_prompt;
if(sh.exitval||sfeof(sfstdin)||sferror(sfstdin))
{
Expand Down

0 comments on commit ff34ceb

Please sign in to comment.