| /dovecot/src/lib/ |
| H A D | fdatasync-path.c | 11 int fd, ret = 0; local 15 fd = open(path, O_RDONLY); 16 if (fd == -1) 18 if (fdatasync(fd) < 0) { 29 i_close_fd(&fd);
|
| H A D | read-full.c | 8 int read_full(int fd, void *data, size_t size) argument 13 ret = read(fd, data, size < SSIZE_T_MAX ? size : SSIZE_T_MAX); 24 int pread_full(int fd, void *data, size_t size, off_t offset) argument 29 ret = pread(fd, data, size < SSIZE_T_MAX ?
|
| H A D | write-full.c | 8 int write_full(int fd, const void *data, size_t size) argument 13 ret = write(fd, data, size < SSIZE_T_MAX ? size : SSIZE_T_MAX); 31 int pwrite_full(int fd, const void *data, size_t size, off_t offset) argument 36 ret = pwrite(fd, data, size < SSIZE_T_MAX ?
|
| H A D | ioloop-notify-fd.c | 5 #include "ioloop-notify-fd.h" 9 struct io *io_notify_fd_add(struct ioloop_notify_fd_context *ctx, int fd, argument 19 io->fd = fd; 43 io_notify_fd_find(struct ioloop_notify_fd_context *ctx, int fd) argument 48 if (io->fd == fd)
|
| H A D | ioloop-notify-fd.h | 4 /* common notify code for fd-based notifications (dnotify, inotify) */ 12 int fd; member in struct:io_notify 20 io_notify_fd_add(struct ioloop_notify_fd_context *ctx, int fd, 26 io_notify_fd_find(struct ioloop_notify_fd_context *ctx, int fd);
|
| H A D | safe-mkdir.c | 13 int fd, ret = 2, changed_ret = 0; local 30 fd = open(dir, O_RDONLY); 31 if (fd == -1) 34 if (fstat(fd, &st) < 0) 44 if (fchown(fd, uid, gid) < 0) 50 if (fchmod(fd, mode) < 0) 55 if (close(fd) < 0)
|
| H A D | unix-socket-create.c | 14 int fd; local 17 fd = net_listen_unix_unlink_stale(path, backlog); 20 if (fd < 0) { 30 i_close_fd(&fd); 34 return fd;
|
| H A D | askpass.c | 18 int fd; local 25 fd = open("/dev/tty", O_RDONLY); 26 if (fd < 0) 30 if (tcgetattr(fd, &old_tio) == 0) { 34 (void)tcsetattr(fd, TCSAFLUSH, &tio); 38 fd = STDIN_FILENO; 42 while (read(fd, &ch, 1) > 0) { 50 (void)tcsetattr(fd, TCSAFLUSH, &old_tio); 53 i_close_fd(&fd);
|
| H A D | file-set-size.c | 22 int file_set_size(int fd, off_t size) argument 34 if (fstat(fd, &st) < 0) { 40 if (ftruncate(fd, size) < 0) { 53 err = posix_fallocate(fd, st.st_size, size - st.st_size); 72 ret = pwrite(fd, block, 85 int file_preallocate(int fd ATTR_UNUSED, off_t size ATTR_UNUSED) 89 if (fallocate(fd, FALLOC_FL_KEEP_SIZE, 0, size) < 0) 102 if (fcntl(fd, F_PREALLOCATE, &fs) < 0)
|
| H A D | mmap-util.c | 8 void *mmap_file(int fd, size_t *length, int prot) argument 12 if (fstat(fd, &st) < 0) 29 return mmap(NULL, *length, prot, MAP_SHARED, fd, 0); 32 void *mmap_ro_file(int fd, size_t *length) argument 34 return mmap_file(fd, length, PROT_READ); 37 void *mmap_rw_file(int fd, size_t *length) argument 39 return mmap_file(fd, length, PROT_READ | PROT_WRITE);
|
| H A D | safe-mkstemp.c | 23 int fd; local 41 fd = open(str_c(prefix), O_RDWR | O_EXCL | O_CREAT, 0666); 43 if (fd != -1) 54 return fd; 56 if (fchown(fd, uid, gid) < 0) { 66 i_close_fd(&fd); 71 return fd; 88 int fd; local 91 if ((fd = safe_mkstemp(prefix, mode, uid, gid)) == -1) 93 return fd; 100 int fd; local [all...] |
| H A D | test-file-create-locked.c | 13 int fd; local 15 fd = creat(path, 0600); 16 if (fd == -1) 18 i_close_fd(&fd); 52 int fd; local 65 fd = file_create_locked(path, &set, &lock, &created, &error); 66 test_assert(fd > 0); 72 i_close_fd(&fd); 100 int fd; local 115 fd [all...] |
| H A D | test-iostream-temp.c | 80 int fd; local 84 fd = open(".temp.istream", O_RDWR | O_CREAT | O_TRUNC, 0600); 85 if (fd == -1) 87 test_assert(write(fd, "foobar", 6) == 6); 88 test_assert(lseek(fd, 0, SEEK_SET) == 0); 90 input = i_stream_create_fd_autoclose(&fd, 1024); 91 /* a working fd-dup */ 100 /* non-working fd-dup: write data before sending istream */ 112 /* non-working fd-dup: write data after sending istream */ 124 /* non-working fd [all...] |
| /dovecot/src/lib-index/ |
| H A D | mail-index-lock.c | 26 int mail_index_lock_fd(struct mail_index *index, const char *path, int fd, argument 30 if (fd == -1) { 35 return file_wait_lock(fd, path, lock_type, index->lock_method, 40 int fd, bool locked) 50 nfs_flush_read_cache_locked(path, fd); 52 nfs_flush_read_cache_unlocked(path, fd); 39 mail_index_flush_read_cache(struct mail_index *index, const char *path, int fd, bool locked) argument
|
| H A D | mail-index-write.c | 21 if (index->fd != -1) { 24 if (fdatasync(index->fd) < 0) { 66 int ret = 0, fd; local 73 fd = mail_index_create_tmp_file(index, index->filepath, &path); 74 if (fd == -1) 77 output = o_stream_create_fd_file(fd, 0, FALSE); 93 if (fdatasync(fd) < 0) { 100 if (close(fd) < 0) {
|
| /dovecot/src/master/ |
| H A D | dup2-array.c | 26 int fd; local 62 /* it's possible that the conflicting fd was 68 fd = dup(dups[conflict].fd_src); 69 if (fd == -1) { 73 fd_close_on_exec(fd, TRUE); 74 dups[conflict].fd_src = fd;
|
| H A D | service-process-notify.c | 14 int fd; member in struct:service_process_notify 21 service_process_notify_init(int fd, argument 27 notify->fd = fd; 63 if (notify->write_callback(notify->fd, process) < 0) { 90 if (notify->write_callback(notify->fd, process) < 0) { 95 notify->io_write = io_add(notify->fd, IO_WRITE,
|
| /dovecot/src/lib-storage/index/imapc/ |
| H A D | imapc-mail.h | 19 int fd; member in struct:imapc_mail
|
| /dovecot/src/log/ |
| H A D | doveadm-connection.c | 16 int fd; member in struct:doveadm_connection 60 void doveadm_connection_create(struct log_error_buffer *errorbuf, int fd) argument 66 conn->fd = fd; 67 conn->output = o_stream_create_fd(conn->fd, (size_t)-1); 83 if (close(conn->fd) < 0)
|
| /dovecot/src/auth/ |
| H A D | auth-master-connection.h | 12 int fd; member in struct:auth_master_connection 29 auth_master_connection_create(struct auth *auth, int fd,
|
| /dovecot/src/doveadm/ |
| H A D | doveadm-dump-mailboxlog.c | 13 static int dump_record(int fd) argument 20 offset = lseek(fd, 0, SEEK_CUR); 22 ret = read(fd, &rec, sizeof(rec)); 62 int fd, ret; local 64 fd = open(argv[1], O_RDONLY); 65 if (fd < 0) 70 ret = dump_record(fd); 73 i_close_fd(&fd); 79 int fd; local 87 fd [all...] |
| /dovecot/src/util/ |
| H A D | maildirlock.c | 42 int fd[2], ret; local 50 if (pipe(fd) != 0) { 69 i_close_fd(&fd[1]); 70 ret = read(fd[0], &c, 1); 95 if (write_full(fd[1], "", 1) < 0)
|
| /dovecot/src/lib-master/ |
| H A D | master-login.h | 10 int fd; member in struct:master_login_client 40 void master_login_add(struct master_login *login, int fd);
|
| /dovecot/src/lib-old-stats/ |
| H A D | stats-connection.c | 17 int fd; member in struct:stats_connection 29 conn->fd = open(conn->path, O_WRONLY | O_NONBLOCK); 30 if (conn->fd == -1) { 64 i_close_fd_path(&conn->fd, conn->path); 80 if (conn->fd == -1) { 83 i_assert(conn->fd != -1); 93 ret = write(conn->fd, str_data(str), str_len(str)); 114 if (close(conn->fd) < 0) 116 conn->fd = -1;
|
| /dovecot/src/lib-storage/index/mbox/ |
| H A D | mbox-file.c | 18 int fd; local 28 fd = open(mailbox_get_path(&mbox->box), 30 if (fd == -1 && errno == EACCES && !mbox->backend_readonly) { 32 fd = open(mailbox_get_path(&mbox->box), O_RDONLY); 35 if (fd == -1) { 40 if (fstat(fd, &st) < 0) { 42 i_close_fd(&fd); 47 mbox->mbox_fd = fd;
|