From: Wayne Davison Date: Wed, 30 Jul 2008 00:59:08 +0000 (-0700) Subject: Make hard-linking work when a device has an st_dev of 0. X-Git-Tag: v3.0.4pre2~12 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a25aed50e637ee87c93acf904a5e22631623519f;p=thirdparty%2Frsync.git Make hard-linking work when a device has an st_dev of 0. --- diff --git a/NEWS b/NEWS index 1488c623..efddfe8f 100644 --- a/NEWS +++ b/NEWS @@ -7,6 +7,9 @@ Changes since 3.0.3: - Fixed a bug in the hard-linking code where it would sometimes try to allocate 0 bytes of memory (which fails on some OSes, such as AIX). + - Fixed the hard-linking of files from a device that has a device number + of 0 (which seems to be a common device number on NetBSD). + - Fixed a couple issues in the --fake-super handling of xattrs when the destination files have root-level attributes (e.g. selinux values) that a non-root copy can't affect. diff --git a/flist.c b/flist.c index 9b69d921..f90ae291 100644 --- a/flist.c +++ b/flist.c @@ -1213,8 +1213,8 @@ struct file_struct *make_file(const char *fname, struct file_list *flist, if (protocol_version >= 28 ? (!S_ISDIR(st.st_mode) && st.st_nlink > 1) : S_ISREG(st.st_mode)) { - tmp_dev = st.st_dev; - tmp_ino = st.st_ino; + tmp_dev = (int64)st.st_dev + 1; + tmp_ino = (int64)st.st_ino; } else tmp_dev = 0; }