amd.patch

pavalos, 01/06/2007 07:30 PM

Download (7.97 KB)

View differences:

usr.sbin/amd/amd/Makefile 31 Dec 2006 22:05:37 -0000
7 7
# $DragonFly: src/usr.sbin/amd/amd/Makefile,v 1.4 2006/05/14 18:07:29 swildner Exp $
8 8
#
9 9

  
10
.PATH:		${.CURDIR}/../../../contrib/amd/amd
10
CONTRIBDIR=	${.CURDIR}/../../../contrib/amd/amd
11
.PATH:		${CONTRIBDIR}
11 12

  
12 13
PROG=		amd
13 14
MAN=		amd.8
14 15

  
15
SRCS=		conf_parse.y conf_tok.l
16
SRCS=		conf_parse.y.patch conf_tok.l.patch
16 17
SRCS+=		am_ops.c amd.c amfs_auto.c amfs_direct.c amfs_error.c
17 18
SRCS+=		amfs_host.c amfs_inherit.c amfs_link.c amfs_linkx.c amfs_nfsl.c
18 19
SRCS+=		amfs_nfsx.c amfs_program.c amfs_root.c amfs_toplvl.c
usr.sbin/amd/amd/conf_parse.y.patch 31 Dec 2006 22:32:28 -0000
1
$DragonFly$
2
--- conf_parse.y.orig	2006-12-31 17:02:18.000000000 -0500
3
+++ conf_parse.y	2006-12-31 17:04:00.000000000 -0500
4
@@ -66,7 +66,7 @@
5
 #endif /* not __GNUC__ */
6
 
7
 extern char *yytext;
8
-extern int yylineno;
9
+extern int ayylineno;
10
 extern int yylex(void);
11
 
12
 static int yyerror(const char *s);
13
@@ -78,7 +78,7 @@
14
 #define PARSE_DEBUG 0
15
 
16
 #if PARSE_DEBUG
17
-# define dprintf(f,s) fprintf(stderr, (f), yylineno, (s))
18
+# define dprintf(f,s) fprintf(stderr, (f), ayylineno, (s))
19
 # define amu_return(v)
20
 #else
21
 # define dprintf(f,s)
22
@@ -168,7 +168,7 @@
23
 yyerror(const char *s)
24
 {
25
   fprintf(stderr, "AMDCONF: %s on line %d (section %s)\n",
26
-	  s, yylineno,
27
+	  s, ayylineno,
28
 	  (header_section ? header_section : "null"));
29
   exit(1);
30
   return 1;	/* to full compilers that insist on a return statement */
usr.sbin/amd/amd/conf_tok.l.patch 31 Dec 2006 22:32:37 -0000
1
$DragonFly$
2
--- conf_tok.l.orig	2003-06-16 22:42:47.000000000 -0400
3
+++ conf_tok.l	2006-12-31 16:52:52.000000000 -0500
4
@@ -77,9 +77,10 @@
5
 # ifndef ECHO
6
 #  define ECHO (void) fwrite( yytext, yyleng, 1, yyout )
7
 # endif /* not ECHO */
8
-int yylineno = 0;
9
 #endif /* FLEX_SCANNER */
10
 
11
+int ayylineno = 0;
12
+
13
 int yylex(void);
14
 /*
15
  * some systems such as DU-4.x have a different GNU flex in /usr/bin
16
@@ -93,19 +94,25 @@
17
 #define TOK_DEBUG 0
18
 
19
 #if TOK_DEBUG
20
-# define dprintf(f,s) fprintf(stderr, (f), yylineno, (s))
21
+# define dprintf(f,s) fprintf(stderr, (f), ayylineno, (s))
22
 # define amu_return(v)
23
 #else
24
 # define dprintf(f,s)
25
 # define amu_return(v) return((v))
26
 #endif /* TOK_DEBUG */
27
 
28
-/* no need to use yyunput() or yywrap() */
29
-#define YY_NO_UNPUT
30
+/* no need to use yywrap() */
31
 #define YY_SKIP_YYWRAP
32
 
33
 %}
34
 
35
+/* This option causes Solaris lex to fail.  Use flex.  See BUGS file */
36
+/* no need to use yyunput() */
37
+%option nounput
38
+
39
+/* allocate more output slots so lex scanners don't run out of mem */
40
+%o 1024
41
+
42
 DIGIT		[0-9]
43
 ALPHA		[A-Za-z]
44
 ALPHANUM	[A-Za-z0-9]
45
@@ -119,7 +126,7 @@
46
 %%
47
 
48
 \n			{
49
-			yylineno++;
50
+			ayylineno++;
51
 			amu_return(NEWLINE);
52
 			}
53
 
54
@@ -146,7 +153,7 @@
55
 			}
56
 "#"[^\n]*\n		{
57
 			/* a comment line includes the terminating \n */
58
-			yylineno++;
59
+			ayylineno++;
60
 			yytext[strlen((char *)yytext)-1] = '\0';
61
 			dprintf("%8d: Comment \"%s\"\n", yytext);
62
 			}
