File: Hurd-MAXPATHLEN-workaround.patch

package info (click to toggle)
cron 3.0pl1-197
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 3,816 kB
  • sloc: ansic: 54,879; xml: 1,600; perl: 733; sh: 463; makefile: 446; python: 43
file content (47 lines) | stat: -rw-r--r-- 1,210 bytes parent folder | download | duplicates (3)
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
From: Christian Kastner <ckk@kvr.at>
Date: Sun, 20 Dec 2015 12:36:14 +0100
Subject: Hurd MAXPATHLEN workaround

Hurd does not define MAXPATHLEN.

Fix provided by Steve Greenland <stevegr@debian.org>.

Bug-Debian: https://bugs.debian.org/64382
Forwarded: no
Last-Update: 2015-12-20
---
 database.c | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)

diff --git a/database.c b/database.c
index 843401e..879aaaa 100644
--- a/database.c
+++ b/database.c
@@ -31,6 +31,18 @@ static char rcsid[] = "$Id: database.c,v 2.8 1994/01/15 20:43:43 vixie Exp $";
 
 #define TMAX(a,b) ((a)>(b)?(a):(b))
 
+/* Try to get maximum path name -- this isn't really correct, but we're
+going to be lazy */
+
+#ifndef PATH_MAX
+
+#ifdef MAXPATHLEN
+#define PATH_MAX MAXPATHLEN
+#else
+#define PATH_MAX 2048
+#endif
+
+#endif /* ifndef PATH_MAX */
 
 static	void		process_crontab __P((char *, char *, char *,
 					     struct stat *,
@@ -102,7 +114,7 @@ load_database(old_db)
 
 	while (NULL != (dp = readdir(dir))) {
 		char	fname[MAXNAMLEN+1],
-			tabname[MAXNAMLEN+1];
+			tabname[PATH_MAX+1];
 
 		/* avoid file names beginning with ".".  this is good
 		 * because we would otherwise waste two guaranteed calls