summaryrefslogtreecommitdiff
path: root/bin/ksh/shf.c
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2005-12-11 18:53:52 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2005-12-11 18:53:52 +0000
commit3f4357f701bd93523718fad49f37ca46a1bf7b7c (patch)
treed5bb381a2c97d21f3a239000de6dadce20e8ab62 /bin/ksh/shf.c
parentd50c1064a55a09bd16da6a333beabca9f69f31b5 (diff)
remove unused variables and functions
Diffstat (limited to 'bin/ksh/shf.c')
-rw-r--r--bin/ksh/shf.c62
1 files changed, 1 insertions, 61 deletions
diff --git a/bin/ksh/shf.c b/bin/ksh/shf.c
index ef503f1abbb..31bd0f39a86 100644
--- a/bin/ksh/shf.c
+++ b/bin/ksh/shf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: shf.c,v 1.13 2005/03/30 17:16:37 deraadt Exp $ */
+/* $OpenBSD: shf.c,v 1.14 2005/12/11 18:53:51 deraadt Exp $ */
/*
* Shell file I/O routines
@@ -265,22 +265,6 @@ shf_sclose(struct shf *shf)
return (char *) s;
}
-/* Flush and free file structure, don't close file descriptor */
-int
-shf_finish(struct shf *shf)
-{
- int ret = 0;
-
- if (shf->fd >= 0)
- ret = shf_flush(shf);
- if (shf->flags & SHF_ALLOCS)
- afree(shf, shf->areap);
- else if (shf->flags & SHF_ALLOCB)
- afree(shf->buf, shf->areap);
-
- return ret;
-}
-
/* Un-read what has been read but not examined, or write what has been
* buffered. Returns 0 for success, EOF for (write) error.
*/
@@ -437,50 +421,6 @@ shf_fillbuf(struct shf *shf)
return 0;
}
-/* Seek to a new position in the file. If writing, flushes the buffer
- * first. If reading, optimizes small relative seeks that stay inside the
- * buffer. Returns 0 for success, EOF otherwise.
- */
-int
-shf_seek(struct shf *shf, off_t where, int from)
-{
- if (shf->fd < 0) {
- errno = EINVAL;
- return EOF;
- }
-
- if (shf->flags & SHF_ERROR) {
- errno = shf->errno_;
- return EOF;
- }
-
- if ((shf->flags & SHF_WRITING) && shf_emptybuf(shf, EB_READSW) == EOF)
- return EOF;
-
- if (shf->flags & SHF_READING) {
- if (from == SEEK_CUR &&
- (where < 0 ? -where >= shf->rbsize - shf->rnleft :
- where < shf->rnleft)) {
- shf->rnleft -= where;
- shf->rp += where;
- return 0;
- }
- shf->rnleft = 0;
- shf->rp = shf->buf;
- }
-
- shf->flags &= ~(SHF_EOF | SHF_READING | SHF_WRITING);
-
- if (lseek(shf->fd, where, from) < 0) {
- shf->errno_ = errno;
- shf->flags |= SHF_ERROR;
- return EOF;
- }
-
- return 0;
-}
-
-
/* Read a buffer from shf. Returns the number of bytes read into buf,
* if no bytes were read, returns 0 if end of file was seen, EOF if
* a read error occurred.