usr.sbin/amd/fsinfo/Makefile 31 Dec 2006 22:28:31 -0000
7 7
# $DragonFly: src/usr.sbin/amd/fsinfo/Makefile,v 1.2 2003/06/17 04:29:52 dillon Exp $
8 8
#
9 9

  
10
.PATH:		${.CURDIR}/../../../contrib/amd/fsinfo
10
CONTRIBDIR=	${.CURDIR}/../../../contrib/amd/fsinfo
11
.PATH:		${CONTRIBDIR}
11 12

  
12 13
PROG=		fsinfo
13 14
MAN=		fsinfo.8
14 15

  
15
SRCS=		fsi_gram.y fsi_lex.l
16
SRCS=		fsinfo.h.patch fsi_gram.y fsi_lex.l.patch
16 17
SRCS+=		fsi_analyze.c fsi_dict.c fsi_util.c fsinfo.c wr_atab.c 
17 18
SRCS+=		wr_bparam.c wr_dumpset.c wr_exportfs.c wr_fstab.c
18 19

  
19
CFLAGS+=	-I${.CURDIR}/../../../contrib/amd/fsinfo
20
CFLAGS+=	-I${.OBJDIR} -I${CONTRIBDIR}
20 21

  
21
CLEANFILES+=	fsi_gram.c fsi_gram.h fsi_lex.c
22
CLEANFILES+=	fsi_gram.c fsi_gram.h fsi_lex.c fsinfo.h
22 23

  
23 24
fsi_lex.o:	fsi_gram.h
24 25

  
usr.sbin/amd/fsinfo/fsi_lex.l.patch 31 Dec 2006 22:32:47 -0000
1
$DragonFly$
2
--- fsi_lex.l.orig	2006-12-31 17:08:23.000000000 -0500
3
+++ fsi_lex.l	2006-12-31 17:12:03.000000000 -0500
4
@@ -48,8 +48,9 @@
5
  * TODO: Needs rewriting.
6
  */
7
 
8
+static int ayylineno;
9
+
10
 #ifdef FLEX_SCANNER
11
-static int yylineno;
12
 # define INIT_STATE {				\
13
 		switch ((yy_start - 1) / 2) {	\
14
 		case 0:				\
15
@@ -159,6 +160,13 @@
16
 
17
 %}
18
 
19
+/* This option causes Solaris lex to fail.  Use flex.  See BUGS file */
20
+/* no need to use yyunput() */
21
+%option nounput
22
+
23
+/* allocate more output slots so lex scanners don't run out of mem */
24
+%o 1024
25
+
26
 %start F Q
27
 
28
 %%
29
@@ -166,22 +174,22 @@
30
 
31
 <F>[^ \t\n"={}]+	{ return find_resword(yytext); } /* dummy " */
32
 <F>[ \t]		;
33
-<F>"\n"			{ yylineno++; }
34
+<F>"\n"			{ ayylineno++; }
35
 <F>[={}]		{ return *yytext; }
36
 
37
 <F>\"			{ BEGIN Q; optr = ostr; quoted = 1; }
38
-<Q>\n			{ yylineno++; yyerror("\" expected"); BEGIN F; }
39
+<Q>\n			{ ayylineno++; yyerror("\" expected"); BEGIN F; }
40
 <Q>\\b			{ *optr++ = '\b'; /* escape */ }
41
 <Q>\\t			{ *optr++ = '\t'; /* escape */ }
42
 <Q>\\\"			{ *optr++ = '\"'; /* escape */ }
43
 <Q>\\\\			{ *optr++ = '\\'; /* escape */ }
44
-<Q>\\\n			{ yylineno++; /* continue */ }
45
+<Q>\\\n			{ ayylineno++; /* continue */ }
46
 <Q>\\r			{ *optr++ = '\r'; /* escape */ }
47
 <Q>\\n			{ *optr++ = '\n'; /* escape */ }
48
 <Q>\\f			{ *optr++ = '\f'; /* escape */ }
49
 <Q>"\\ "		{ *optr++ = ' '; /* force space */ }
50
 <Q>\\.			{ yyerror("Unknown \\ sequence"); }
51
-<Q>([ \t]|"\\\n"){2,}	{ char *p = (char *) yytext-1; while ((p = strchr(p+1, '\n'))) yylineno++; }
52
+<Q>([ \t]|"\\\n"){2,}	{ char *p = (char *) yytext-1; while ((p = strchr(p+1, '\n'))) ayylineno++; }
53
 <Q>\"			{ BEGIN F; quoted = 0;
54
 				*optr = '\0';
55
 				yylval.s = strdup(ostr);
56
@@ -235,12 +243,11 @@
57
 
58
   va_start(ap, fmt);
59
   col_cleanup(0);
60
-  fprintf(stderr, "%s:%d: ", fsi_filename ? fsi_filename : "/dev/stdin", yylineno);
61
-  fprintf(stderr, fmt, ap);
62
+  fprintf(stderr, "%s:%d: ", fsi_filename ? fsi_filename : "/dev/stdin", ayylineno);
63
+  vfprintf(stderr, fmt, ap);
64
   fputc('\n', stderr);
65
   parse_errors++;
66
   va_end(ap);
67
-  if (0) unput(0);/* dummy to shut gcc up: "unput defined but not used" */
68
   return 0;
69
 }
70
 
71
@@ -249,7 +256,7 @@
72
 current_location(void)
73
 {
74
   ioloc *ip = CALLOC(struct ioloc);
75
-  ip->i_line = yylineno;
76
+  ip->i_line = ayylineno;
77
   ip->i_file = fsi_filename;
78
   return ip;
79
 }
usr.sbin/amd/fsinfo/fsinfo.h.patch 31 Dec 2006 22:32:57 -0000
1
$DragonFly$
2
--- fsinfo.h.orig	2006-12-31 17:23:10.000000000 -0500
3
+++ fsinfo.h	2006-12-31 17:23:56.000000000 -0500
4
@@ -109,7 +109,6 @@
5
  */
6
 #ifndef yywrap
7
 extern int yywrap(void);
8
-# define yywrap() 1
9
 #endif /* not yywrap */
10
 extern int yyparse(void);
11
 extern int write_atab(qelem *q);