From ea62077b850076c4d7dc3cf78ebd1888928c6ddf Mon Sep 17 00:00:00 2001 From: Denis Vlasenko Date: Sat, 14 Oct 2006 02:23:43 +0000 Subject: add open_read_close() and similar stuff --- shell/msh.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'shell/msh.c') diff --git a/shell/msh.c b/shell/msh.c index df6f321aa..cb2947137 100644 --- a/shell/msh.c +++ b/shell/msh.c @@ -2954,7 +2954,7 @@ static int iosetup(struct ioword *iop, int pipein, int pipeout) case IOWRITE | IOCAT: if ((u = open(cp, 1)) >= 0) { - lseek(u, (long) 0, 2); + lseek(u, (long) 0, SEEK_END); break; } case IOWRITE: @@ -4686,7 +4686,7 @@ static void pushio(struct ioarg *argp, int (*fn) (struct ioarg *)) /* This line appears to be active when running scripts from command line */ if ((isatty(e.iop->argp->afile) == 0) && (e.iop == &iostack[0] - || lseek(e.iop->argp->afile, 0L, 1) != -1)) { + || lseek(e.iop->argp->afile, 0L, SEEK_CUR) != -1)) { if (++bufid == AFID_NOBUF) /* counter rollover check, AFID_NOBUF = 11111111 */ bufid = AFID_ID; /* AFID_ID = 0 */ @@ -4831,7 +4831,7 @@ static int filechar(struct ioarg *ap) if ((i = ap->afid != bp->id) || bp->bufp == bp->ebufp) { if (i) - lseek(ap->afile, ap->afpos, 0); + lseek(ap->afile, ap->afpos, SEEK_SET); i = safe_read(ap->afile, bp->buf, sizeof(bp->buf)); -- cgit v1.2.3