search for: do_fstat

Displaying 15 results from an estimated 15 matches for "do_fstat".

Did you mean: diffstat
2007 May 14
0
[PATCH] Adds support for Append command (SSH_FXF_APPEND) to sftp_client
...SSH2_FXF_APPEND flag. 3) write_to_remote_file It is like the "do_upload" function, expect that the offset does not start with a '0' but it is set to the value returned by "stat_remote_file". More in depth I have use the function "do_fstat" to retrive remote_file size. The function "do_fstat" is never used, but is still present, in the "sftp-client.c" ... so why not to use it ? I hope this patch will be included in future release of OpenSSH, or at least that you will consider to reimplement it in a better...
2012 Apr 04
0
bug in rsync write-devices patch
...f((inplace #ifdef PREALLOCATE_NEEDS_TRUNCATE || preallocated_len > offset #endif ) && fd != -1 && !IS_DEVICE(file->mode) && do_ftruncate(fd, offset) < 0) { Code after change: #ifdef HAVE_TRUNCATE { STRUCT_STAT st; Do_fstat(fd, &st); If((inplace #ifdef PREALLOCATE_NEEDS_TRUNCATE || preallocated_len > offset #endif ) && fd != -1 && !IS_DEVICE(st.st_mode) && do_ftruncate(fd, offset) < 0) { -------------- next part -------------- An HTML attachment was s...
2009 Oct 15
1
PATCH: --write-devices to allow synchronising to a block device
...@@ goto report_write_error; #ifdef HAVE_FTRUNCATE - if (inplace && fd != -1 - && ftruncate(fd, offset) < 0) { - rsyserr(FERROR_XFER, errno, "ftruncate failed on %s", - full_fname(fname)); + (void)do_fstat(fd,&st); + /* Makes no sense to attempt to ftruncate() a block device: */ + if (!(IS_DEVICE(st.st_mode))) { + if (inplace && fd != -1 + && ftruncate(fd, offset) < 0) { + rsyserr(FERROR_XFER, errno, "ftrunca...
2002 Jan 07
0
rsync-2.5.1 / updated syscall.c "const" patch
...stat64(fname, st); #else return stat(fname, st); @@ -148,7 +151,7 @@ #if SUPPORT_LINKS int do_lstat(const char *fname, STRUCT_STAT *st) { -#if HAVE_OFF64_T +#ifdef HAVE_OFF64_T return lstat64(fname, st); #else return lstat(fname, st); @@ -158,7 +161,7 @@ int do_fstat(int fd, STRUCT_STAT *st) { -#if HAVE_OFF64_T +#ifdef HAVE_OFF64_T return fstat64(fd, st); #else return fstat(fd, st); @@ -167,7 +170,7 @@ OFF_T do_lseek(int fd, OFF_T offset, int whence) { -#if HAVE_OFF64_T +#ifdef HAVE_OFF64_T off64_t lseek64(); return...
2005 Jan 05
1
rsync filename heuristics
...> + } > + > + if (fd == -1 && compare_dest != NULL) > + fd = open_alternate_base_comparedir(fname); > > + if (fd == -1 && fuzzy) > + fd = open_alternate_base_fuzzy(fname); > + > + /* Update stat to understand size */ > + if (fd != -1) { > + if (do_fstat(fd, st) != 0) > + rprintf(FERROR,"fstat %s : %s\n",fname,strerror(errno)); > + } > + > + return fd; > +} > > /* > * Acts on file number I from FLIST, whose name is fname. > @@ -203,9 +258,6 @@ > struct sum_struct *s; > int statret; > struct...
2004 Apr 11
1
fchmod in do_mkstemp? (patch included)
...me(char *fname1, char *fname2); void trim_trailing_slashes(char *name); int do_mkdir(char *fname, mode_t mode); -int do_mkstemp(char *template, mode_t perms); +int do_mkstemp(char *template); int do_stat(const char *fname, STRUCT_STAT *st); int do_lstat(const char *fname, STRUCT_STAT *st); int do_fstat(int fd, STRUCT_STAT *st); Index: receiver.c =================================================================== RCS file: /cvsroot/rsync/receiver.c,v retrieving revision 1.75 diff -u -w -r1.75 receiver.c --- receiver.c 23 Mar 2004 16:50:40 -0000 1.75 +++ receiver.c 10 Apr 2004 23:48:36 -0000 @@ -42...
2010 Jun 15
3
about rsyncing of block devices
Hiya, I can see it's a regular subject on this list. I, like others wanted to use rsync to synchronise two block devices (as it happens one lvm volume and one nbd device served by qemu-img on a remote host from a qcow2 disk image so that I can keep the old versions) As I couldn't find any report of it being done successfully, I'm just sharing my findings as it might benefit others.
2004 Apr 15
0
Multiple compare-dest args
...;& compare_dest[j] != NULL) { /* try the file at compare_dest instead */ pathjoin(fnamecmpbuf, sizeof fnamecmpbuf, - compare_dest, fname); + compare_dest[j], fname); fnamecmp = fnamecmpbuf; fd1 = do_open(fnamecmp, O_RDONLY, 0); + j++; } if (fd1 != -1 && do_fstat(fd1,&st) != 0) { diff -ru rsync-2.6.1pre-1/rsync.h rsync-2.6.1pre-1-vidar/rsync.h --- rsync-2.6.1pre-1/rsync.h 2004-03-06 08:43:55.000000000 +0100 +++ rsync-2.6.1pre-1-vidar/rsync.h 2004-04-15 11:42:33.000000000 +0200 @@ -97,6 +97,8 @@ #define MAX_ARGS 1000 +#define MAX_COMP_DEST 20 + #de...
2003 Oct 30
2
sftp client reget reput
...g, SSH2_FXF_WRITE|SSH2_FXF_CREAT|SSH2_FXF_TRUNC); encode_attrib(&msg, &a); send_msg(conn->fd_out, &msg); @@ -1041,7 +1074,44 @@ data = xmalloc(conn->transfer_buflen); /* Read from local and write to remote */ +#ifdef REGET + if(rflag) { + Attrib *attrs; + if (!(attrs = do_fstat(conn, handle, handle_len, 0))) { + error("read size of \"%s\": %s", + local_path, strerror(errno)); + close(local_fd); + buffer_free(&msg); + return(-1); + } + if (!(attrs->flags & SSH2_FILEXFER_ATTR_SIZE)) { + error("read size of %s: size was not...
2003 Feb 22
1
rsync ported to BeOS-bone
...receiver.c Thu Feb 20 20:28:14 2003 @@ -203,7 +203,7 @@ } -static int receive_data(int f_in,struct map_struct *buf,int fd,char *fname, +static int recv_data(int f_in,struct map_struct *buf,int fd,char *fname, OFF_T total_size) { int i; @@ -383,14 +383,14 @@ if (fd1 != -1 && do_fstat(fd1,&st) != 0) { rprintf(FERROR,"fstat %s : %s\n",fnamecmp,strerror(errno)); - receive_data(f_in,NULL,-1,NULL,file->length); + recv_data(f_in,NULL,-1,NULL,file->length); close(fd1); continue; } if (fd1 != -1 && !S_ISREG(st.st_mode)) { rprintf(...
2004 Feb 09
1
[patch] Add `--link-by-hash' option.
...d_buf(f_in,file_sum2,MD4_SUM_LENGTH); if (verbose > 2) { @@ -351,6 +361,7 @@ extern int preserve_perms; extern int delete_after; extern int orig_umask; + extern char *link_by_hash_dir; struct stats initial_stats; if (verbose > 2) { @@ -416,7 +427,7 @@ if (fd1 != -1 && do_fstat(fd1,&st) != 0) { rprintf(FERROR, "fstat %s failed: %s\n", full_fname(fnamecmp), strerror(errno)); - receive_data(f_in,NULL,-1,NULL,file->length); + receive_data(f_in,NULL,-1,NULL,file->length,NULL); close(fd1); continue; } @@ -429,7 +440,7 @@ */...
2004 Feb 23
0
[patch] Add `--link-by-hash' option (rev 4).
...d_buf(f_in,file_sum2,MD4_SUM_LENGTH); if (verbose > 2) { @@ -299,6 +308,7 @@ extern int preserve_perms; extern int delete_after; extern int orig_umask; + extern char *link_by_hash_dir; struct stats initial_stats; if (verbose > 2) { @@ -372,7 +382,7 @@ if (fd1 != -1 && do_fstat(fd1,&st) != 0) { rprintf(FERROR, "fstat %s failed: %s\n", full_fname(fnamecmp), strerror(errno)); - receive_data(f_in,NULL,-1,NULL,file->length); + receive_data(f_in,NULL,-1,NULL,file->length,NULL); close(fd1); continue; } @@ -385,7 +395,7 @@ */...
2004 Feb 17
0
[patch] Add `--link-by-hash' option (rev 3).
...d_buf(f_in,file_sum2,MD4_SUM_LENGTH); if (verbose > 2) { @@ -299,6 +308,7 @@ extern int preserve_perms; extern int delete_after; extern int orig_umask; + extern char *link_by_hash_dir; struct stats initial_stats; if (verbose > 2) { @@ -372,7 +382,7 @@ if (fd1 != -1 && do_fstat(fd1,&st) != 0) { rprintf(FERROR, "fstat %s failed: %s\n", full_fname(fnamecmp), strerror(errno)); - receive_data(f_in,NULL,-1,NULL,file->length); + receive_data(f_in,NULL,-1,NULL,file->length,NULL); close(fd1); continue; } @@ -385,7 +395,7 @@ */...
2004 Feb 23
0
[patch] Add `--link-by-hash' option (rev 5).
...d_buf(f_in,file_sum2,MD4_SUM_LENGTH); if (verbose > 2) { @@ -299,6 +308,7 @@ extern int preserve_perms; extern int delete_after; extern int orig_umask; + extern char *link_by_hash_dir; struct stats initial_stats; if (verbose > 2) { @@ -372,7 +382,7 @@ if (fd1 != -1 && do_fstat(fd1,&st) != 0) { rprintf(FERROR, "fstat %s failed: %s\n", full_fname(fnamecmp), strerror(errno)); - receive_data(f_in,NULL,-1,NULL,file->length); + receive_data(f_in,NULL,-1,NULL,file->length,NULL); close(fd1); continue; } @@ -385,7 +395,7 @@ */...
2004 Feb 16
1
[patch] Add `--link-by-hash' option (rev 2).
...d_buf(f_in,file_sum2,MD4_SUM_LENGTH); if (verbose > 2) { @@ -299,6 +308,7 @@ extern int preserve_perms; extern int delete_after; extern int orig_umask; + extern char *link_by_hash_dir; struct stats initial_stats; if (verbose > 2) { @@ -372,7 +382,7 @@ if (fd1 != -1 && do_fstat(fd1,&st) != 0) { rprintf(FERROR, "fstat %s failed: %s\n", full_fname(fnamecmp), strerror(errno)); - receive_data(f_in,NULL,-1,NULL,file->length); + receive_data(f_in,NULL,-1,NULL,file->length,NULL); close(fd1); continue; } @@ -385,7 +395,7 @@ */...