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