diff options
Diffstat (limited to '')
-rw-r--r-- | src/redir.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/redir.c b/src/redir.c index 895140c..1e00a69 100644 --- a/src/redir.c +++ b/src/redir.c @@ -183,32 +183,32 @@ redirect(union node *redir, int flags) STATIC int openredirect(union node *redir) { - struct stat64 sb; + struct stat sb; char *fname; int f; switch (redir->nfile.type) { case NFROM: fname = redir->nfile.expfname; - if ((f = open64(fname, O_RDONLY)) < 0) + if ((f = open(fname, O_RDONLY)) < 0) goto eopen; break; case NFROMTO: fname = redir->nfile.expfname; - if ((f = open64(fname, O_RDWR|O_CREAT, 0666)) < 0) + if ((f = open(fname, O_RDWR|O_CREAT, 0666)) < 0) goto ecreate; break; case NTO: /* Take care of noclobber mode. */ if (Cflag) { fname = redir->nfile.expfname; - if (stat64(fname, &sb) < 0) { - if ((f = open64(fname, O_WRONLY|O_CREAT|O_EXCL, 0666)) < 0) + if (stat(fname, &sb) < 0) { + if ((f = open(fname, O_WRONLY|O_CREAT|O_EXCL, 0666)) < 0) goto ecreate; } else if (!S_ISREG(sb.st_mode)) { - if ((f = open64(fname, O_WRONLY, 0666)) < 0) + if ((f = open(fname, O_WRONLY, 0666)) < 0) goto ecreate; - if (!fstat64(f, &sb) && S_ISREG(sb.st_mode)) { + if (!fstat(f, &sb) && S_ISREG(sb.st_mode)) { close(f); errno = EEXIST; goto ecreate; @@ -222,12 +222,12 @@ openredirect(union node *redir) /* FALLTHROUGH */ case NCLOBBER: fname = redir->nfile.expfname; - if ((f = open64(fname, O_WRONLY|O_CREAT|O_TRUNC, 0666)) < 0) + if ((f = open(fname, O_WRONLY|O_CREAT|O_TRUNC, 0666)) < 0) goto ecreate; break; case NAPPEND: fname = redir->nfile.expfname; - if ((f = open64(fname, O_WRONLY|O_CREAT|O_APPEND, 0666)) < 0) + if ((f = open(fname, O_WRONLY|O_CREAT|O_APPEND, 0666)) < 0) goto ecreate; break; case NTOFD: |