diff options
author | June McEnroe <june@causal.agency> | 2022-01-21 22:26:28 -0500 |
---|---|---|
committer | June McEnroe <june@causal.agency> | 2022-01-21 22:26:28 -0500 |
commit | 22fb2a07db173532462d90ad875a06254e932773 (patch) | |
tree | f1452b68dad10fa2a6d43223a992eefa93cedf75 /src/redir.c | |
parent | dash: Just zero mailsize on changemail (diff) | |
download | dash-22fb2a07db173532462d90ad875a06254e932773.tar.gz dash-22fb2a07db173532462d90ad875a06254e932773.zip |
dash: Stop this stat64 nonsense
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: |