// Close frees Win32 resources associated with the BackupFileWriter. It does not
// close the underlying file.
500604
func (w *BackupFileWriter) Close() error {
	if w.ctx != 0 {
		backupWrite(syscall.Handle(w.f.Fd()), nil, nil, true, false, &w.ctx)
		runtime.KeepAlive(w.f)
		w.ctx = 0
	}
	return nil
}
456344
func (w *LimitWriter) Close() error {
	if closer, ok := w.Writer.(io.Closer); ok {
		return closer.Close()
	}
	return nil
}
837696
func (w *BufferedWriter) Close() error {
	if w.err != nil {
		return w.err
	}

	w.err = w.bw.Flush()
	w.w = nil
	w.bw = nil

	if w.err != nil {
		return w.err
	}

	w.err = errClosed
	return nil
}
193730
func (w *LogFile) Close() error {
	w.mu.Lock()
	defer w.mu.Unlock()
	if w.closed {
		return nil
	}
	if err := w.f.Close(); err != nil {
		return err
	}
	w.closed = true
	return nil
}
37821
func (w *Writer) Close() error {
	w.Flush()
	ret := w.err
	if w.err == nil {
		w.err = errClosed
	}
	return ret
}
205312
func (u readCloser) Close() error {
	if u.file != nil {
		return u.file.Close()
	}
	return nil
}
1350040
func (f deleteOnCloseFile) Close() error {
	f.File.Close()
	os.Remove(f.Name())
	return nil
}
409818
func (f *File) Close() (err error) {
	if C.sf_close(f.s) != 0 {
		err = errors.New(C.GoString(C.sf_strerror(f.s)))
	}
	if f.closeFd {
		nf := os.NewFile(f.fd, "")
		err = nf.Close()
	}
	runtime.SetFinalizer(f, nil)
	return
}
1031106
func (w *minifyWriter) Close() error {
	w.pw.Close()
	w.wg.Wait()
	return w.err
}
865284
func (w *Writer) Close() error {
	defer w.Done()
	if c, ok := w.Writer.(io.Closer); ok {
		return c.Close()
	}
	return nil
}
1266187
func (f *FileCloser) Close() error {
	ec := f.File.Close()
	log.Printf("Will Remove %s", f.path)
	ex := os.Remove(f.path)

	if ex == nil {
		return ec
	}

	return ex
}
459571
func (r *backupReadCloser) Close() error {
	defer r.stdout.Close()

	if err := r.cmd.Wait(); err != nil {
		return err
	}

	// Verify that innobackupex prints "completed OK!" at the end of STDERR.
	if !strings.HasSuffix(strings.TrimSpace(r.stderr.String()), "completed OK!") {
		r.stderr.WriteTo(os.Stderr)
		return errors.New("innobackupex did not complete ok")
	}

	return nil
}
1039852
func (file *DataFile) Close() (err error) {
	if err = file.Buf.Unmap(); err != nil {
		return
	}
	return file.Fh.Close()
}
272191
func (l *Logger) Close() error {
	if f := l.logFile; f != nil {
		l.logFile = nil
		return f.Close()
	}
	return nil
}
440672
func (f *FileStorage) Close() error {
	f.subscription.Close()
	return f.file.Close()
}
1211453
func (w *tarWriter) Close(remove bool) error {
	if w.writer != nil {
		if err := w.writer.Close(); err != nil {
			return err
		}
	}

	if w.compressWriter != nil {
		if err := w.compressWriter.Close(); err != nil {
			return err
		}
	}

	if err := w.file.Close(); err != nil {
		return err
	}

	if remove {
		return os.Remove(w.fileName)
	}

	return nil
}
73022
func (w *Writer) Close() error {
	for src := w.src[:w.n]; len(src) > 0; {
		nDst, nSrc, err := w.t.Transform(w.dst, src, true)
		if nDst == 0 {
			return err
		}
		if _, werr := w.w.Write(w.dst[:nDst]); werr != nil {
			return werr
		}
		if err != ErrShortDst {
			return err
		}
		src = src[nSrc:]
	}
	return nil
}