=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/rsync/flist.c,v retrieving revision 1.16 retrieving revision 1.17 diff -c -r1.16 -r1.17 *** src/usr.bin/rsync/flist.c 2019/02/16 10:49:37 1.16 --- src/usr.bin/rsync/flist.c 2019/02/16 16:25:45 1.17 *************** *** 1,4 **** ! /* $Id: flist.c,v 1.16 2019/02/16 10:49:37 florian Exp $ */ /* * Copyright (c) 2019 Kristaps Dzonsons * Copyright (c) 2019 Florian Obser --- 1,4 ---- ! /* $Id: flist.c,v 1.17 2019/02/16 16:25:45 florian Exp $ */ /* * Copyright (c) 2019 Kristaps Dzonsons * Copyright (c) 2019 Florian Obser *************** *** 346,351 **** --- 346,363 ---- } } + /* Conditional part: devices & special files. */ + + if ((sess->opts->devices && (S_ISBLK(f->st.mode) || + S_ISCHR(f->st.mode))) || + (sess->opts->specials && (S_ISFIFO(f->st.mode) || + S_ISSOCK(f->st.mode)))) { + if (!io_write_int(sess, fdout, f->st.rdev)) { + ERRX1(sess, "io_write_int"); + goto out; + } + } + /* Conditional part: link. */ if (S_ISLNK(f->st.mode) && *************** *** 362,375 **** } } - if (S_ISBLK(f->st.mode) || S_ISCHR(f->st.mode) || - S_ISFIFO(f->st.mode) || S_ISSOCK(f->st.mode)) { - if (!io_write_int(sess, fdout, f->st.rdev)) { - ERRX1(sess, "io_write_int"); - goto out; - } - } - if (S_ISREG(f->st.mode)) sess->total_size += f->st.size; } --- 374,379 ---- *************** *** 682,691 **** ff->st.gid = fflast->st.gid; } ! /* handle devices & special files*/ if ((sess->opts->devices && (S_ISBLK(ff->st.mode) || ! S_ISCHR(ff->st.mode))) || (sess->opts->specials && (S_ISFIFO(ff->st.mode) || S_ISSOCK(ff->st.mode)))) { if (!(FLIST_RDEV_SAME & flag)) { --- 686,695 ---- ff->st.gid = fflast->st.gid; } ! /* Conditional part: devices & special files. */ if ((sess->opts->devices && (S_ISBLK(ff->st.mode) || ! S_ISCHR(ff->st.mode))) || (sess->opts->specials && (S_ISFIFO(ff->st.mode) || S_ISSOCK(ff->st.mode)))) { if (!(FLIST_RDEV_SAME & flag)) { *************** *** 695,701 **** } ff->st.rdev = ival; } else if (fflast == NULL) { ! ERRX(sess, "same mode without last entry"); goto out; } else ff->st.rdev = fflast->st.rdev; --- 699,705 ---- } ff->st.rdev = ival; } else if (fflast == NULL) { ! ERRX(sess, "same device without last entry"); goto out; } else ff->st.rdev = fflast->st.rdev;