blob: b20953ef3de00c75d81e762cf37ab27a12d6d5cd [file] [log] [blame]
Brad Bishopd7bf8c12018-02-25 22:55:05 -05001Upstream-Status: Inappropriate [1]
2
3[1] Not the author, the patch is from:
4http://vault.centos.org/5.8/os/SRPMS/rdist-6.1.5-44.src.rpm
5
6--- rdist-6.1.5/src/filesys.c.stat64 2005-05-04 14:11:03.000000000 +0200
7+++ rdist-6.1.5/src/filesys.c 2005-05-04 14:11:10.000000000 +0200
8@@ -430,8 +430,8 @@
9 */
10 int getfilesysinfo(file, freespace, freefiles)
11 char *file;
12- long *freespace;
13- long *freefiles;
14+ fsblkcnt_t *freespace;
15+ fsfilcnt_t *freefiles;
16 {
17 #if defined(STATFS_TYPE)
18 static statfs_t statfsbuf;
19--- rdist-6.1.5/src/server.c.stat64 2005-05-04 14:11:23.000000000 +0200
20+++ rdist-6.1.5/src/server.c 2005-05-04 14:20:34.000000000 +0200
21@@ -62,8 +62,8 @@
22 int catname = 0; /* cat name to target name */
23 char *sptarget[32]; /* stack of saved ptarget's for directories */
24 char *fromhost = NULL; /* Client hostname */
25-static long min_freespace = 0; /* Minimium free space on a filesystem */
26-static long min_freefiles = 0; /* Minimium free # files on a filesystem */
27+static fsblkcnt_t min_freespace = 0; /* Minimium free space on a filesystem */
28+static fsfilcnt_t min_freefiles = 0; /* Minimium free # files on a filesystem */
29 int oumask; /* Old umask */
30
31 /*
32@@ -1326,7 +1326,7 @@
33 fatalerr("Expected digit, got '%s'.", cp);
34 return;
35 }
36- min_freespace = (unsigned long) atoi(cp);
37+ min_freespace = (fsblkcnt_t) atoll(cp);
38 break;
39
40 case SC_FREEFILES: /* Minimium free files */
41@@ -1334,7 +1334,7 @@
42 fatalerr("Expected digit, got '%s'.", cp);
43 return;
44 }
45- min_freefiles = (unsigned long) atoi(cp);
46+ min_freefiles = (fsfilcnt_t) atoll(cp);
47 break;
48
49 case SC_LOGGING: /* Logging options */
50@@ -1364,7 +1364,8 @@
51 time_t mtime, atime;
52 char *owner, *group, *file;
53 char new[MAXPATHLEN];
54- long freespace = -1, freefiles = -1;
55+ fsfilcnt_t freefiles = -1;
56+ fsblkcnt_t freespace = -1;
57 char *cp = cmd;
58
59 /*
60@@ -1499,7 +1500,7 @@
61 */
62 if (min_freespace || min_freefiles) {
63 /* Convert file size to kilobytes */
64- long fsize = (long) (size / 1024);
65+ fsblkcnt_t fsize = (fsblkcnt_t) (size / 1024);
66
67 if (getfilesysinfo(target, &freespace, &freefiles) != 0)
68 return;
69@@ -1511,14 +1512,14 @@
70 if (min_freespace && (freespace >= 0) &&
71 (freespace - fsize < min_freespace)) {
72 error(
73- "%s: Not enough free space on filesystem: min %d free %d",
74+ "%s: Not enough free space on filesystem: min %lld free %lld",
75 target, min_freespace, freespace);
76 return;
77 }
78 if (min_freefiles && (freefiles >= 0) &&
79 (freefiles - 1 < min_freefiles)) {
80 error(
81- "%s: Not enough free files on filesystem: min %d free %d",
82+ "%s: Not enough free files on filesystem: min %lld free %lld",
83 target, min_freefiles, freefiles);
84 return;
85 }