Lines Matching defs:file

2  * contributor license agreements.  See the NOTICE file distributed with
4 * The ASF licenses this file to You under the Apache License, Version 2.0
5 * (the "License"); you may not use this file except in compliance with
29 static apr_status_t file_cleanup(apr_file_t *file, int is_child)
32 int fd = file->filedes;
34 /* Set file descriptor to -1 before close(), so that there is no
37 file->filedes = -1;
40 /* Only the parent process should delete the file! */
41 if (!is_child && (file->flags & APR_FOPEN_DELONCLOSE)) {
42 unlink(file->fname);
45 if (file->thlock) {
46 rv = apr_thread_mutex_destroy(file->thlock);
52 file->filedes = fd;
58 if (file->pollset != NULL) {
59 apr_status_t pollset_rv = apr_pollset_destroy(file->pollset);
60 /* If the file close failed, return its error value,
73 apr_file_t *file = thefile;
76 if (file->buffered) {
77 flush_rv = apr_file_flush(file);
80 rv = file_cleanup(file, 0);
253 APR_DECLARE(apr_status_t) apr_file_close(apr_file_t *file)
255 return apr_pool_cleanup_run(file->pool, file, apr_unix_file_cleanup);
279 apr_file_t *file)
281 *thefile = file->filedes;
285 APR_DECLARE(apr_status_t) apr_os_file_put(apr_file_t **file,
291 (*file) = apr_pcalloc(pool, sizeof(apr_file_t));
292 (*file)->pool = pool;
293 (*file)->eof_hit = 0;
294 (*file)->blocking = BLK_UNKNOWN; /* in case it is a pipe */
295 (*file)->timeout = -1;
296 (*file)->ungetchar = -1; /* no char avail */
297 (*file)->filedes = *dafile;
298 (*file)->flags = flags | APR_FOPEN_NOCLEANUP;
299 (*file)->buffered = (flags & APR_FOPEN_BUFFERED) > 0;
305 (*file)->pollset = NULL;
308 if ((*file)->buffered) {
309 (*file)->buffer = apr_palloc(pool, APR_FILE_DEFAULT_BUFSIZE);
310 (*file)->bufsize = APR_FILE_DEFAULT_BUFSIZE;
312 if ((*file)->flags & APR_FOPEN_XTHREAD) {
314 rv = apr_thread_mutex_create(&((*file)->thlock),
378 APR_IMPLEMENT_INHERIT_SET(file, flags, pool, apr_unix_file_cleanup)
407 APR_POOL_IMPLEMENT_ACCESSOR(file)