Lines Matching defs:fd

82 void sync_quit(int fd)
89 writex(fd, &msg.req, sizeof(msg.req));
94 int sync_ls(int fd, const char *path, sync_ls_cb func, void *cookie)
106 if(writex(fd, &msg.req, sizeof(msg.req)) ||
107 writex(fd, path, len)) {
112 if(readx(fd, &msg.dent, sizeof(msg.dent))) break;
119 if(readx(fd, buf, len)) break;
129 adb_close(fd);
143 int sync_readtime(int fd, const char *path, unsigned int *timestamp,
152 if(writex(fd, &msg.req, sizeof(msg.req)) ||
153 writex(fd, path, len)) {
157 if(readx(fd, &msg.stat, sizeof(msg.stat))) {
170 static int sync_start_readtime(int fd, const char *path)
178 if(writex(fd, &msg.req, sizeof(msg.req)) ||
179 writex(fd, path, len)) {
186 static int sync_finish_readtime(int fd, unsigned int *timestamp,
191 if(readx(fd, &msg.stat, sizeof(msg.stat)))
204 int sync_readmode(int fd, const char *path, unsigned *mode)
212 if(writex(fd, &msg.req, sizeof(msg.req)) ||
213 writex(fd, path, len)) {
217 if(readx(fd, &msg.stat, sizeof(msg.stat))) {
229 static int write_data_file(int fd, const char *path, syncsendbuf *sbuf, int show_progress)
267 if(writex(fd, sbuf, sizeof(unsigned) * 2 + ret)){
282 static int write_data_buffer(int fd, char* file_buffer, int size, syncsendbuf *sbuf,
297 if(writex(fd, sbuf, sizeof(unsigned) * 2 + count)){
313 static int write_data_link(int fd, const char *path, syncsendbuf *sbuf)
327 ret = writex(fd, sbuf, sizeof(unsigned) * 2 + len + 1);
337 static int sync_send(int fd, const char *lpath, const char *rpath,
356 if(writex(fd, &msg.req, sizeof(msg.req)) ||
357 writex(fd, rpath, len) || writex(fd, tmp, r)) {
363 write_data_buffer(fd, file_buffer, size, sbuf, show_progress);
366 write_data_file(fd, lpath, sbuf, show_progress);
369 write_data_link(fd, lpath, sbuf);
376 if(writex(fd, &msg.data, sizeof(msg.data)))
379 if(readx(fd, &msg.status, sizeof(msg.status)))
386 if(readx(fd, sbuf->data, len)) {
401 adb_close(fd);
424 int sync_recv(int fd, const char *rpath, const char *lpath, int show_progress)
442 if (writex(fd, &stat_msg.req, sizeof(stat_msg.req)) ||
443 writex(fd, rpath, len)) {
447 if (readx(fd, &stat_msg.stat, sizeof(stat_msg.stat))) {
458 if(writex(fd, &msg.req, sizeof(msg.req)) ||
459 writex(fd, rpath, len)) {
463 if(readx(fd, &msg.data, sizeof(msg.data))) {
482 if(readx(fd, &msg.data, sizeof(msg.data))) {
497 if(readx(fd, buffer, len)) {
525 if(readx(fd, buffer, len)) {
551 int fd = adb_connect("sync:");
552 if(fd < 0) {
557 if(sync_ls(fd, path, do_sync_ls_cb, 0)) {
560 sync_quit(fd);
685 static int copy_local_dir_remote(int fd, const char *lpath, const char *rpath, int checktimestamps, int listonly)
714 if(sync_start_readtime(fd, ci->dst)) {
720 if(sync_finish_readtime(fd, &timestamp, &mode, &size))
735 sync_send(fd, ci->src, ci->dst, ci->time, ci->mode,
758 int fd;
760 fd = adb_connect("sync:");
761 if(fd < 0) {
768 sync_quit(fd);
774 if(copy_local_dir_remote(fd, lpath, rpath, 0, 0)) {
778 sync_quit(fd);
781 if(sync_readmode(fd, rpath, &mode)) {
801 if(sync_send(fd, lpath, rpath, st.st_mtime, st.st_mode, show_progress)) {
805 sync_quit(fd);
896 static int copy_remote_dir_local(int fd, const char *rpath, const char *lpath,
923 if (remote_build_list(fd, &filelist, rpath, lpath)) {
931 if (sync_recv(fd, ci->src, ci->dst, 0 /* no show progress */)) {
957 int fd;
959 fd = adb_connect("sync:");
960 if(fd < 0) {
965 if(sync_readtime(fd, rpath, &time, &mode)) {
993 if (sync_recv(fd, rpath, lpath, show_progress)) {
999 sync_quit(fd);
1004 if (copy_remote_dir_local(fd, rpath, lpath, copy_attrs)) {
1008 sync_quit(fd);
1021 int fd = adb_connect("sync:");
1022 if(fd < 0) {
1028 if(copy_local_dir_remote(fd, lpath, rpath, 1, listonly)){
1032 sync_quit(fd);