search for: is_device

Displaying 20 results from an estimated 27 matches for "is_device".

Did you mean: im_device
2010 Jun 15
3
about rsyncing of block devices
...atic int try_dests_reg(struct file_str do { pathjoin(cmpbuf, MAXPATHLEN, basis_dir[j], fname); - if (link_stat(cmpbuf, &sxp->st, 0) < 0 || !S_ISREG(sxp->st.st_mode)) + if (link_stat(cmpbuf, &sxp->st, 0) < 0 || !(S_ISREG(sxp->st.st_mode) || (copy_devices && IS_DEVICE(sxp->st.st_mode)))) continue; switch (match_level) { case 0: @@ -1695,7 +1696,7 @@ static void recv_generator(char *fname, goto cleanup; } - if (!S_ISREG(file->mode)) { + if (!(S_ISREG(file->mode) || (copy_devices && IS_DEVICE(file->mode)))) { if (solo_file)...
2009 Oct 15
1
PATCH: --write-devices to allow synchronising to a block device
...preserve_hard_links; extern int preserve_executability; @@ -1733,7 +1734,7 @@ fnamecmp = fname; fnamecmp_type = FNAMECMP_FNAME; - if (statret == 0 && !S_ISREG(sx.st.st_mode)) { + if (statret == 0 && !(S_ISREG(sx.st.st_mode) || (write_devices && IS_DEVICE(sx.st.st_mode)))) { if (delete_item(fname, sx.st.st_mode, del_opts | DEL_FOR_FILE) != 0) goto cleanup; statret = -1; diff -ru rsync-3.0.6/options.c rsync-3.0.6-writedev/options.c --- rsync-3.0.6/options.c 2009-04-13 08:01:14.000000000 +1...
2012 Apr 04
0
bug in rsync write-devices patch
...rsync -write-devices -inplace rsync://10.10.10.1/share/drive.img /dev/sdb3 I used to get a 'rsync: ftruncate failed on "/dev/sdb3": Invalid argument (22)' error. The problem seems to be rooted in line 135 of write-devices.diff (from the rsync-patches repo). Namely, I believe !IS_DEVICE(file->mode) is checking the mode of the source file, not the destination, which is what it should check. I wrote a hack to check if fd corresponds to a device instead (simple code changes below), which seemed to make things work although it should be coded more cleanly. Thanks. Ryan Inform...
2023 May 17
1
[PATCH] Add --omit-{device,special}-times options
...@ -482,7 +484,12 @@ int unchanged_attrs(const char *fname, struct file_struct *file, stat_x *sxp) return 0; #endif } else { - if (preserve_mtimes && any_time_differs(sxp, file, fname)) + int keep_time = !preserve_mtimes ? 0 + : S_ISDIR(file->mode) ? !omit_dir_times + : IS_DEVICE(file->mode) ? !omit_device_times + : IS_SPECIAL(file->mode) ? !omit_special_times + : 1; + if (keep_time && any_time_differs(sxp, file, fname)) return 0; if (perms_differ(file, sxp)) return 0; @@ -509,6 +516,8 @@ void itemize(const char *fnamecmp, struct file_str...
2004 Apr 08
4
Device majors incorrectly set to 0 during rsync
OK. Didn't see anything about this in the archives, other than an old post from 2000 about a similar problem, so here goes. Feel free to contact me if I can provide anything else useful. Problem: -------- Major numbers on 64bit Solaris are being dropped, and created as 0 on recieving end. 32bit version works perfectly. Environment: ------------ Solaris 8 or Solaris 9 (haven't tried
2023 May 17
1
[PATCH] Fix the counting of device files and symlinks
...rsync-3.2.7/delete.c devel-3.2.7/delete.c --- rsync-3.2.7/delete.c 2020-06-13 20:15:02.000000000 -0600 +++ devel-3.2.7/delete.c 2020-06-13 20:15:02.000000000 -0600 @@ -188,7 +188,7 @@ enum delret delete_item(char *fbuf, uint16 mode, uint16 flags) stats.deleted_symlinks++; #endif else if (IS_DEVICE(mode)) - stats.deleted_symlinks++; + stats.deleted_devices++; else stats.deleted_specials++; } diff -aNpRruz -X /etc/diff.excludes rsync-3.2.7/flist.c devel-3.2.7/flist.c --- rsync-3.2.7/flist.c 2022-10-02 10:54:54.000000000 -0600 +++ devel-3.2.7/flist.c 2022-10-02 10:54:54.000000...
2009 Aug 12
1
do_umount adjustment
Here's one final (I hope) question without a complete patch. Given that I already ensure that stubs.c invokes REQUIRE_ROOT_OR_RESOLVE_DEVICE just before calling do_umount, does this new version of do_umount look ok? /* Again, use the external /bin/umount program, so that /etc/mtab * is kept updated. */ int do_umount (const char *pathordevice) { int r; char *err; char *buf =
2005 May 31
0
[Bug 2758] New: "File exists" error using options -b and --backup-dir with device files.
...into a parallel directory tree. */ static int keep_backup(char *fname) { - STRUCT_STAT st; + STRUCT_STAT st, bufst; struct file_struct *file; char *buf; int kept = 0; @@ -190,6 +190,12 @@ /* Check to see if this is a device file, or link */ if (IS_DEVICE(file->mode)) { if (am_root && preserve_devices) { + /* delete backup_dir destination device if it exists */ + if (do_stat(buf, &bufst) == 0 && IS_DEVICE(bufst.st_mode)) { + if (do_unlink...
2008 Mar 02
3
congrats!
Thanks Wayne and everybody, This is a huge boost to have a modern rsync for OSX. We're all grateful. Rob D PS I did notice that we lost the bsd flags test in 3.0. It was ok in pre10.... thanks again bbouncer Verifying: basic-permissions ... ok Verifying: timestamps ... Sub-test: modification time ... ok ok Verifying: symlinks ... ok Verifying:
2009 Aug 12
23
[PATCH 0/23] factor and const-correctness
This started as a simple warning-elimination change. I'll get back to that series shortly ;-) It turned into a factorization and constification exercise during which I got a taste of ocaml. Thanks to Rich Jones for help with a few snippets in generator.ml. The overall result is that many previously-manually-maintained bits from daemon/*.c functions are now hoisted into the automatically-
2017 Aug 03
0
[PATCH 3/6] daemon: Refine check for Device and Dev_or_Path parameters (RHBZ#1477623).
For Device parameters we expect a block device name. However we were only testing for "/dev/..." and so chardevs (from the appliance) could be passed here, resulting in strange effects. This adds a function is_device_parameter which tests for a valid block device name. For Dev_or_Path parameters much the same, except we can also use the is_device_parameter function elsewhere in the daemon to distinguish if we were called with a device or path parameter. Previously we used a simple test if the path begins with...
2004 Jan 24
2
[PATCH] --links-depth for rsync
...amp;& st->st_nlink > 1) { + if (!file->link_u.idev) { + if (!(file->link_u.idev = new(struct idev))) + out_of_memory("file inode data"); + } + file->F_DEV = st->st_dev; + file->F_INODE = st->st_ino; + } + } +#ifdef HAVE_STRUCT_STAT_ST_RDEV + if (IS_DEVICE(st->st_mode)) + file->u.rdev = st->st_rdev; +#endif +} + +#if SUPPORT_LINKS +void links_depth(struct string_area **ap, struct file_struct * file) +{ + char currbuf[MAXPATHLEN], linkbuf[MAXPATHLEN]; + STRUCT_STAT st; + int i; + + memset(currbuf, 0, MAXPATHLEN); + memset(linkbuf, 0, MAXPATH...
2020 Jun 10
2
Delta-compression and --write-devices
...ok a look at the code and it seems that stat?ing a device returns size 0 on Linux/Matt?s computer. There is code in receiver.c to compensate for this: /* On Linux systems (at least), st_size is typically 0 for devices. * If so, try to determine the actual device size. */ if (fd1 != -1 && IS_DEVICE(st.st_mode) && st.st_size == 0) { OFF_T off = lseek(fd1, 0, SEEK_END); if (off == (OFF_T) -1) rsyserr(FERROR, errno, "failed to seek to end of %s to determine size", fname); else { st.st_size = off; off = lseek(fd1, 0, SEEK_SET); if (off != 0) rsyserr(FERROR, errno, "failed...
2008 May 08
1
Patch to not modify files in place unless "--inplace" option specified
...the + * items that the old --remove-sent-files option would + * remove. */ + if ((iflags & ITEM_REPORT_CHANGE) ? remove_source_files + : remove_source_files == 1) goto return_with_success; } #endif @@ -1592,6 +1605,7 @@ if ((am_root && preserve_devices && IS_DEVICE(file->mode)) || (preserve_specials && IS_SPECIAL(file->mode))) { + int iflags = 0; uint32 *devp = F_RDEV_P(file); dev_t rdev = MAKEDEV(DEV_MAJOR(devp), DEV_MINOR(devp)); if (statret == 0) { @@ -1609,7 +1623,15 @@ && BITS_EQUAL(sx.st.st_mode, file->mode, _S...
2009 Apr 20
6
DO NOT REPLY [Bug 6280] New: (Bug incl. PATCH) Linux mknod does not work when syncing fifos and sockets from Solaris
https://bugzilla.samba.org/show_bug.cgi?id=6280 Summary: (Bug incl. PATCH) Linux mknod does not work when syncing fifos and sockets from Solaris Product: rsync Version: 3.0.6 Platform: x64 OS/Version: Linux Status: NEW Severity: normal Priority: P3 Component: core AssignedTo:
2002 Aug 05
5
[patch] read-devices
...statret == -1 && errno == ENOENT) { /* we only want to update existing files */ if (verbose > 1) rprintf(FINFO, "not creating new file \"%s\"\n",fname); @@ -337,9 +339,9 @@ return; } #ifdef HAVE_MKNOD - if (am_root && preserve_devices && IS_DEVICE(file->mode)) { + if (!read_devices && am_root && preserve_devices && IS_DEVICE(file->mode)) { if (statret != 0 || st.st_mode != file->mode || st.st_rdev != file->rdev) { delete_file(fname); @@ -361,15 +363,23 @@ #endif if (preserve_har...
2008 Feb 15
4
Revised flags patch
...#endif @@ -403,6 +407,12 @@ static void send_file_entry(int f, struc xflags |= XMIT_SAME_MODE; else mode = file->mode; +#ifdef SUPPORT_FLAGS + if (F_FFLAGS(file) == fileflags) + xflags |= XMIT_SAME_FLAGS; + else + fileflags = F_FFLAGS(file); +#endif if ((preserve_devices && IS_DEVICE(mode)) || (preserve_specials && IS_SPECIAL(mode))) { @@ -522,6 +532,10 @@ static void send_file_entry(int f, struc } if (!(xflags & XMIT_SAME_MODE)) write_int(f, to_wire_mode(mode)); +#ifdef SUPPORT_FLAGS + if (fileflags_ndx && !(xflags & XMIT_SAME_FLAGS)) + write...
2016 Mar 06
8
[PATCH 0/5] Use less stack.
Various changes/fixes to use smaller stack frames. Rich.
2012 Aug 30
2
[PATCH v2] daemon: collect list of called external commands
...h" +GUESTFSD_EXT_CMD(str_compress, compress); +GUESTFSD_EXT_CMD(str_gzip, gzip); +GUESTFSD_EXT_CMD(str_bzip2, bzip2); +GUESTFSD_EXT_CMD(str_xz, xz); +GUESTFSD_EXT_CMD(str_lzop, lzop); + /* Has one FileOut parameter. */ static int do_compressX_out (const char *file, const char *filter, int is_device) @@ -118,15 +124,15 @@ get_filter (const char *ctype, int level, char *ret, size_t n) reply_with_error ("compress: cannot use optional level parameter with this compression type"); return -1; } - snprintf (ret, n, "compress -c"); + snprintf (ret, n, &quo...
2016 Mar 07
2
[PATCH v2] Use less stack.
..._CHUNK_SIZE, fp)) > 0) { if (send_file_write (str, r) < 0) { pclose (fp); diff --git a/daemon/compress.c b/daemon/compress.c index b00be3e..36f4e66 100644 --- a/daemon/compress.c +++ b/daemon/compress.c @@ -40,7 +40,13 @@ do_compressX_out (const char *file, const char *filter, int is_device) int r; FILE *fp; CLEANUP_FREE char *cmd = NULL; - char buf[GUESTFS_MAX_CHUNK_SIZE]; + CLEANUP_FREE char *buf = NULL; + + buf = malloc (GUESTFS_MAX_CHUNK_SIZE); + if (buf == NULL) { + reply_with_perror ("malloc"); + return -1; + } /* The command will look somethin...