]>
Commit | Line | Data |
---|---|---|
c5c90608 | 1 | diff -Nru at-3.1.8/at.1.in at-3.1.8.new/at.1.in |
2 | --- at-3.1.8/at.1.in Sun Mar 28 19:48:00 1999 | |
3 | +++ at-3.1.8.new/at.1.in Sun Mar 28 19:46:41 1999 | |
4 | @@ -248,7 +248,11 @@ | |
5 | .br | |
6 | .I @ETCDIR@/at.deny | |
7 | .SH SEE ALSO | |
8 | -cron(1), nice(1), sh(1), umask(2), atd(8) | |
9 | +.BR cron (1), | |
10 | +.BR nice (1), | |
11 | +.BR sh (1), | |
12 | +.BR umask (2), | |
13 | +.BR atd (8). | |
14 | .SH BUGS | |
15 | The correct operation of | |
16 | .B batch | |
17 | diff -Nru at-3.1.8/at.c at-3.1.8.new/at.c | |
18 | --- at-3.1.8/at.c Sun Mar 28 19:48:00 1999 | |
19 | +++ at-3.1.8.new/at.c Sun Mar 28 19:46:41 1999 | |
20 | @@ -235,6 +235,7 @@ | |
21 | /* Install the signal handler for SIGINT; terminate after removing the | |
22 | * spool file if necessary | |
23 | */ | |
24 | + memset(&act, 0, sizeof act); | |
25 | act.sa_handler = sigc; | |
26 | sigemptyset(&(act.sa_mask)); | |
27 | act.sa_flags = 0; | |
28 | @@ -274,8 +275,8 @@ | |
29 | if ((jobno = nextjob()) == EOF) | |
30 | perr("Cannot generate job number"); | |
31 | ||
32 | - sprintf(ppos, "%c%5lx%8lx", queue, | |
33 | - jobno, (unsigned long) (runtimer / 60)); | |
34 | + (void)snprintf(ppos, sizeof(atfile) - (ppos - atfile), | |
35 | + "%c%5lx%8lx", queue, jobno, (unsigned long) (runtimer / 60)); | |
36 | ||
37 | for (ap = ppos; *ap != '\0'; ap++) | |
38 | if (*ap == ' ') | |
39 | @@ -291,7 +292,7 @@ | |
40 | * bit. Yes, this is a kluge. | |
41 | */ | |
42 | cmask = umask(S_IRUSR | S_IWUSR | S_IXUSR); | |
43 | - if ((fd = creat(atfile, O_WRONLY)) == -1) | |
44 | + if ((fd = open(atfile, O_CREAT | O_TRUNC | O_WRONLY, S_IRUSR)) == -1) | |
45 | perr("Cannot create atjob file %.500s", atfile); | |
46 | ||
47 | if ((fd2 = dup(fd)) < 0) | |
48 | @@ -461,14 +462,6 @@ | |
49 | ||
50 | close(fd2); | |
51 | ||
52 | - /* POSIX.2 allows the shell specified by the user's SHELL environment | |
53 | - variable, the login shell from the user's password database entry, | |
54 | - or /bin/sh to be the command interpreter that processes the at-job. | |
55 | - It also alows a warning diagnostic to be printed. Because of the | |
56 | - possible variance, we always output the diagnostic. */ | |
57 | - | |
58 | - fprintf(stderr, "warning: commands will be executed using /bin/sh\n"); | |
59 | - | |
60 | runtime = localtime(&runtimer); | |
61 | ||
62 | /* We only use the sick POSIX time format if POSIXLY_CORRECT | |
63 | @@ -546,6 +539,7 @@ | |
64 | long jobno; | |
65 | time_t runtimer; | |
66 | char timestr[TIMESIZE]; | |
67 | + struct passwd *pwd; | |
68 | ||
69 | PRIV_START | |
70 | ||
71 | @@ -581,7 +575,10 @@ | |
72 | } else { | |
73 | strftime(timestr, TIMESIZE, TIMEFORMAT_ISO, runtime); | |
74 | } | |
75 | - printf("%ld\t%s %c\n", jobno, timestr, queue); | |
76 | + if ((pwd = getpwuid(buf.st_uid))) | |
77 | + printf("%ld\t%s %c %s\n", jobno, timestr, queue, pwd->pw_name); | |
78 | + else | |
79 | + printf("%ld\t%s %c\n", jobno, timestr, queue); | |
80 | } | |
81 | PRIV_END | |
82 | } | |
83 | @@ -695,7 +692,7 @@ | |
84 | char *pgm; | |
85 | ||
86 | int program = AT; /* our default program */ | |
87 | - char *options = "q:f:mvldVc"; /* default options for at */ | |
88 | + char *options = "q:f:mvldhVc"; /* default options for at */ | |
89 | int disp_version = 0; | |
90 | time_t timer; | |
91 | struct passwd *pwe; | |
92 | @@ -726,16 +723,20 @@ | |
93 | */ | |
94 | if (strcmp(pgm, "atq") == 0) { | |
95 | program = ATQ; | |
96 | - options = "q:V"; | |
97 | + options = "hq:V"; | |
98 | } else if (strcmp(pgm, "atrm") == 0) { | |
99 | program = ATRM; | |
100 | - options = "V"; | |
101 | + options = "hV"; | |
102 | } | |
103 | /* process whatever options we can process | |
104 | */ | |
105 | opterr = 1; | |
106 | while ((c = getopt(argc, argv, options)) != EOF) | |
107 | switch (c) { | |
108 | + case 'h': | |
109 | + usage(); | |
110 | + exit (0); | |
111 | + | |
112 | case 'v': /* verify time settings */ | |
113 | atverify = 1; | |
114 | break; | |
115 | @@ -753,7 +754,7 @@ | |
116 | usage(); | |
117 | ||
118 | atqueue = queue = *optarg; | |
119 | - if (!(islower(queue) || isupper(queue))) | |
120 | + if (!(islower(queue) || isupper(queue)) & (queue != '=')) | |
121 | usage(); | |
122 | ||
123 | queue_set = 1; | |
124 | @@ -842,6 +843,15 @@ | |
125 | struct tm *tm = localtime(&timer); | |
126 | fprintf(stderr, "%s\n", asctime(tm)); | |
127 | } | |
128 | + | |
129 | + /* POSIX.2 allows the shell specified by the user's SHELL environment | |
130 | + variable, the login shell from the user's password database entry, | |
131 | + or /bin/sh to be the command interpreter that processes the at-job. | |
132 | + It also alows a warning diagnostic to be printed. Because of the | |
133 | + possible variance, we always output the diagnostic. */ | |
134 | + | |
135 | + fprintf(stderr, "warning: commands will be executed using /bin/sh\n"); | |
136 | + | |
137 | writefile(timer, queue); | |
138 | break; | |
139 | ||
140 | diff -Nru at-3.1.8/at.deny at-3.1.8.new/at.deny | |
141 | --- at-3.1.8/at.deny Sun Feb 23 21:24:34 1997 | |
142 | +++ at-3.1.8.new/at.deny Sun Mar 28 19:46:41 1999 | |
143 | @@ -1,13 +1,24 @@ | |
144 | -nobody | |
145 | +alias | |
146 | +backup | |
147 | bin | |
148 | daemon | |
149 | -sys | |
150 | +ftp | |
151 | +games | |
152 | +gnats | |
153 | +guest | |
154 | +irc | |
155 | lp | |
156 | -sync | |
157 | ||
158 | -news | |
159 | -uucp | |
160 | -games | |
161 | man | |
162 | -guest | |
163 | -ftp | |
164 | +nobody | |
165 | +operator | |
166 | +proxy | |
167 | +qmaild | |
168 | +qmaill | |
169 | +qmailp | |
170 | +qmailq | |
171 | +qmailr | |
172 | +qmails | |
173 | +sync | |
174 | +sys | |
175 | +www-data | |
176 | diff -Nru at-3.1.8/at_allow.5 at-3.1.8.new/at_allow.5 | |
177 | --- at-3.1.8/at_allow.5 Sun Mar 28 19:48:00 1999 | |
178 | +++ at-3.1.8.new/at_allow.5 Sun Mar 28 19:46:41 1999 | |
179 | @@ -29,4 +29,8 @@ | |
180 | .I /etc/at/at.deny | |
181 | is checked. | |
182 | .SH "SEE ALSO" | |
183 | -at(1), atrun(1), cron(1), crontab(1), atd(8) | |
184 | +.BR at (1), | |
185 | +.BR atrun (1), | |
186 | +.BR cron (8), | |
187 | +.BR crontab (1), | |
188 | +.BR atd (8). | |
189 | diff -Nru at-3.1.8/atd.8.in at-3.1.8.new/atd.8.in | |
190 | --- at-3.1.8/atd.8.in Sun Mar 28 19:48:00 1999 | |
191 | +++ at-3.1.8.new/atd.8.in Sun Mar 28 19:46:41 1999 | |
192 | @@ -46,6 +46,11 @@ | |
193 | is installed as | |
194 | .B /usr/sbin/atrun | |
195 | for backward compatibility. | |
196 | +.SH WARNING | |
197 | +.B atd | |
198 | +won't work if its spool directory is mounted via NFS even if | |
199 | +.I no_root_squash | |
200 | +is set. | |
201 | .SH FILES | |
202 | .I @ATJBD@ | |
203 | The directory for storing jobs; this should be mode 700, owner | |
204 | @@ -61,9 +66,15 @@ | |
205 | .B at | |
206 | system. | |
207 | .SH "SEE ALSO" | |
208 | -at(1), atrun(1), cron(1), crontab(1), syslog(3), at_deny(5), at_allow(5) | |
209 | +.BR at (1), | |
210 | +.BR atrun (1), | |
211 | +.BR cron (8), | |
212 | +.BR crontab (1), | |
213 | +.BR syslog (3), | |
214 | +.BR at.deny (5), | |
215 | +.BR at.allow(5). | |
216 | .SH BUGS | |
217 | The functionality of | |
218 | .B atd | |
219 | should be merged into | |
220 | -.BR cron(1) . | |
221 | +.BR cron (8) . | |
222 | diff -Nru at-3.1.8/atd.c at-3.1.8.new/atd.c | |
223 | --- at-3.1.8/atd.c Sun Sep 28 22:00:37 1997 | |
224 | +++ at-3.1.8.new/atd.c Sun Mar 28 19:46:41 1999 | |
225 | @@ -255,6 +255,13 @@ | |
226 | ||
227 | fcntl(fd_in, F_SETFD, fflags & ~FD_CLOEXEC); | |
228 | ||
229 | + /* | |
230 | + * If the spool directory is mounted via NFS `atd' isn't able to | |
231 | + * read from the job file and will bump out here. The file is | |
232 | + * opened as "root" but it is read as "daemon" which fails over | |
233 | + * NFS and works with local file systems. It's not clear where | |
234 | + * the bug is located. -Joey | |
235 | + */ | |
236 | if (fscanf(stream, "#!/bin/sh\n# atrun uid=%d gid=%d\n# mail %8s %d", | |
237 | &nuid, &ngid, mailbuf, &send_mail) != 4) | |
238 | pabort("File %.500s is in wrong format - aborting", | |
239 | diff -Nru at-3.1.8/batch at-3.1.8.new/batch | |
240 | --- at-3.1.8/batch Thu Jan 1 01:00:00 1970 | |
241 | +++ at-3.1.8.new/batch Sun Mar 28 19:46:41 1999 | |
242 | @@ -0,0 +1,4 @@ | |
243 | +#! /bin/sh | |
244 | +prefix=/usr | |
245 | +exec_prefix=${prefix} | |
246 | +exec ${exec_prefix}/bin/at -qb now "$@" | |
247 | diff -Nru at-3.1.8/config.guess at-3.1.8.new/config.guess | |
248 | --- at-3.1.8/config.guess Sun Feb 23 21:24:34 1997 | |
249 | +++ at-3.1.8.new/config.guess Sun Mar 28 19:46:41 1999 | |
250 | @@ -1,6 +1,6 @@ | |
251 | #! /bin/sh | |
252 | # Attempt to guess a canonical system name. | |
253 | -# Copyright (C) 1992, 1993, 1994, 1995 Free Software Foundation, Inc. | |
254 | +# Copyright (C) 1992, 93, 94, 95, 96, 97, 1998 Free Software Foundation, Inc. | |
255 | # | |
256 | # This file is free software; you can redistribute it and/or modify it | |
257 | # under the terms of the GNU General Public License as published by | |
258 | @@ -51,35 +51,110 @@ | |
259 | # Note: order is significant - the case branches are not exclusive. | |
260 | ||
261 | case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in | |
262 | - alpha:OSF1:V*:*) | |
263 | - # After 1.2, OSF1 uses "V1.3" for uname -r. | |
264 | - echo alpha-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^V//'` | |
265 | - exit 0 ;; | |
266 | alpha:OSF1:*:*) | |
267 | + if test $UNAME_RELEASE = "V4.0"; then | |
268 | + UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` | |
269 | + fi | |
270 | + # A Vn.n version is a released version. | |
271 | + # A Tn.n version is a released field test version. | |
272 | + # A Xn.n version is an unreleased experimental baselevel. | |
273 | # 1.2 uses "1.2" for uname -r. | |
274 | - echo alpha-dec-osf${UNAME_RELEASE} | |
275 | - exit 0 ;; | |
276 | + cat <<EOF >dummy.s | |
277 | + .globl main | |
278 | + .ent main | |
279 | +main: | |
280 | + .frame \$30,0,\$26,0 | |
281 | + .prologue 0 | |
282 | + .long 0x47e03d80 # implver $0 | |
283 | + lda \$2,259 | |
284 | + .long 0x47e20c21 # amask $2,$1 | |
285 | + srl \$1,8,\$2 | |
286 | + sll \$2,2,\$2 | |
287 | + sll \$0,3,\$0 | |
288 | + addl \$1,\$0,\$0 | |
289 | + addl \$2,\$0,\$0 | |
290 | + ret \$31,(\$26),1 | |
291 | + .end main | |
292 | +EOF | |
293 | + ${CC-cc} dummy.s -o dummy 2>/dev/null | |
294 | + if test "$?" = 0 ; then | |
295 | + ./dummy | |
296 | + case "$?" in | |
297 | + 7) | |
298 | + UNAME_MACHINE="alpha" | |
299 | + ;; | |
300 | + 15) | |
301 | + UNAME_MACHINE="alphaev5" | |
302 | + ;; | |
303 | + 14) | |
304 | + UNAME_MACHINE="alphaev56" | |
305 | + ;; | |
306 | + 10) | |
307 | + UNAME_MACHINE="alphapca56" | |
308 | + ;; | |
309 | + 16) | |
310 | + UNAME_MACHINE="alphaev6" | |
311 | + ;; | |
312 | + esac | |
313 | + fi | |
314 | + rm -f dummy.s dummy | |
315 | + echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[VTX]//' | tr [[A-Z]] [[a-z]]` | |
316 | + exit 0 ;; | |
317 | 21064:Windows_NT:50:3) | |
318 | echo alpha-dec-winnt3.5 | |
319 | exit 0 ;; | |
320 | + Amiga*:UNIX_System_V:4.0:*) | |
321 | + echo m68k-cbm-sysv4 | |
322 | + exit 0;; | |
323 | amiga:NetBSD:*:*) | |
324 | echo m68k-cbm-netbsd${UNAME_RELEASE} | |
325 | exit 0 ;; | |
326 | + amiga:OpenBSD:*:*) | |
327 | + echo m68k-unknown-openbsd${UNAME_RELEASE} | |
328 | + exit 0 ;; | |
329 | + arc64:OpenBSD:*:*) | |
330 | + echo mips64el-unknown-openbsd${UNAME_RELEASE} | |
331 | + exit 0 ;; | |
332 | + arc:OpenBSD:*:*) | |
333 | + echo mipsel-unknown-openbsd${UNAME_RELEASE} | |
334 | + exit 0 ;; | |
335 | + hkmips:OpenBSD:*:*) | |
336 | + echo mips-unknown-openbsd${UNAME_RELEASE} | |
337 | + exit 0 ;; | |
338 | + pmax:OpenBSD:*:*) | |
339 | + echo mipsel-unknown-openbsd${UNAME_RELEASE} | |
340 | + exit 0 ;; | |
341 | + sgi:OpenBSD:*:*) | |
342 | + echo mips-unknown-openbsd${UNAME_RELEASE} | |
343 | + exit 0 ;; | |
344 | + wgrisc:OpenBSD:*:*) | |
345 | + echo mipsel-unknown-openbsd${UNAME_RELEASE} | |
346 | + exit 0 ;; | |
347 | arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) | |
348 | echo arm-acorn-riscix${UNAME_RELEASE} | |
349 | exit 0;; | |
350 | - Pyramid*:OSx*:*:*) | |
351 | + arm32:NetBSD:*:*) | |
352 | + echo arm-unknown-netbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` | |
353 | + exit 0 ;; | |
354 | + SR2?01:HI-UX/MPP:*:*) | |
355 | + echo hppa1.1-hitachi-hiuxmpp | |
356 | + exit 0;; | |
357 | + Pyramid*:OSx*:*:*|MIS*:OSx*:*:*) | |
358 | + # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. | |
359 | if test "`(/bin/universe) 2>/dev/null`" = att ; then | |
360 | echo pyramid-pyramid-sysv3 | |
361 | else | |
362 | echo pyramid-pyramid-bsd | |
363 | fi | |
364 | exit 0 ;; | |
365 | - sun4*:SunOS:5.*:*) | |
366 | + NILE:*:*:dcosx) | |
367 | + echo pyramid-pyramid-svr4 | |
368 | + exit 0 ;; | |
369 | + sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) | |
370 | echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` | |
371 | exit 0 ;; | |
372 | i86pc:SunOS:5.*:*) | |
373 | - echo i386-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` | |
374 | + echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` | |
375 | exit 0 ;; | |
376 | sun4*:SunOS:6*:*) | |
377 | # According to config.sub, this is the proper way to canonicalize | |
378 | @@ -99,24 +174,86 @@ | |
379 | sun3*:SunOS:*:*) | |
380 | echo m68k-sun-sunos${UNAME_RELEASE} | |
381 | exit 0 ;; | |
382 | + sun*:*:4.2BSD:*) | |
383 | + UNAME_RELEASE=`(head -1 /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` | |
384 | + test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3 | |
385 | + case "`/bin/arch`" in | |
386 | + sun3) | |
387 | + echo m68k-sun-sunos${UNAME_RELEASE} | |
388 | + ;; | |
389 | + sun4) | |
390 | + echo sparc-sun-sunos${UNAME_RELEASE} | |
391 | + ;; | |
392 | + esac | |
393 | + exit 0 ;; | |
394 | + aushp:SunOS:*:*) | |
395 | + echo sparc-auspex-sunos${UNAME_RELEASE} | |
396 | + exit 0 ;; | |
397 | atari*:NetBSD:*:*) | |
398 | echo m68k-atari-netbsd${UNAME_RELEASE} | |
399 | exit 0 ;; | |
400 | + atari*:OpenBSD:*:*) | |
401 | + echo m68k-unknown-openbsd${UNAME_RELEASE} | |
402 | + exit 0 ;; | |
403 | sun3*:NetBSD:*:*) | |
404 | echo m68k-sun-netbsd${UNAME_RELEASE} | |
405 | exit 0 ;; | |
406 | + sun3*:OpenBSD:*:*) | |
407 | + echo m68k-unknown-openbsd${UNAME_RELEASE} | |
408 | + exit 0 ;; | |
409 | mac68k:NetBSD:*:*) | |
410 | echo m68k-apple-netbsd${UNAME_RELEASE} | |
411 | exit 0 ;; | |
412 | + mac68k:OpenBSD:*:*) | |
413 | + echo m68k-unknown-openbsd${UNAME_RELEASE} | |
414 | + exit 0 ;; | |
415 | + mvme68k:OpenBSD:*:*) | |
416 | + echo m68k-unknown-openbsd${UNAME_RELEASE} | |
417 | + exit 0 ;; | |
418 | + mvme88k:OpenBSD:*:*) | |
419 | + echo m88k-unknown-openbsd${UNAME_RELEASE} | |
420 | + exit 0 ;; | |
421 | + powerpc:machten:*:*) | |
422 | + echo powerpc-apple-machten${UNAME_RELEASE} | |
423 | + exit 0 ;; | |
424 | + RISC*:Mach:*:*) | |
425 | + echo mips-dec-mach_bsd4.3 | |
426 | + exit 0 ;; | |
427 | RISC*:ULTRIX:*:*) | |
428 | echo mips-dec-ultrix${UNAME_RELEASE} | |
429 | exit 0 ;; | |
430 | VAX*:ULTRIX*:*:*) | |
431 | echo vax-dec-ultrix${UNAME_RELEASE} | |
432 | exit 0 ;; | |
433 | - mips:*:5*:RISCos) | |
434 | + 2020:CLIX:*:*) | |
435 | + echo clipper-intergraph-clix${UNAME_RELEASE} | |
436 | + exit 0 ;; | |
437 | + mips:*:*:UMIPS | mips:*:*:RISCos) | |
438 | + sed 's/^ //' << EOF >dummy.c | |
439 | + int main (argc, argv) int argc; char **argv; { | |
440 | + #if defined (host_mips) && defined (MIPSEB) | |
441 | + #if defined (SYSTYPE_SYSV) | |
442 | + printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); | |
443 | + #endif | |
444 | + #if defined (SYSTYPE_SVR4) | |
445 | + printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0); | |
446 | + #endif | |
447 | + #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) | |
448 | + printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0); | |
449 | + #endif | |
450 | + #endif | |
451 | + exit (-1); | |
452 | + } | |
453 | +EOF | |
454 | + ${CC-cc} dummy.c -o dummy \ | |
455 | + && ./dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \ | |
456 | + && rm dummy.c dummy && exit 0 | |
457 | + rm -f dummy.c dummy | |
458 | echo mips-mips-riscos${UNAME_RELEASE} | |
459 | exit 0 ;; | |
460 | + Night_Hawk:Power_UNIX:*:*) | |
461 | + echo powerpc-harris-powerunix | |
462 | + exit 0 ;; | |
463 | m88k:CX/UX:7*:*) | |
464 | echo m88k-harris-cxux7 | |
465 | exit 0 ;; | |
466 | @@ -127,12 +264,17 @@ | |
467 | echo m88k-motorola-sysv3 | |
468 | exit 0 ;; | |
469 | AViiON:dgux:*:*) | |
470 | + # DG/UX returns AViiON for all architectures | |
471 | + UNAME_PROCESSOR=`/usr/bin/uname -p` | |
472 | + if [ $UNAME_PROCESSOR = mc88100 -o $UNAME_PROCESSOR = mc88110 ] ; then | |
473 | if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx \ | |
474 | -o ${TARGET_BINARY_INTERFACE}x = x ] ; then | |
475 | echo m88k-dg-dgux${UNAME_RELEASE} | |
476 | else | |
477 | echo m88k-dg-dguxbcs${UNAME_RELEASE} | |
478 | fi | |
479 | + else echo i586-dg-dgux${UNAME_RELEASE} | |
480 | + fi | |
481 | exit 0 ;; | |
482 | M88*:DolphinOS:*:*) # DolphinOS (SVR3) | |
483 | echo m88k-dolphin-sysv3 | |
484 | @@ -150,10 +292,10 @@ | |
485 | *:IRIX*:*:*) | |
486 | echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` | |
487 | exit 0 ;; | |
488 | - ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. | |
489 | + ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. | |
490 | echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id | |
491 | exit 0 ;; # Note that: echo "'`uname -s`'" gives 'AIX ' | |
492 | - i[34]86:AIX:*:*) | |
493 | + i?86:AIX:*:*) | |
494 | echo i386-ibm-aix | |
495 | exit 0 ;; | |
496 | *:AIX:2:3) | |
497 | @@ -198,7 +340,7 @@ | |
498 | echo romp-ibm-bsd4.4 | |
499 | exit 0 ;; | |
500 | ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC NetBSD and | |
501 | - echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to | |
502 | + echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to | |
503 | exit 0 ;; # report: romp-ibm BSD 4.3 | |
504 | *:BOSX:*:*) | |
505 | echo rs6000-bull-bosx | |
506 | @@ -216,7 +358,7 @@ | |
507 | case "${UNAME_MACHINE}" in | |
508 | 9000/31? ) HP_ARCH=m68000 ;; | |
509 | 9000/[34]?? ) HP_ARCH=m68k ;; | |
510 | - 9000/7?? | 9000/8?[79] ) HP_ARCH=hppa1.1 ;; | |
511 | + 9000/7?? | 9000/8?[1679] ) HP_ARCH=hppa1.1 ;; | |
512 | 9000/8?? ) HP_ARCH=hppa1.0 ;; | |
513 | esac | |
514 | HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` | |
515 | @@ -264,6 +406,13 @@ | |
516 | hp8??:OSF1:*:*) | |
517 | echo hppa1.0-hp-osf | |
518 | exit 0 ;; | |
519 | + i?86:OSF1:*:*) | |
520 | + if [ -x /usr/sbin/sysversion ] ; then | |
521 | + echo ${UNAME_MACHINE}-unknown-osf1mk | |
522 | + else | |
523 | + echo ${UNAME_MACHINE}-unknown-osf1 | |
524 | + fi | |
525 | + exit 0 ;; | |
526 | parisc*:Lites*:*:*) | |
527 | echo hppa1.1-hp-lites | |
528 | exit 0 ;; | |
529 | @@ -291,17 +440,33 @@ | |
530 | CRAY*Y-MP:*:*:*) | |
531 | echo ymp-cray-unicos${UNAME_RELEASE} | |
532 | exit 0 ;; | |
533 | - CRAY*C90:*:*:*) | |
534 | - echo c90-cray-unicos${UNAME_RELEASE} | |
535 | + CRAY*[A-Z]90:*:*:*) | |
536 | + echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ | |
537 | + | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ | |
538 | + -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ | |
539 | + exit 0 ;; | |
540 | + CRAY*TS:*:*:*) | |
541 | + echo t90-cray-unicos${UNAME_RELEASE} | |
542 | exit 0 ;; | |
543 | CRAY-2:*:*:*) | |
544 | echo cray2-cray-unicos | |
545 | exit 0 ;; | |
546 | + F300:UNIX_System_V:*:*) | |
547 | + FUJITSU_SYS=`uname -p | tr [A-Z] [a-z] | sed -e 's/\///'` | |
548 | + FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` | |
549 | + echo "f300-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" | |
550 | + exit 0 ;; | |
551 | + F301:UNIX_System_V:*:*) | |
552 | + echo f301-fujitsu-uxpv`echo $UNAME_RELEASE | sed 's/ .*//'` | |
553 | + exit 0 ;; | |
554 | hp3[0-9][05]:NetBSD:*:*) | |
555 | echo m68k-hp-netbsd${UNAME_RELEASE} | |
556 | exit 0 ;; | |
557 | - i[34]86:BSD/386:*:* | *:BSD/OS:*:*) | |
558 | - echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} | |
559 | + hp300:OpenBSD:*:*) | |
560 | + echo m68k-unknown-openbsd${UNAME_RELEASE} | |
561 | + exit 0 ;; | |
562 | + i?86:BSD/386:*:* | *:BSD/OS:*:*) | |
563 | + echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} | |
564 | exit 0 ;; | |
565 | *:FreeBSD:*:*) | |
566 | echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` | |
567 | @@ -309,36 +474,150 @@ | |
568 | *:NetBSD:*:*) | |
569 | echo ${UNAME_MACHINE}-unknown-netbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` | |
570 | exit 0 ;; | |
571 | + *:OpenBSD:*:*) | |
572 | + echo ${UNAME_MACHINE}-unknown-openbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` | |
573 | + exit 0 ;; | |
574 | + i*:CYGWIN*:*) | |
575 | + echo ${UNAME_MACHINE}-pc-cygwin32 | |
576 | + exit 0 ;; | |
577 | + i*:MINGW*:*) | |
578 | + echo ${UNAME_MACHINE}-pc-mingw32 | |
579 | + exit 0 ;; | |
580 | + p*:CYGWIN*:*) | |
581 | + echo powerpcle-unknown-cygwin32 | |
582 | + exit 0 ;; | |
583 | + prep*:SunOS:5.*:*) | |
584 | + echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` | |
585 | + exit 0 ;; | |
586 | *:GNU:*:*) | |
587 | - echo `echo ${UNAME_MACHINE}|sed -e 's,/.*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` | |
588 | + echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` | |
589 | exit 0 ;; | |
590 | *:Linux:*:*) | |
591 | + # uname on the ARM produces all sorts of strangeness, and we need to | |
592 | + # filter it out. | |
593 | + case "$UNAME_MACHINE" in | |
594 | + arm* | sa110*) UNAME_MACHINE="arm" ;; | |
595 | + esac | |
596 | + | |
597 | # The BFD linker knows what the default object file format is, so | |
598 | # first see if it will tell us. | |
599 | ld_help_string=`ld --help 2>&1` | |
600 | - if echo $ld_help_string | grep >/dev/null 2>&1 "supported emulations: elf_i[345]86"; then | |
601 | - echo "${UNAME_MACHINE}-unknown-linux" ; exit 0 | |
602 | - elif echo $ld_help_string | grep >/dev/null 2>&1 "supported emulations: i[345]86linux"; then | |
603 | - echo "${UNAME_MACHINE}-unknown-linuxaout" ; exit 0 | |
604 | - elif echo $ld_help_string | grep >/dev/null 2>&1 "supported emulations: i[345]86coff"; then | |
605 | - echo "${UNAME_MACHINE}-unknown-linuxcoff" ; exit 0 | |
606 | - elif test "${UNAME_MACHINE}" = "alpha" ; then | |
607 | - echo alpha-unknown-linux ; exit 0 | |
608 | - else | |
609 | - # Either a pre-BFD a.out linker (linuxoldld) or one that does not give us | |
610 | - # useful --help. Gcc wants to distinguish between linuxoldld and linuxaout. | |
611 | - test ! -d /usr/lib/ldscripts/. \ | |
612 | - && echo "${UNAME_MACHINE}-unknown-linuxoldld" && exit 0 | |
613 | + ld_supported_emulations=`echo $ld_help_string \ | |
614 | + | sed -ne '/supported emulations:/!d | |
615 | + s/[ ][ ]*/ /g | |
616 | + s/.*supported emulations: *// | |
617 | + s/ .*// | |
618 | + p'` | |
619 | + case "$ld_supported_emulations" in | |
620 | + i?86linux) echo "${UNAME_MACHINE}-pc-linux-gnuaout" ; exit 0 ;; | |
621 | + i?86coff) echo "${UNAME_MACHINE}-pc-linux-gnucoff" ; exit 0 ;; | |
622 | + sparclinux) echo "${UNAME_MACHINE}-unknown-linux-gnuaout" ; exit 0 ;; | |
623 | + armlinux) echo "${UNAME_MACHINE}-unknown-linux-gnuaout" ; exit 0 ;; | |
624 | + m68klinux) echo "${UNAME_MACHINE}-unknown-linux-gnuaout" ; exit 0 ;; | |
625 | + elf32ppc) echo "powerpc-unknown-linux-gnu" ; exit 0 ;; | |
626 | + esac | |
627 | + | |
628 | + if test "${UNAME_MACHINE}" = "alpha" ; then | |
629 | + sed 's/^ //' <<EOF >dummy.s | |
630 | + .globl main | |
631 | + .ent main | |
632 | + main: | |
633 | + .frame \$30,0,\$26,0 | |
634 | + .prologue 0 | |
635 | + .long 0x47e03d80 # implver $0 | |
636 | + lda \$2,259 | |
637 | + .long 0x47e20c21 # amask $2,$1 | |
638 | + srl \$1,8,\$2 | |
639 | + sll \$2,2,\$2 | |
640 | + sll \$0,3,\$0 | |
641 | + addl \$1,\$0,\$0 | |
642 | + addl \$2,\$0,\$0 | |
643 | + ret \$31,(\$26),1 | |
644 | + .end main | |
645 | +EOF | |
646 | + LIBC="" | |
647 | + ${CC-cc} dummy.s -o dummy 2>/dev/null | |
648 | + if test "$?" = 0 ; then | |
649 | + ./dummy | |
650 | + case "$?" in | |
651 | + 7) | |
652 | + UNAME_MACHINE="alpha" | |
653 | + ;; | |
654 | + 15) | |
655 | + UNAME_MACHINE="alphaev5" | |
656 | + ;; | |
657 | + 14) | |
658 | + UNAME_MACHINE="alphaev56" | |
659 | + ;; | |
660 | + 10) | |
661 | + UNAME_MACHINE="alphapca56" | |
662 | + ;; | |
663 | + 16) | |
664 | + UNAME_MACHINE="alphaev6" | |
665 | + ;; | |
666 | + esac | |
667 | + | |
668 | + objdump --private-headers dummy | \ | |
669 | + grep ld.so.1 > /dev/null | |
670 | + if test "$?" = 0 ; then | |
671 | + LIBC="libc1" | |
672 | + fi | |
673 | + fi | |
674 | + rm -f dummy.s dummy | |
675 | + echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} ; exit 0 | |
676 | + elif test "${UNAME_MACHINE}" = "mips" ; then | |
677 | + cat >dummy.c <<EOF | |
678 | +main(argc, argv) | |
679 | + int argc; | |
680 | + char *argv[]; | |
681 | +{ | |
682 | +#ifdef __MIPSEB__ | |
683 | + printf ("%s-unknown-linux-gnu\n", argv[1]); | |
684 | +#endif | |
685 | +#ifdef __MIPSEL__ | |
686 | + printf ("%sel-unknown-linux-gnu\n", argv[1]); | |
687 | +#endif | |
688 | + return 0; | |
689 | +} | |
690 | +EOF | |
691 | + ${CC-cc} dummy.c -o dummy 2>/dev/null && ./dummy "${UNAME_MACHINE}" && rm dummy.c dummy && exit 0 | |
692 | + rm -f dummy.c dummy | |
693 | + else | |
694 | + # Either a pre-BFD a.out linker (linux-gnuoldld) | |
695 | + # or one that does not give us useful --help. | |
696 | + # GCC wants to distinguish between linux-gnuoldld and linux-gnuaout. | |
697 | + # If ld does not provide *any* "supported emulations:" | |
698 | + # that means it is gnuoldld. | |
699 | + echo "$ld_help_string" | grep >/dev/null 2>&1 "supported emulations:" | |
700 | + test $? != 0 && echo "${UNAME_MACHINE}-pc-linux-gnuoldld" && exit 0 | |
701 | + | |
702 | + case "${UNAME_MACHINE}" in | |
703 | + i?86) | |
704 | + VENDOR=pc; | |
705 | + ;; | |
706 | + *) | |
707 | + VENDOR=unknown; | |
708 | + ;; | |
709 | + esac | |
710 | # Determine whether the default compiler is a.out or elf | |
711 | cat >dummy.c <<EOF | |
712 | +#include <features.h> | |
713 | main(argc, argv) | |
714 | -int argc; | |
715 | -char *argv[]; | |
716 | + int argc; | |
717 | + char *argv[]; | |
718 | { | |
719 | #ifdef __ELF__ | |
720 | - printf ("%s-unknown-linux\n", argv[1]); | |
721 | +# ifdef __GLIBC__ | |
722 | +# if __GLIBC__ >= 2 | |
723 | + printf ("%s-${VENDOR}-linux-gnu\n", argv[1]); | |
724 | +# else | |
725 | + printf ("%s-${VENDOR}-linux-gnulibc1\n", argv[1]); | |
726 | +# endif | |
727 | +# else | |
728 | + printf ("%s-${VENDOR}-linux-gnulibc1\n", argv[1]); | |
729 | +# endif | |
730 | #else | |
731 | - printf ("%s-unknown-linuxaout\n", argv[1]); | |
732 | + printf ("%s-${VENDOR}-linux-gnuaout\n", argv[1]); | |
733 | #endif | |
734 | return 0; | |
735 | } | |
736 | @@ -348,30 +627,45 @@ | |
737 | fi ;; | |
738 | # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. earlier versions | |
739 | # are messed up and put the nodename in both sysname and nodename. | |
740 | - i[34]86:DYNIX/ptx:4*:*) | |
741 | + i?86:DYNIX/ptx:4*:*) | |
742 | echo i386-sequent-sysv4 | |
743 | exit 0 ;; | |
744 | - i[34]86:*:4.*:* | i[34]86:SYSTEM_V:4.*:*) | |
745 | + i?86:UNIX_SV:4.2MP:2.*) | |
746 | + # Unixware is an offshoot of SVR4, but it has its own version | |
747 | + # number series starting with 2... | |
748 | + # I am not positive that other SVR4 systems won't match this, | |
749 | + # I just have to hope. -- rms. | |
750 | + # Use sysv4.2uw... so that sysv4* matches it. | |
751 | + echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} | |
752 | + exit 0 ;; | |
753 | + i?86:*:4.*:* | i?86:SYSTEM_V:4.*:*) | |
754 | if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then | |
755 | echo ${UNAME_MACHINE}-univel-sysv${UNAME_RELEASE} | |
756 | else | |
757 | - echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE} | |
758 | + echo ${UNAME_MACHINE}-pc-sysv${UNAME_RELEASE} | |
759 | fi | |
760 | exit 0 ;; | |
761 | - i[34]86:*:3.2:*) | |
762 | + i?86:*:3.2:*) | |
763 | if test -f /usr/options/cb.name; then | |
764 | UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name` | |
765 | - echo ${UNAME_MACHINE}-unknown-isc$UNAME_REL | |
766 | + echo ${UNAME_MACHINE}-pc-isc$UNAME_REL | |
767 | elif /bin/uname -X 2>/dev/null >/dev/null ; then | |
768 | UNAME_REL=`(/bin/uname -X|egrep Release|sed -e 's/.*= //')` | |
769 | (/bin/uname -X|egrep i80486 >/dev/null) && UNAME_MACHINE=i486 | |
770 | - echo ${UNAME_MACHINE}-unknown-sco$UNAME_REL | |
771 | + (/bin/uname -X|egrep '^Machine.*Pentium' >/dev/null) \ | |
772 | + && UNAME_MACHINE=i586 | |
773 | + echo ${UNAME_MACHINE}-pc-sco$UNAME_REL | |
774 | else | |
775 | - echo ${UNAME_MACHINE}-unknown-sysv32 | |
776 | + echo ${UNAME_MACHINE}-pc-sysv32 | |
777 | fi | |
778 | exit 0 ;; | |
779 | + pc:*:*:*) | |
780 | + # uname -m prints for DJGPP always 'pc', but it prints nothing about | |
781 | + # the processor, so we play safe by assuming i386. | |
782 | + echo i386-pc-msdosdjgpp | |
783 | + exit 0 ;; | |
784 | Intel:Mach:3*:*) | |
785 | - echo i386-unknown-mach3 | |
786 | + echo i386-pc-mach3 | |
787 | exit 0 ;; | |
788 | paragon:*:*:*) | |
789 | echo i860-intel-osf1 | |
790 | @@ -387,30 +681,36 @@ | |
791 | # "miniframe" | |
792 | echo m68010-convergent-sysv | |
793 | exit 0 ;; | |
794 | - M680[234]0:*:R3V[567]*:*) | |
795 | + M68*:*:R3V[567]*:*) | |
796 | test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;; | |
797 | 3[34]??:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 4850:*:4.0:3.0) | |
798 | - uname -p 2>/dev/null | grep 86 >/dev/null \ | |
799 | - && echo i486-ncr-sysv4.3 && exit 0 | |
800 | - uname -p 2>/dev/null | /bin/grep entium >/dev/null \ | |
801 | - && echo i586-ncr-sysv4.3 && exit 0 ;; | |
802 | + OS_REL='' | |
803 | + test -r /etc/.relid \ | |
804 | + && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` | |
805 | + /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ | |
806 | + && echo i486-ncr-sysv4.3${OS_REL} && exit 0 | |
807 | + /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ | |
808 | + && echo i586-ncr-sysv4.3${OS_REL} && exit 0 ;; | |
809 | 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) | |
810 | - uname -p 2>/dev/null | grep 86 >/dev/null \ | |
811 | + /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ | |
812 | && echo i486-ncr-sysv4 && exit 0 ;; | |
813 | - m680[234]0:LynxOS:2.[23]*:*) | |
814 | - echo m68k-lynx-lynxos${UNAME_RELEASE} | |
815 | + m68*:LynxOS:2.*:*) | |
816 | + echo m68k-unknown-lynxos${UNAME_RELEASE} | |
817 | exit 0 ;; | |
818 | mc68030:UNIX_System_V:4.*:*) | |
819 | echo m68k-atari-sysv4 | |
820 | exit 0 ;; | |
821 | - i[34]86:LynxOS:2.[23]*:*) | |
822 | - echo i386-lynx-lynxos${UNAME_RELEASE} | |
823 | + i?86:LynxOS:2.*:*) | |
824 | + echo i386-unknown-lynxos${UNAME_RELEASE} | |
825 | exit 0 ;; | |
826 | - TSUNAMI:LynxOS:2.[23]*:*) | |
827 | - echo sparc-lynx-lynxos${UNAME_RELEASE} | |
828 | + TSUNAMI:LynxOS:2.*:*) | |
829 | + echo sparc-unknown-lynxos${UNAME_RELEASE} | |
830 | exit 0 ;; | |
831 | - rs6000:LynxOS:2.[23]*:*) | |
832 | - echo rs6000-lynx-lynxos${UNAME_RELEASE} | |
833 | + rs6000:LynxOS:2.*:* | PowerPC:LynxOS:2.*:*) | |
834 | + echo rs6000-unknown-lynxos${UNAME_RELEASE} | |
835 | + exit 0 ;; | |
836 | + SM[BE]S:UNIX_SV:*:*) | |
837 | + echo mips-dde-sysv${UNAME_RELEASE} | |
838 | exit 0 ;; | |
839 | RM*:SINIX-*:*:*) | |
840 | echo mips-sni-sysv4 | |
841 | @@ -423,6 +723,32 @@ | |
842 | echo ns32k-sni-sysv | |
843 | fi | |
844 | exit 0 ;; | |
845 | + PENTIUM:CPunix:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort | |
846 | + # says <Richard.M.Bartel@ccMail.Census.GOV> | |
847 | + echo i586-unisys-sysv4 | |
848 | + exit 0 ;; | |
849 | + *:UNIX_System_V:4*:FTX*) | |
850 | + # From Gerald Hewes <hewes@openmarket.com>. | |
851 | + # How about differentiating between stratus architectures? -djm | |
852 | + echo hppa1.1-stratus-sysv4 | |
853 | + exit 0 ;; | |
854 | + *:*:*:FTX*) | |
855 | + # From seanf@swdc.stratus.com. | |
856 | + echo i860-stratus-sysv4 | |
857 | + exit 0 ;; | |
858 | + mc68*:A/UX:*:*) | |
859 | + echo m68k-apple-aux${UNAME_RELEASE} | |
860 | + exit 0 ;; | |
861 | + news*:NEWS-OS:*:6*) | |
862 | + echo mips-sony-newsos6 | |
863 | + exit 0 ;; | |
864 | + R3000:*System_V*:*:* | R4000:UNIX_SYSV:*:*) | |
865 | + if [ -d /usr/nec ]; then | |
866 | + echo mips-nec-sysv${UNAME_RELEASE} | |
867 | + else | |
868 | + echo mips-unknown-sysv${UNAME_RELEASE} | |
869 | + fi | |
870 | + exit 0 ;; | |
871 | esac | |
872 | ||
873 | #echo '(No uname command or uname output not recognized.)' 1>&2 | |
874 | @@ -452,15 +778,6 @@ | |
875 | #endif | |
876 | #endif | |
877 | ||
878 | -#if defined (host_mips) && defined (MIPSEB) | |
879 | -#if defined (SYSTYPE_BSD43) | |
880 | - printf ("mips-mips-riscos4bsd\n"); exit (0); | |
881 | -#endif | |
882 | -#if defined (SYSTYPE_SYSV) | |
883 | - printf ("mips-mips-riscos4sysv\n"); exit (0); | |
884 | -#endif | |
885 | -#endif | |
886 | - | |
887 | #if defined (__arm) && defined (__acorn) && defined (__unix) | |
888 | printf ("arm-acorn-riscix"); exit (0); | |
889 | #endif | |
890 | @@ -475,7 +792,7 @@ | |
891 | #endif | |
892 | int version; | |
893 | version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; | |
894 | - printf ("%s-next-nextstep%s\n", __ARCHITECTURE__, version==2 ? "2" : "3"); | |
895 | + printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); | |
896 | exit (0); | |
897 | #endif | |
898 | ||
899 | @@ -492,7 +809,7 @@ | |
900 | #endif | |
901 | ||
902 | #if defined (__386BSD__) | |
903 | - printf ("i386-unknown-bsd\n"); exit (0); | |
904 | + printf ("i386-pc-bsd\n"); exit (0); | |
905 | #endif | |
906 | ||
907 | #if defined (sequent) | |
908 | diff -Nru at-3.1.8/config.sub at-3.1.8.new/config.sub | |
909 | --- at-3.1.8/config.sub Sun Feb 23 21:24:35 1997 | |
910 | +++ at-3.1.8.new/config.sub Sun Mar 28 19:46:41 1999 | |
911 | @@ -1,9 +1,9 @@ | |
912 | #! /bin/sh | |
913 | # Configuration validation subroutine script, version 1.1. | |
914 | -# Copyright (C) 1991, 1992, 1993, 1994, 1995 Free Software Foundation, Inc. | |
915 | +# Copyright (C) 1991, 92-97, 1998 Free Software Foundation, Inc. | |
916 | # This file is (in principle) common to ALL GNU software. | |
917 | # The presence of a machine in this file suggests that SOME GNU software | |
918 | -# can handle that machine. It does not imply ALL GNU software can. | |
919 | +# can handle that machine. It does not imply ALL GNU software can. | |
920 | # | |
921 | # This file is free software; you can redistribute it and/or modify | |
922 | # it under the terms of the GNU General Public License as published by | |
923 | @@ -41,6 +41,8 @@ | |
924 | # The goal of this file is to map all the various variations of a given | |
925 | # machine specification into a single specification in the form: | |
926 | # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM | |
927 | +# or in some cases, the newer four-part form: | |
928 | +# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM | |
929 | # It is wrong to echo any other type of specification. | |
930 | ||
931 | if [ x$1 = x ] | |
932 | @@ -62,11 +64,21 @@ | |
933 | ;; | |
934 | esac | |
935 | ||
936 | -# Separate what the user gave into CPU-COMPANY and OS (if any). | |
937 | -basic_machine=`echo $1 | sed 's/-[^-]*$//'` | |
938 | -if [ $basic_machine != $1 ] | |
939 | -then os=`echo $1 | sed 's/.*-/-/'` | |
940 | -else os=; fi | |
941 | +# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). | |
942 | +# Here we must recognize all the valid KERNEL-OS combinations. | |
943 | +maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` | |
944 | +case $maybe_os in | |
945 | + linux-gnu*) | |
946 | + os=-$maybe_os | |
947 | + basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` | |
948 | + ;; | |
949 | + *) | |
950 | + basic_machine=`echo $1 | sed 's/-[^-]*$//'` | |
951 | + if [ $basic_machine != $1 ] | |
952 | + then os=`echo $1 | sed 's/.*-/-/'` | |
953 | + else os=; fi | |
954 | + ;; | |
955 | +esac | |
956 | ||
957 | ### Let's recognize common machines as not being operating systems so | |
958 | ### that things like config.sub decstation-3100 work. We also | |
959 | @@ -81,38 +93,43 @@ | |
960 | -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ | |
961 | -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ | |
962 | -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ | |
963 | - -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp ) | |
964 | + -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ | |
965 | + -apple) | |
966 | os= | |
967 | basic_machine=$1 | |
968 | ;; | |
969 | -hiux*) | |
970 | os=-hiuxwe2 | |
971 | ;; | |
972 | + -sco5) | |
973 | + os=sco3.2v5 | |
974 | + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` | |
975 | + ;; | |
976 | -sco4) | |
977 | os=-sco3.2v4 | |
978 | - basic_machine=`echo $1 | sed -e 's/86-.*/86-unknown/'` | |
979 | + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` | |
980 | ;; | |
981 | -sco3.2.[4-9]*) | |
982 | os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` | |
983 | - basic_machine=`echo $1 | sed -e 's/86-.*/86-unknown/'` | |
984 | + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` | |
985 | ;; | |
986 | -sco3.2v[4-9]*) | |
987 | # Don't forget version if it is 3.2v4 or newer. | |
988 | - basic_machine=`echo $1 | sed -e 's/86-.*/86-unknown/'` | |
989 | + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` | |
990 | ;; | |
991 | -sco*) | |
992 | os=-sco3.2v2 | |
993 | - basic_machine=`echo $1 | sed -e 's/86-.*/86-unknown/'` | |
994 | + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` | |
995 | ;; | |
996 | -isc) | |
997 | os=-isc2.2 | |
998 | - basic_machine=`echo $1 | sed -e 's/86-.*/86-unknown/'` | |
999 | + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` | |
1000 | ;; | |
1001 | -clix*) | |
1002 | basic_machine=clipper-intergraph | |
1003 | ;; | |
1004 | -isc*) | |
1005 | - basic_machine=`echo $1 | sed -e 's/86-.*/86-unknown/'` | |
1006 | + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` | |
1007 | ;; | |
1008 | -lynx*) | |
1009 | os=-lynxos | |
1010 | @@ -123,35 +140,49 @@ | |
1011 | -windowsnt*) | |
1012 | os=`echo $os | sed -e 's/windowsnt/winnt/'` | |
1013 | ;; | |
1014 | + -psos*) | |
1015 | + os=-psos | |
1016 | + ;; | |
1017 | esac | |
1018 | ||
1019 | # Decode aliases for certain CPU-COMPANY combinations. | |
1020 | case $basic_machine in | |
1021 | # Recognize the basic CPU types without company name. | |
1022 | # Some are omitted here because they have special meanings below. | |
1023 | - tahoe | i[345]86 | i860 | m68k | m68000 | m88k | ns32k | arm \ | |
1024 | - | arme[lb] | pyramid \ | |
1025 | - | tron | a29k | 580 | i960 | h8300 | hppa1.0 | hppa1.1 \ | |
1026 | - | alpha | we32k | ns16k | clipper | sparclite | i370 | sh \ | |
1027 | - | powerpc | powerpcle | sparc64 | 1750a | dsp16xx | mips64 | mipsel \ | |
1028 | - | pdp11 | mips64el | mips64orion | mips64orionel \ | |
1029 | - | sparc) | |
1030 | + tahoe | i860 | m32r | m68k | m68000 | m88k | ns32k | arc | arm \ | |
1031 | + | arme[lb] | pyramid | mn10200 | mn10300 \ | |
1032 | + | tron | a29k | 580 | i960 | h8300 | hppa | hppa1.0 | hppa1.1 \ | |
1033 | + | alpha | alphaev5 | alphaev56 | we32k | ns16k | clipper \ | |
1034 | + | i370 | sh | powerpc | powerpcle | 1750a | dsp16xx | pdp11 \ | |
1035 | + | mips64 | mipsel | mips64el | mips64orion | mips64orionel \ | |
1036 | + | mipstx39 | mipstx39el \ | |
1037 | + | sparc | sparclet | sparclite | sparc64 | v850) | |
1038 | basic_machine=$basic_machine-unknown | |
1039 | ;; | |
1040 | + # We use `pc' rather than `unknown' | |
1041 | + # because (1) that's what they normally are, and | |
1042 | + # (2) the word "unknown" tends to confuse beginning users. | |
1043 | + i[34567]86) | |
1044 | + basic_machine=$basic_machine-pc | |
1045 | + ;; | |
1046 | # Object if more than one company name word. | |
1047 | *-*-*) | |
1048 | echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 | |
1049 | exit 1 | |
1050 | ;; | |
1051 | # Recognize the basic CPU types with company name. | |
1052 | - vax-* | tahoe-* | i[345]86-* | i860-* | m68k-* | m68000-* | m88k-* \ | |
1053 | - | sparc-* | ns32k-* | fx80-* | arm-* | c[123]* \ | |
1054 | - | mips-* | pyramid-* | tron-* | a29k-* | romp-* | rs6000-* | power-* \ | |
1055 | - | none-* | 580-* | cray2-* | h8300-* | i960-* | xmp-* | ymp-* \ | |
1056 | - | hppa1.0-* | hppa1.1-* | alpha-* | we32k-* | cydra-* | ns16k-* \ | |
1057 | - | pn-* | np1-* | xps100-* | clipper-* | orion-* | sparclite-* \ | |
1058 | - | pdp11-* | sh-* | powerpc-* | powerpcle-* | sparc64-* | mips64-* | mipsel-* \ | |
1059 | - | mips64el-* | mips64orion-* | mips64orionel-*) | |
1060 | + vax-* | tahoe-* | i[34567]86-* | i860-* | m32r-* | m68k-* | m68000-* \ | |
1061 | + | m88k-* | sparc-* | ns32k-* | fx80-* | arc-* | arm-* | c[123]* \ | |
1062 | + | mips-* | pyramid-* | tron-* | a29k-* | romp-* | rs6000-* \ | |
1063 | + | power-* | none-* | 580-* | cray2-* | h8300-* | i960-* \ | |
1064 | + | xmp-* | ymp-* | hppa-* | hppa1.0-* | hppa1.1-* \ | |
1065 | + | alpha-* | alphaev5-* | alphaev56-* | we32k-* | cydra-* \ | |
1066 | + | ns16k-* | pn-* | np1-* | xps100-* | clipper-* | orion-* \ | |
1067 | + | sparclite-* | pdp11-* | sh-* | powerpc-* | powerpcle-* \ | |
1068 | + | sparc64-* | mips64-* | mipsel-* \ | |
1069 | + | mips64el-* | mips64orion-* | mips64orionel-* \ | |
1070 | + | mipstx39-* | mipstx39el-* \ | |
1071 | + | f301-*) | |
1072 | ;; | |
1073 | # Recognize the various machine names and aliases which stand | |
1074 | # for a CPU type and a company and sometimes even an OS. | |
1075 | @@ -178,9 +209,9 @@ | |
1076 | amiga | amiga-*) | |
1077 | basic_machine=m68k-cbm | |
1078 | ;; | |
1079 | - amigados) | |
1080 | + amigaos | amigados) | |
1081 | basic_machine=m68k-cbm | |
1082 | - os=-amigados | |
1083 | + os=-amigaos | |
1084 | ;; | |
1085 | amigaunix | amix) | |
1086 | basic_machine=m68k-cbm | |
1087 | @@ -190,6 +221,10 @@ | |
1088 | basic_machine=m68k-apollo | |
1089 | os=-sysv | |
1090 | ;; | |
1091 | + aux) | |
1092 | + basic_machine=m68k-apple | |
1093 | + os=-aux | |
1094 | + ;; | |
1095 | balance) | |
1096 | basic_machine=ns32k-sequent | |
1097 | os=-dynix | |
1098 | @@ -222,6 +257,10 @@ | |
1099 | basic_machine=cray2-cray | |
1100 | os=-unicos | |
1101 | ;; | |
1102 | + [ctj]90-cray) | |
1103 | + basic_machine=c90-cray | |
1104 | + os=-unicos | |
1105 | + ;; | |
1106 | crds | unos) | |
1107 | basic_machine=m68k-crds | |
1108 | ;; | |
1109 | @@ -303,25 +342,28 @@ | |
1110 | hp9k8[0-9][0-9] | hp8[0-9][0-9]) | |
1111 | basic_machine=hppa1.0-hp | |
1112 | ;; | |
1113 | + hppa-next) | |
1114 | + os=-nextstep3 | |
1115 | + ;; | |
1116 | i370-ibm* | ibm*) | |
1117 | basic_machine=i370-ibm | |
1118 | os=-mvs | |
1119 | ;; | |
1120 | # I'm not sure what "Sysv32" means. Should this be sysv3.2? | |
1121 | - i[345]86v32) | |
1122 | - basic_machine=`echo $1 | sed -e 's/86.*/86-unknown/'` | |
1123 | + i[34567]86v32) | |
1124 | + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` | |
1125 | os=-sysv32 | |
1126 | ;; | |
1127 | - i[345]86v4*) | |
1128 | - basic_machine=`echo $1 | sed -e 's/86.*/86-unknown/'` | |
1129 | + i[34567]86v4*) | |
1130 | + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` | |
1131 | os=-sysv4 | |
1132 | ;; | |
1133 | - i[345]86v) | |
1134 | - basic_machine=`echo $1 | sed -e 's/86.*/86-unknown/'` | |
1135 | + i[34567]86v) | |
1136 | + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` | |
1137 | os=-sysv | |
1138 | ;; | |
1139 | - i[345]86sol2) | |
1140 | - basic_machine=`echo $1 | sed -e 's/86.*/86-unknown/'` | |
1141 | + i[34567]86sol2) | |
1142 | + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` | |
1143 | os=-solaris2 | |
1144 | ;; | |
1145 | iris | iris4d) | |
1146 | @@ -352,6 +394,14 @@ | |
1147 | miniframe) | |
1148 | basic_machine=m68000-convergent | |
1149 | ;; | |
1150 | + mipsel*-linux*) | |
1151 | + basic_machine=mipsel-unknown | |
1152 | + os=-linux-gnu | |
1153 | + ;; | |
1154 | + mips*-linux*) | |
1155 | + basic_machine=mips-unknown | |
1156 | + os=-linux-gnu | |
1157 | + ;; | |
1158 | mips3*-*) | |
1159 | basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` | |
1160 | ;; | |
1161 | @@ -419,21 +469,23 @@ | |
1162 | pc532 | pc532-*) | |
1163 | basic_machine=ns32k-pc532 | |
1164 | ;; | |
1165 | - pentium | p5 | p6) | |
1166 | - # We don't have specific support for the Intel Pentium (p6) followon yet, so just call it a Pentium | |
1167 | - basic_machine=i586-intel | |
1168 | + pentium | p5 | k5 | nexen) | |
1169 | + basic_machine=i586-pc | |
1170 | + ;; | |
1171 | + pentiumpro | p6 | k6 | 6x86) | |
1172 | + basic_machine=i686-pc | |
1173 | + ;; | |
1174 | + pentiumii | pentium2) | |
1175 | + basic_machine=i786-pc | |
1176 | ;; | |
1177 | - pentium-* | p5-* | p6-*) | |
1178 | - # We don't have specific support for the Intel Pentium (p6) followon yet, so just call it a Pentium | |
1179 | + pentium-* | p5-* | k5-* | nexen-*) | |
1180 | basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` | |
1181 | ;; | |
1182 | - k5) | |
1183 | - # We don't have specific support for AMD's K5 yet, so just call it a Pentium | |
1184 | - basic_machine=i586-amd | |
1185 | - ;; | |
1186 | - nexen) | |
1187 | - # We don't have specific support for Nexgen yet, so just call it a Pentium | |
1188 | - basic_machine=i586-nexgen | |
1189 | + pentiumpro-* | p6-* | k6-* | 6x86-*) | |
1190 | + basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` | |
1191 | + ;; | |
1192 | + pentiumii-* | pentium2-*) | |
1193 | + basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'` | |
1194 | ;; | |
1195 | pn) | |
1196 | basic_machine=pn-gould | |
1197 | @@ -517,6 +569,12 @@ | |
1198 | basic_machine=i386-sequent | |
1199 | os=-dynix | |
1200 | ;; | |
1201 | + tx39) | |
1202 | + basic_machine=mipstx39-unknown | |
1203 | + ;; | |
1204 | + tx39el) | |
1205 | + basic_machine=mipstx39el-unknown | |
1206 | + ;; | |
1207 | tower | tower-32) | |
1208 | basic_machine=m68k-ncr | |
1209 | ;; | |
1210 | @@ -536,6 +594,9 @@ | |
1211 | basic_machine=vax-dec | |
1212 | os=-vms | |
1213 | ;; | |
1214 | + vpp*|vx|vx-*) | |
1215 | + basic_machine=f301-fujitsu | |
1216 | + ;; | |
1217 | vxworks960) | |
1218 | basic_machine=i960-wrs | |
1219 | os=-vxworks | |
1220 | @@ -563,7 +624,11 @@ | |
1221 | # Here we handle the default manufacturer of certain CPU types. It is in | |
1222 | # some cases the only manufacturer, in others, it is the most popular. | |
1223 | mips) | |
1224 | - basic_machine=mips-mips | |
1225 | + if [ x$os = x-linux-gnu ]; then | |
1226 | + basic_machine=mips-unknown | |
1227 | + else | |
1228 | + basic_machine=mips-mips | |
1229 | + fi | |
1230 | ;; | |
1231 | romp) | |
1232 | basic_machine=romp-ibm | |
1233 | @@ -615,6 +680,8 @@ | |
1234 | if [ x"$os" != x"" ] | |
1235 | then | |
1236 | case $os in | |
1237 | + # First match some system type aliases | |
1238 | + # that might get confused with valid system types. | |
1239 | # -solaris* is a basic system type, with this one exception. | |
1240 | -solaris1 | -solaris1.*) | |
1241 | os=`echo $os | sed -e 's|solaris1|sunos4|'` | |
1242 | @@ -622,28 +689,37 @@ | |
1243 | -solaris) | |
1244 | os=-solaris2 | |
1245 | ;; | |
1246 | - -unixware* | svr4*) | |
1247 | + -svr4*) | |
1248 | os=-sysv4 | |
1249 | ;; | |
1250 | + -unixware*) | |
1251 | + os=-sysv4.2uw | |
1252 | + ;; | |
1253 | -gnu/linux*) | |
1254 | - os=`echo $os | sed -e 's|gnu/linux|linux|'` | |
1255 | + os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` | |
1256 | ;; | |
1257 | # First accept the basic system types. | |
1258 | # The portable systems comes first. | |
1259 | # Each alternative MUST END IN A *, to match a version number. | |
1260 | # -sysv* is not here because it comes later, after sysvr4. | |
1261 | -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ | |
1262 | - | -vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[345]* \ | |
1263 | + | -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\ | |
1264 | | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \ | |
1265 | - | -amigados* | -msdos* | -newsos* | -unicos* | -aos* \ | |
1266 | - | -nindy* | -vxworks* | -ebmon* | -hms* | -mvs* | -clix* \ | |
1267 | - | -riscos* | -linux* | -uniplus* | -iris* | -rtu* | -xenix* \ | |
1268 | - | -hiux* | -386bsd* | -netbsd* | -freebsd* | -riscix* \ | |
1269 | + | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ | |
1270 | + | -aos* \ | |
1271 | + | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ | |
1272 | + | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ | |
1273 | + | -hiux* | -386bsd* | -netbsd* | -openbsd* | -freebsd* | -riscix* \ | |
1274 | | -lynxos* | -bosx* | -nextstep* | -cxux* | -aout* | -elf* \ | |
1275 | | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ | |
1276 | - | -udi* | -eabi* | -lites* ) | |
1277 | + | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ | |
1278 | + | -cygwin32* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ | |
1279 | + | -mingw32* | -linux-gnu* | -uxpv*) | |
1280 | # Remember, each alternative MUST END IN *, to match a version number. | |
1281 | ;; | |
1282 | + -linux*) | |
1283 | + os=`echo $os | sed -e 's|linux|linux-gnu|'` | |
1284 | + ;; | |
1285 | -sunos5*) | |
1286 | os=`echo $os | sed -e 's|sunos5|solaris2|'` | |
1287 | ;; | |
1288 | @@ -668,6 +744,9 @@ | |
1289 | -ctix* | -uts*) | |
1290 | os=-sysv | |
1291 | ;; | |
1292 | + -ns2 ) | |
1293 | + os=-nextstep2 | |
1294 | + ;; | |
1295 | # Preserve the version number of sinix5. | |
1296 | -sinix5.*) | |
1297 | os=`echo $os | sed -e 's|sinix|sysv|'` | |
1298 | @@ -761,7 +840,7 @@ | |
1299 | os=-sysv | |
1300 | ;; | |
1301 | *-cbm) | |
1302 | - os=-amigados | |
1303 | + os=-amigaos | |
1304 | ;; | |
1305 | *-dg) | |
1306 | os=-dgux | |
1307 | @@ -775,6 +854,9 @@ | |
1308 | m88k-omron*) | |
1309 | os=-luna | |
1310 | ;; | |
1311 | + *-next ) | |
1312 | + os=-nextstep | |
1313 | + ;; | |
1314 | *-sequent) | |
1315 | os=-ptx | |
1316 | ;; | |
1317 | @@ -808,6 +890,9 @@ | |
1318 | *-masscomp) | |
1319 | os=-rtu | |
1320 | ;; | |
1321 | + f301-fujitsu) | |
1322 | + os=-uxpv | |
1323 | + ;; | |
1324 | *) | |
1325 | os=-none | |
1326 | ;; | |
1327 | @@ -826,9 +911,6 @@ | |
1328 | -sunos*) | |
1329 | vendor=sun | |
1330 | ;; | |
1331 | - -lynxos*) | |
1332 | - vendor=lynx | |
1333 | - ;; | |
1334 | -aix*) | |
1335 | vendor=ibm | |
1336 | ;; | |
1337 | @@ -856,8 +938,11 @@ | |
1338 | -ptx*) | |
1339 | vendor=sequent | |
1340 | ;; | |
1341 | - -vxworks*) | |
1342 | + -vxsim* | -vxworks*) | |
1343 | vendor=wrs | |
1344 | + ;; | |
1345 | + -aux*) | |
1346 | + vendor=apple | |
1347 | ;; | |
1348 | esac | |
1349 | basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` | |
1350 | diff -Nru at-3.1.8/daemon.c at-3.1.8.new/daemon.c | |
1351 | --- at-3.1.8/daemon.c Wed Mar 12 20:34:41 1997 | |
1352 | +++ at-3.1.8.new/daemon.c Sun Mar 28 19:46:41 1999 | |
1353 | @@ -72,7 +72,7 @@ | |
1354 | va_list args; | |
1355 | ||
1356 | va_start(args, fmt); | |
1357 | - vsprintf(buf, fmt, args); | |
1358 | + vsnprintf(buf, sizeof(buf), fmt, args); | |
1359 | va_end(args); | |
1360 | ||
1361 | if (daemon_debug) { | |
1362 | @@ -90,7 +90,7 @@ | |
1363 | va_list args; | |
1364 | ||
1365 | va_start(args, fmt); | |
1366 | - vsprintf(buf, fmt, args); | |
1367 | + vsnprintf(buf, sizeof(buf), fmt, args); | |
1368 | va_end(args); | |
1369 | ||
1370 | if (daemon_debug) { | |
1371 | @@ -127,6 +127,7 @@ | |
1372 | } | |
1373 | } | |
1374 | old_umask = umask(S_IWGRP | S_IWOTH); | |
1375 | + (void) setsid(); | |
1376 | ||
1377 | PRIV_START | |
1378 | ||
1379 | diff -Nru at-3.1.8/lex.yy.c at-3.1.8.new/lex.yy.c | |
1380 | --- at-3.1.8/lex.yy.c Sun Sep 28 22:00:37 1997 | |
1381 | +++ at-3.1.8.new/lex.yy.c Sun Mar 28 19:46:41 1999 | |
c5c90608 | 1382 | @@ -126,6 +126,7 @@ |
1383 | { \ | |
1384 | /* Undo effects of setting up yytext. */ \ | |
1385 | *yy_cp = yy_hold_char; \ | |
1386 | + YY_RESTORE_YY_MORE_OFFSET \ | |
1387 | yy_c_buf_p = yy_cp = yy_bp + n - YY_MORE_ADJ; \ | |
1388 | YY_DO_BEFORE_ACTION; /* set up yytext again */ \ | |
1389 | } \ | |
1390 | @@ -235,7 +236,7 @@ | |
1391 | #define YY_FLUSH_BUFFER yy_flush_buffer( yy_current_buffer ) | |
1392 | ||
1393 | YY_BUFFER_STATE yy_scan_buffer YY_PROTO(( char *base, yy_size_t size )); | |
1394 | -YY_BUFFER_STATE yy_scan_string YY_PROTO(( yyconst char *str )); | |
1395 | +YY_BUFFER_STATE yy_scan_string YY_PROTO(( yyconst char *yy_str )); | |
1396 | YY_BUFFER_STATE yy_scan_bytes YY_PROTO(( yyconst char *bytes, int len )); | |
1397 | ||
1398 | static void *yy_flex_alloc YY_PROTO(( yy_size_t )); | |
1399 | @@ -456,6 +457,7 @@ | |
1400 | #define REJECT reject_used_but_not_detected | |
1401 | #define yymore() yymore_used_but_not_detected | |
1402 | #define YY_MORE_ADJ 0 | |
1403 | +#define YY_RESTORE_YY_MORE_OFFSET | |
1404 | char *yytext; | |
1405 | #line 1 "parsetime.l" | |
1406 | #define INITIAL 0 | |
1407 | @@ -491,7 +493,7 @@ | |
1408 | result = 1; \ | |
1409 | } \ | |
1410 | } while(0) | |
1411 | -#line 495 "lex.yy.c" | |
1412 | +#line 497 "lex.yy.c" | |
1413 | ||
1414 | /* Macros after this point can all be overridden by user definitions in | |
1415 | * section 1. | |
1416 | @@ -513,6 +515,10 @@ | |
1417 | static void yy_flex_strncpy YY_PROTO(( char *, yyconst char *, int )); | |
1418 | #endif | |
1419 | ||
1420 | +#ifdef YY_NEED_STRLEN | |
1421 | +static int yy_flex_strlen YY_PROTO(( yyconst char * )); | |
1422 | +#endif | |
1423 | + | |
1424 | #ifndef YY_NO_INPUT | |
1425 | #ifdef __cplusplus | |
1426 | static int yyinput YY_PROTO(( void )); | |
1427 | @@ -641,7 +647,7 @@ | |
1428 | #line 36 "parsetime.l" | |
1429 | ||
1430 | ||
1431 | -#line 645 "lex.yy.c" | |
1432 | +#line 651 "lex.yy.c" | |
1433 | ||
1434 | if ( yy_init ) | |
1435 | { | |
1436 | @@ -919,7 +925,7 @@ | |
1437 | #line 77 "parsetime.l" | |
1438 | ECHO; | |
1439 | YY_BREAK | |
1440 | -#line 923 "lex.yy.c" | |
1441 | +#line 929 "lex.yy.c" | |
1442 | case YY_STATE_EOF(INITIAL): | |
1443 | yyterminate(); | |
1444 | ||
1445 | @@ -930,6 +936,7 @@ | |
1446 | ||
1447 | /* Undo the effects of YY_DO_BEFORE_ACTION. */ | |
1448 | *yy_cp = yy_hold_char; | |
1449 | + YY_RESTORE_YY_MORE_OFFSET | |
1450 | ||
1451 | if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_NEW ) | |
1452 | { | |
1453 | @@ -1075,7 +1082,7 @@ | |
1454 | { /* Don't try to fill the buffer, so this is an EOF. */ | |
1455 | if ( yy_c_buf_p - yytext_ptr - YY_MORE_ADJ == 1 ) | |
1456 | { | |
1457 | - /* We matched a singled characater, the EOB, so | |
1458 | + /* We matched a single character, the EOB, so | |
1459 | * treat this as a final EOF. | |
1460 | */ | |
1461 | return EOB_ACT_END_OF_FILE; | |
1462 | @@ -1102,7 +1109,7 @@ | |
1463 | /* don't do the read, it's not guaranteed to return an EOF, | |
1464 | * just force an EOF | |
1465 | */ | |
1466 | - yy_n_chars = 0; | |
1467 | + yy_current_buffer->yy_n_chars = yy_n_chars = 0; | |
1468 | ||
1469 | else | |
1470 | { | |
1471 | @@ -1157,6 +1164,8 @@ | |
1472 | /* Read in more data. */ | |
1473 | YY_INPUT( (&yy_current_buffer->yy_ch_buf[number_to_move]), | |
1474 | yy_n_chars, num_to_read ); | |
1475 | + | |
1476 | + yy_current_buffer->yy_n_chars = yy_n_chars; | |
1477 | } | |
1478 | ||
1479 | if ( yy_n_chars == 0 ) | |
1480 | @@ -1281,7 +1290,8 @@ | |
1481 | ||
1482 | yy_cp += (int) (dest - source); | |
1483 | yy_bp += (int) (dest - source); | |
1484 | - yy_n_chars = yy_current_buffer->yy_buf_size; | |
1485 | + yy_current_buffer->yy_n_chars = | |
1486 | + yy_n_chars = yy_current_buffer->yy_buf_size; | |
1487 | ||
1488 | if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 ) | |
1489 | YY_FATAL_ERROR( "flex scanner push-back overflow" ); | |
1490 | @@ -1319,19 +1329,31 @@ | |
1491 | ||
1492 | else | |
1493 | { /* need more input */ | |
1494 | - yytext_ptr = yy_c_buf_p; | |
1495 | + int offset = yy_c_buf_p - yytext_ptr; | |
1496 | ++yy_c_buf_p; | |
1497 | ||
1498 | switch ( yy_get_next_buffer() ) | |
1499 | { | |
1500 | + case EOB_ACT_LAST_MATCH: | |
1501 | + /* This happens because yy_g_n_b() | |
1502 | + * sees that we've accumulated a | |
1503 | + * token and flags that we need to | |
1504 | + * try matching the token before | |
1505 | + * proceeding. But for input(), | |
1506 | + * there's no matching to consider. | |
1507 | + * So convert the EOB_ACT_LAST_MATCH | |
1508 | + * to EOB_ACT_END_OF_FILE. | |
1509 | + */ | |
1510 | + | |
1511 | + /* Reset buffer status. */ | |
1512 | + yyrestart( yyin ); | |
1513 | + | |
1514 | + /* fall through */ | |
1515 | + | |
1516 | case EOB_ACT_END_OF_FILE: | |
1517 | { | |
1518 | if ( yywrap() ) | |
1519 | - { | |
1520 | - yy_c_buf_p = | |
1521 | - yytext_ptr + YY_MORE_ADJ; | |
1522 | return EOF; | |
1523 | - } | |
1524 | ||
1525 | if ( ! yy_did_buffer_switch_on_eof ) | |
1526 | YY_NEW_FILE; | |
1527 | @@ -1343,17 +1365,8 @@ | |
1528 | } | |
1529 | ||
1530 | case EOB_ACT_CONTINUE_SCAN: | |
1531 | - yy_c_buf_p = yytext_ptr + YY_MORE_ADJ; | |
1532 | + yy_c_buf_p = yytext_ptr + offset; | |
1533 | break; | |
1534 | - | |
1535 | - case EOB_ACT_LAST_MATCH: | |
1536 | -#ifdef __cplusplus | |
1537 | - YY_FATAL_ERROR( | |
1538 | - "unexpected last match in yyinput()" ); | |
1539 | -#else | |
1540 | - YY_FATAL_ERROR( | |
1541 | - "unexpected last match in input()" ); | |
1542 | -#endif | |
1543 | } | |
1544 | } | |
1545 | } | |
1546 | @@ -1517,6 +1530,9 @@ | |
1547 | #endif | |
1548 | ||
1549 | { | |
1550 | + if ( ! b ) | |
1551 | + return; | |
1552 | + | |
1553 | b->yy_n_chars = 0; | |
1554 | ||
1555 | /* We always need two end-of-buffer characters. The first causes | |
1556 | @@ -1576,17 +1592,17 @@ | |
1557 | ||
1558 | #ifndef YY_NO_SCAN_STRING | |
1559 | #ifdef YY_USE_PROTOS | |
1560 | -YY_BUFFER_STATE yy_scan_string( yyconst char *str ) | |
1561 | +YY_BUFFER_STATE yy_scan_string( yyconst char *yy_str ) | |
1562 | #else | |
1563 | -YY_BUFFER_STATE yy_scan_string( str ) | |
1564 | -yyconst char *str; | |
1565 | +YY_BUFFER_STATE yy_scan_string( yy_str ) | |
1566 | +yyconst char *yy_str; | |
1567 | #endif | |
1568 | { | |
1569 | int len; | |
1570 | - for ( len = 0; str[len]; ++len ) | |
1571 | + for ( len = 0; yy_str[len]; ++len ) | |
1572 | ; | |
1573 | ||
1574 | - return yy_scan_bytes( str, len ); | |
1575 | + return yy_scan_bytes( yy_str, len ); | |
1576 | } | |
1577 | #endif | |
1578 | ||
1579 | @@ -1707,7 +1723,7 @@ | |
1580 | { \ | |
1581 | /* Undo effects of setting up yytext. */ \ | |
1582 | yytext[yyleng] = yy_hold_char; \ | |
1583 | - yy_c_buf_p = yytext + n - YY_MORE_ADJ; \ | |
1584 | + yy_c_buf_p = yytext + n; \ | |
1585 | yy_hold_char = *yy_c_buf_p; \ | |
1586 | *yy_c_buf_p = '\0'; \ | |
1587 | yyleng = n; \ | |
1588 | @@ -1730,6 +1746,22 @@ | |
1589 | register int i; | |
1590 | for ( i = 0; i < n; ++i ) | |
1591 | s1[i] = s2[i]; | |
1592 | + } | |
1593 | +#endif | |
1594 | + | |
1595 | +#ifdef YY_NEED_STRLEN | |
1596 | +#ifdef YY_USE_PROTOS | |
1597 | +static int yy_flex_strlen( yyconst char *s ) | |
1598 | +#else | |
1599 | +static int yy_flex_strlen( s ) | |
1600 | +yyconst char *s; | |
1601 | +#endif | |
1602 | + { | |
1603 | + register int n; | |
1604 | + for ( n = 0; s[n]; ++n ) | |
1605 | + ; | |
1606 | + | |
1607 | + return n; | |
1608 | } | |
1609 | #endif | |
1610 | ||
1611 | diff -Nru at-3.1.8/panic.c at-3.1.8.new/panic.c | |
1612 | --- at-3.1.8/panic.c Sun Sep 28 22:00:37 1997 | |
1613 | +++ at-3.1.8.new/panic.c Sun Mar 28 19:46:41 1999 | |
1614 | @@ -41,6 +41,7 @@ | |
1615 | /* Local headers */ | |
1616 | ||
1617 | #include "panic.h" | |
1618 | +#include "privs.h" | |
1619 | #include "at.h" | |
1620 | ||
1621 | /* File scope variables */ | |
1622 | @@ -72,12 +73,15 @@ | |
1623 | va_list args; | |
1624 | ||
1625 | va_start(args, fmt); | |
1626 | - vsprintf(buf, fmt, args); | |
1627 | + vsnprintf(buf, sizeof(buf), fmt, args); | |
1628 | va_end(args); | |
1629 | ||
1630 | perror(buf); | |
1631 | - if (fcreated) | |
1632 | + if (fcreated) { | |
1633 | + PRIV_START | |
1634 | unlink(atfile); | |
1635 | + PRIV_END | |
1636 | + } | |
1637 | ||
1638 | exit(EXIT_FAILURE); | |
1639 | } | |
1640 | @@ -88,7 +92,7 @@ | |
1641 | /* Print usage and exit. | |
1642 | */ | |
1643 | fprintf(stderr, "Usage: at [-V] [-q x] [-f file] [-m] time\n" | |
1644 | - " atq [-V] [-q x] [-v]\n" | |
1645 | + " atq [-V] [-q x]\n" | |
1646 | " atrm [-V] [-q x] job ...\n" | |
1647 | " batch [-V] [-f file] [-m]\n"); | |
1648 | exit(EXIT_FAILURE); | |
1649 | diff -Nru at-3.1.8/parsetime.y at-3.1.8.new/parsetime.y | |
1650 | --- at-3.1.8/parsetime.y Sun Sep 28 20:21:29 1997 | |
1651 | +++ at-3.1.8.new/parsetime.y Sun Mar 28 19:46:41 1999 | |
1652 | @@ -11,6 +11,9 @@ | |
1653 | static int isgmt; | |
1654 | static int time_only; | |
1655 | ||
1656 | +extern int yyerror(char *s); | |
1657 | +extern int yylex(); | |
1658 | + | |
1659 | int add_date(int number, int period); | |
1660 | %} | |
1661 | ||
1662 | @@ -181,6 +184,15 @@ | |
1663 | ; | |
1664 | ||
1665 | am_pm : AM | |
1666 | + { | |
1667 | + if (exectm.tm_hour > 12) { | |
1668 | + yyerror("Hour too large for AM"); | |
1669 | + YYERROR; | |
1670 | + } | |
1671 | + else if (exectm.tm_hour == 12) { | |
1672 | + exectm.tm_hour = 0; | |
1673 | + } | |
1674 | + } | |
1675 | | PM | |
1676 | { | |
1677 | if (exectm.tm_hour > 12) { | |
1678 | @@ -258,13 +270,13 @@ | |
1679 | ; | |
1680 | ||
1681 | ||
1682 | -day_of_week : SUN { $$ = 0; } | |
1683 | - | MON { $$ = 1; } | |
1684 | - | TUE { $$ = 2; } | |
1685 | - | WED { $$ = 3; } | |
1686 | - | THU { $$ = 4; } | |
1687 | - | FRI { $$ = 5; } | |
1688 | - | SAT { $$ = 6; } | |
1689 | +day_of_week : MON { $$ = 0; } | |
1690 | + | TUE { $$ = 1; } | |
1691 | + | WED { $$ = 2; } | |
1692 | + | THU { $$ = 3; } | |
1693 | + | FRI { $$ = 4; } | |
1694 | + | SAT { $$ = 5; } | |
1695 | + | SUN { $$ = 6; } | |
1696 | ; | |
1697 | ||
1698 | inc_number : INT | |
1699 | diff -Nru at-3.1.8/y.tab.c at-3.1.8.new/y.tab.c | |
1700 | --- at-3.1.8/y.tab.c Sun Sep 28 20:21:31 1997 | |
1701 | +++ at-3.1.8.new/y.tab.c Sun Mar 28 19:46:41 1999 | |
1702 | @@ -1,5 +1,6 @@ | |
1703 | ||
1704 | -/* A Bison parser, made from parsetime.y with Bison version GNU Bison version 1.22 | |
1705 | +/* A Bison parser, made from parsetime.y | |
1706 | + by GNU Bison version 1.25 | |
1707 | */ | |
1708 | ||
1709 | #define YYBISON 1 /* Identify Bison output. */ | |
1710 | @@ -55,30 +56,16 @@ | |
1711 | static int isgmt; | |
1712 | static int time_only; | |
1713 | ||
1714 | +extern int yyerror(char *s); | |
1715 | +extern int yylex(); | |
1716 | + | |
1717 | int add_date(int number, int period); | |
1718 | ||
1719 | -#line 17 "parsetime.y" | |
1720 | +#line 20 "parsetime.y" | |
1721 | typedef union { | |
1722 | char * charval; | |
1723 | int intval; | |
1724 | } YYSTYPE; | |
1725 | - | |
1726 | -#ifndef YYLTYPE | |
1727 | -typedef | |
1728 | - struct yyltype | |
1729 | - { | |
1730 | - int timestamp; | |
1731 | - int first_line; | |
1732 | - int first_column; | |
1733 | - int last_line; | |
1734 | - int last_column; | |
1735 | - char *text; | |
1736 | - } | |
1737 | - yyltype; | |
1738 | - | |
1739 | -#define YYLTYPE yyltype | |
1740 | -#endif | |
1741 | - | |
1742 | #include <stdio.h> | |
1743 | ||
1744 | #ifndef __cplusplus | |
1745 | @@ -158,9 +145,9 @@ | |
1746 | 0, 55, 0, 3, 0, 5, 0, 6, 0, 26, | |
1747 | 0, 27, 0, 28, 0, 29, 0, 30, 0, 31, | |
1748 | 0, 32, 0, 33, 0, 34, 0, 35, 0, 36, | |
1749 | - 0, 37, 0, 3, 0, 3, 0, 3, 0, 10, | |
1750 | - 0, 11, 0, 12, 0, 13, 0, 14, 0, 15, | |
1751 | - 0, 16, 0, 3, 0, 44, 0, 45, 0, 41, | |
1752 | + 0, 37, 0, 3, 0, 3, 0, 3, 0, 11, | |
1753 | + 0, 12, 0, 13, 0, 14, 0, 15, 0, 16, | |
1754 | + 0, 10, 0, 3, 0, 44, 0, 45, 0, 41, | |
1755 | 0, 46, 0, 39, 0 | |
1756 | }; | |
1757 | ||
1758 | @@ -168,24 +155,28 @@ | |
1759 | ||
1760 | #if YYDEBUG != 0 | |
1761 | static const short yyrline[] = { 0, | |
1762 | - 39, 43, 44, 45, 46, 47, 48, 51, 52, 53, | |
1763 | - 56, 59, 60, 61, 62, 63, 64, 65, 66, 67, | |
1764 | - 72, 78, 85, 86, 87, 91, 92, 96, 97, 98, | |
1765 | - 99, 100, 101, 104, 108, 112, 118, 124, 125, 126, | |
1766 | - 127, 128, 129, 132, 157, 170, 173, 183, 184, 197, | |
1767 | - 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, | |
1768 | - 208, 211, 225, 238, 261, 262, 263, 264, 265, 266, | |
1769 | - 267, 270, 280, 281, 282, 283, 284 | |
1770 | + 42, 46, 47, 48, 49, 50, 51, 54, 55, 56, | |
1771 | + 59, 62, 63, 64, 65, 66, 67, 68, 69, 70, | |
1772 | + 75, 81, 88, 89, 90, 94, 95, 99, 100, 101, | |
1773 | + 102, 103, 104, 107, 111, 115, 121, 127, 128, 129, | |
1774 | + 130, 131, 132, 135, 160, 173, 176, 186, 187, 200, | |
1775 | + 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, | |
1776 | + 211, 214, 228, 241, 264, 265, 266, 267, 268, 269, | |
1777 | + 270, 273, 283, 284, 285, 286, 287 | |
1778 | }; | |
1779 | +#endif | |
1780 | ||
1781 | -static const char * const yytname[] = { "$","error","$illegal.","INT","NOW", | |
1782 | + | |
1783 | +#if YYDEBUG != 0 || defined (YYERROR_VERBOSE) | |
1784 | + | |
1785 | +static const char * const yytname[] = { "$","error","$undefined.","INT","NOW", | |
1786 | "AM","PM","NOON","MIDNIGHT","TEATIME","SUN","MON","TUE","WED","THU","FRI","SAT", | |
1787 | "TODAY","TOMORROW","NEXT","MINUTE","HOUR","DAY","WEEK","MONTH","YEAR","JAN", | |
1788 | "FEB","MAR","APR","MAY","JUN","JUL","AUG","SEP","OCT","NOV","DEC","WORD","','", | |
1789 | -"'-'","'.'","'/'","'+'","':'","'\\''","'h'","timespec","nowspec","now","time", | |
1790 | +"'-'","'.'","'/'","'+'","':'","'''","'h'","timespec","nowspec","now","time", | |
1791 | "date","increment","decrement","inc_period","hr24clock_hr_min","timezone_name", | |
1792 | "hr24clock_hour","minute","am_pm","month_name","month_number","day_number","year_number", | |
1793 | -"day_of_week","inc_number","time_sep","" | |
1794 | +"day_of_week","inc_number","time_sep", NULL | |
1795 | }; | |
1796 | #endif | |
1797 | ||
1798 | @@ -213,8 +204,8 @@ | |
1799 | ||
1800 | static const short yydefact[] = { 0, | |
1801 | 44, 11, 20, 21, 22, 7, 8, 1, 12, 0, | |
1802 | - 0, 0, 0, 9, 10, 63, 65, 66, 67, 68, | |
1803 | - 69, 70, 71, 26, 27, 50, 51, 52, 53, 54, | |
1804 | + 0, 0, 0, 9, 10, 63, 71, 65, 66, 67, | |
1805 | + 68, 69, 70, 26, 27, 50, 51, 52, 53, 54, | |
1806 | 55, 56, 57, 58, 59, 60, 61, 2, 3, 5, | |
1807 | 0, 0, 0, 0, 25, 45, 13, 48, 49, 77, | |
1808 | 75, 73, 74, 76, 16, 0, 38, 39, 40, 41, | |
1809 | @@ -283,14 +274,14 @@ | |
1810 | -1, 41 | |
1811 | }; | |
1812 | /* -*-C-*- Note some compilers choke on comments on `#line' lines. */ | |
1813 | -#line 3 "/usr/lib/bison.simple" | |
1814 | +#line 3 "/usr/share/misc/bison.simple" | |
1815 | ||
1816 | /* Skeleton output parser for bison, | |
1817 | - Copyright (C) 1984, 1989, 1990 Bob Corbett and Richard Stallman | |
1818 | + Copyright (C) 1984, 1989, 1990 Free Software Foundation, Inc. | |
1819 | ||
1820 | This program is free software; you can redistribute it and/or modify | |
1821 | it under the terms of the GNU General Public License as published by | |
1822 | - the Free Software Foundation; either version 1, or (at your option) | |
1823 | + the Free Software Foundation; either version 2, or (at your option) | |
1824 | any later version. | |
1825 | ||
1826 | This program is distributed in the hope that it will be useful, | |
1827 | @@ -300,8 +291,12 @@ | |
1828 | ||
1829 | You should have received a copy of the GNU General Public License | |
1830 | along with this program; if not, write to the Free Software | |
1831 | - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ | |
1832 | + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ | |
1833 | ||
1834 | +/* As a special exception, when this file is copied by Bison into a | |
1835 | + Bison output file, you may use that output file without restriction. | |
1836 | + This special exception was added by the Free Software Foundation | |
1837 | + in version 1.24 of Bison. */ | |
1838 | ||
1839 | #ifndef alloca | |
1840 | #ifdef __GNUC__ | |
1841 | @@ -375,10 +370,18 @@ | |
1842 | ||
1843 | #ifdef YYPURE | |
1844 | #ifdef YYLSP_NEEDED | |
1845 | +#ifdef YYLEX_PARAM | |
1846 | +#define YYLEX yylex(&yylval, &yylloc, YYLEX_PARAM) | |
1847 | +#else | |
1848 | #define YYLEX yylex(&yylval, &yylloc) | |
1849 | +#endif | |
1850 | +#else /* not YYLSP_NEEDED */ | |
1851 | +#ifdef YYLEX_PARAM | |
1852 | +#define YYLEX yylex(&yylval, YYLEX_PARAM) | |
1853 | #else | |
1854 | #define YYLEX yylex(&yylval) | |
1855 | #endif | |
1856 | +#endif /* not YYLSP_NEEDED */ | |
1857 | #endif | |
1858 | ||
1859 | /* If nonreentrant, generate the variables here */ | |
1860 | @@ -426,16 +429,16 @@ | |
1861 | #endif | |
1862 | \f | |
1863 | #if __GNUC__ > 1 /* GNU C and GNU C++ define this. */ | |
1864 | -#define __yy_bcopy(FROM,TO,COUNT) __builtin_memcpy(TO,FROM,COUNT) | |
1865 | +#define __yy_memcpy(TO,FROM,COUNT) __builtin_memcpy(TO,FROM,COUNT) | |
1866 | #else /* not GNU C or C++ */ | |
1867 | #ifndef __cplusplus | |
1868 | ||
1869 | /* This is the most reliable way to avoid incompatibilities | |
1870 | in available built-in functions on various systems. */ | |
1871 | static void | |
1872 | -__yy_bcopy (from, to, count) | |
1873 | - char *from; | |
1874 | +__yy_memcpy (to, from, count) | |
1875 | char *to; | |
1876 | + char *from; | |
1877 | int count; | |
1878 | { | |
1879 | register char *f = from; | |
1880 | @@ -451,7 +454,7 @@ | |
1881 | /* This is the most reliable way to avoid incompatibilities | |
1882 | in available built-in functions on various systems. */ | |
1883 | static void | |
1884 | -__yy_bcopy (char *from, char *to, int count) | |
1885 | +__yy_memcpy (char *to, char *from, int count) | |
1886 | { | |
1887 | register char *f = from; | |
1888 | register char *t = to; | |
1889 | @@ -464,9 +467,30 @@ | |
1890 | #endif | |
1891 | #endif | |
1892 | \f | |
1893 | -#line 184 "/usr/lib/bison.simple" | |
1894 | +#line 196 "/usr/share/misc/bison.simple" | |
1895 | + | |
1896 | +/* The user can define YYPARSE_PARAM as the name of an argument to be passed | |
1897 | + into yyparse. The argument should have type void *. | |
1898 | + It should actually point to an object. | |
1899 | + Grammar actions can access the variable by casting it | |
1900 | + to the proper pointer type. */ | |
1901 | + | |
1902 | +#ifdef YYPARSE_PARAM | |
1903 | +#ifdef __cplusplus | |
1904 | +#define YYPARSE_PARAM_ARG void *YYPARSE_PARAM | |
1905 | +#define YYPARSE_PARAM_DECL | |
1906 | +#else /* not __cplusplus */ | |
1907 | +#define YYPARSE_PARAM_ARG YYPARSE_PARAM | |
1908 | +#define YYPARSE_PARAM_DECL void *YYPARSE_PARAM; | |
1909 | +#endif /* not __cplusplus */ | |
1910 | +#else /* not YYPARSE_PARAM */ | |
1911 | +#define YYPARSE_PARAM_ARG | |
1912 | +#define YYPARSE_PARAM_DECL | |
1913 | +#endif /* not YYPARSE_PARAM */ | |
1914 | + | |
1915 | int | |
1916 | -yyparse() | |
1917 | +yyparse(YYPARSE_PARAM_ARG) | |
1918 | + YYPARSE_PARAM_DECL | |
1919 | { | |
1920 | register int yystate; | |
1921 | register int yyn; | |
1922 | @@ -582,12 +606,12 @@ | |
1923 | if (yystacksize > YYMAXDEPTH) | |
1924 | yystacksize = YYMAXDEPTH; | |
1925 | yyss = (short *) alloca (yystacksize * sizeof (*yyssp)); | |
1926 | - __yy_bcopy ((char *)yyss1, (char *)yyss, size * sizeof (*yyssp)); | |
1927 | + __yy_memcpy ((char *)yyss, (char *)yyss1, size * sizeof (*yyssp)); | |
1928 | yyvs = (YYSTYPE *) alloca (yystacksize * sizeof (*yyvsp)); | |
1929 | - __yy_bcopy ((char *)yyvs1, (char *)yyvs, size * sizeof (*yyvsp)); | |
1930 | + __yy_memcpy ((char *)yyvs, (char *)yyvs1, size * sizeof (*yyvsp)); | |
1931 | #ifdef YYLSP_NEEDED | |
1932 | yyls = (YYLTYPE *) alloca (yystacksize * sizeof (*yylsp)); | |
1933 | - __yy_bcopy ((char *)yyls1, (char *)yyls, size * sizeof (*yylsp)); | |
1934 | + __yy_memcpy ((char *)yyls, (char *)yyls1, size * sizeof (*yylsp)); | |
1935 | #endif | |
1936 | #endif /* no yyoverflow */ | |
1937 | ||
1938 | @@ -748,20 +772,20 @@ | |
1939 | switch (yyn) { | |
1940 | ||
1941 | case 1: | |
1942 | -#line 40 "parsetime.y" | |
1943 | +#line 43 "parsetime.y" | |
1944 | { | |
1945 | time_only = 1; | |
1946 | ; | |
1947 | break;} | |
1948 | case 20: | |
1949 | -#line 68 "parsetime.y" | |
1950 | +#line 71 "parsetime.y" | |
1951 | { | |
1952 | exectm.tm_hour = 12; | |
1953 | exectm.tm_min = 0; | |
1954 | ; | |
1955 | break;} | |
1956 | case 21: | |
1957 | -#line 73 "parsetime.y" | |
1958 | +#line 76 "parsetime.y" | |
1959 | { | |
1960 | exectm.tm_hour = 0; | |
1961 | exectm.tm_min = 0; | |
1962 | @@ -769,74 +793,74 @@ | |
1963 | ; | |
1964 | break;} | |
1965 | case 22: | |
1966 | -#line 79 "parsetime.y" | |
1967 | +#line 82 "parsetime.y" | |
1968 | { | |
1969 | exectm.tm_hour = 16; | |
1970 | exectm.tm_min = 0; | |
1971 | ; | |
1972 | break;} | |
1973 | case 25: | |
1974 | -#line 88 "parsetime.y" | |
1975 | +#line 91 "parsetime.y" | |
1976 | { | |
1977 | add_date ((7 + yyvsp[0].intval - exectm.tm_wday) %7 + 1, DAY); | |
1978 | ; | |
1979 | break;} | |
1980 | case 27: | |
1981 | -#line 93 "parsetime.y" | |
1982 | +#line 96 "parsetime.y" | |
1983 | { | |
1984 | add_date(1, DAY); | |
1985 | ; | |
1986 | break;} | |
1987 | case 34: | |
1988 | -#line 105 "parsetime.y" | |
1989 | +#line 108 "parsetime.y" | |
1990 | { | |
1991 | add_date(yyvsp[-1].intval, yyvsp[0].intval); | |
1992 | ; | |
1993 | break;} | |
1994 | case 35: | |
1995 | -#line 109 "parsetime.y" | |
1996 | +#line 112 "parsetime.y" | |
1997 | { | |
1998 | add_date(1, yyvsp[0].intval); | |
1999 | ; | |
2000 | break;} | |
2001 | case 36: | |
2002 | -#line 113 "parsetime.y" | |
2003 | +#line 116 "parsetime.y" | |
2004 | { | |
2005 | add_date ((6 + yyvsp[0].intval - exectm.tm_wday) %7 +1, DAY); | |
2006 | ; | |
2007 | break;} | |
2008 | case 37: | |
2009 | -#line 119 "parsetime.y" | |
2010 | +#line 122 "parsetime.y" | |
2011 | { | |
2012 | add_date(-yyvsp[-1].intval, yyvsp[0].intval); | |
2013 | ; | |
2014 | break;} | |
2015 | case 38: | |
2016 | -#line 124 "parsetime.y" | |
2017 | +#line 127 "parsetime.y" | |
2018 | { yyval.intval = MINUTE ; ; | |
2019 | break;} | |
2020 | case 39: | |
2021 | -#line 125 "parsetime.y" | |
2022 | +#line 128 "parsetime.y" | |
2023 | { yyval.intval = HOUR ; ; | |
2024 | break;} | |
2025 | case 40: | |
2026 | -#line 126 "parsetime.y" | |
2027 | +#line 129 "parsetime.y" | |
2028 | { yyval.intval = DAY ; ; | |
2029 | break;} | |
2030 | case 41: | |
2031 | -#line 127 "parsetime.y" | |
2032 | +#line 130 "parsetime.y" | |
2033 | { yyval.intval = WEEK ; ; | |
2034 | break;} | |
2035 | case 42: | |
2036 | -#line 128 "parsetime.y" | |
2037 | +#line 131 "parsetime.y" | |
2038 | { yyval.intval = MONTH ; ; | |
2039 | break;} | |
2040 | case 43: | |
2041 | -#line 129 "parsetime.y" | |
2042 | +#line 132 "parsetime.y" | |
2043 | { yyval.intval = YEAR ; ; | |
2044 | break;} | |
2045 | case 44: | |
2046 | -#line 133 "parsetime.y" | |
2047 | +#line 136 "parsetime.y" | |
2048 | { | |
2049 | exectm.tm_min = -1; | |
2050 | exectm.tm_hour = -1; | |
2051 | @@ -861,7 +885,7 @@ | |
2052 | ; | |
2053 | break;} | |
2054 | case 45: | |
2055 | -#line 158 "parsetime.y" | |
2056 | +#line 161 "parsetime.y" | |
2057 | { | |
2058 | if (strcasecmp(yyvsp[0].charval,"utc") == 0) { | |
2059 | isgmt = 1; | |
2060 | @@ -874,7 +898,7 @@ | |
2061 | ; | |
2062 | break;} | |
2063 | case 47: | |
2064 | -#line 174 "parsetime.y" | |
2065 | +#line 177 "parsetime.y" | |
2066 | { | |
2067 | if (sscanf(yyvsp[0].charval, "%d", &exectm.tm_min) != 1) { | |
2068 | yyerror("Error in minute"); | |
2069 | @@ -884,7 +908,7 @@ | |
2070 | ; | |
2071 | break;} | |
2072 | case 49: | |
2073 | -#line 185 "parsetime.y" | |
2074 | +#line 188 "parsetime.y" | |
2075 | { | |
2076 | if (exectm.tm_hour > 12) { | |
2077 | yyerror("Hour too large for PM"); | |
2078 | @@ -896,55 +920,55 @@ | |
2079 | ; | |
2080 | break;} | |
2081 | case 50: | |
2082 | -#line 197 "parsetime.y" | |
2083 | +#line 200 "parsetime.y" | |
2084 | { exectm.tm_mon = 0; ; | |
2085 | break;} | |
2086 | case 51: | |
2087 | -#line 198 "parsetime.y" | |
2088 | +#line 201 "parsetime.y" | |
2089 | { exectm.tm_mon = 1; ; | |
2090 | break;} | |
2091 | case 52: | |
2092 | -#line 199 "parsetime.y" | |
2093 | +#line 202 "parsetime.y" | |
2094 | { exectm.tm_mon = 2; ; | |
2095 | break;} | |
2096 | case 53: | |
2097 | -#line 200 "parsetime.y" | |
2098 | +#line 203 "parsetime.y" | |
2099 | { exectm.tm_mon = 3; ; | |
2100 | break;} | |
2101 | case 54: | |
2102 | -#line 201 "parsetime.y" | |
2103 | +#line 204 "parsetime.y" | |
2104 | { exectm.tm_mon = 4; ; | |
2105 | break;} | |
2106 | case 55: | |
2107 | -#line 202 "parsetime.y" | |
2108 | +#line 205 "parsetime.y" | |
2109 | { exectm.tm_mon = 5; ; | |
2110 | break;} | |
2111 | case 56: | |
2112 | -#line 203 "parsetime.y" | |
2113 | +#line 206 "parsetime.y" | |
2114 | { exectm.tm_mon = 6; ; | |
2115 | break;} | |
2116 | case 57: | |
2117 | -#line 204 "parsetime.y" | |
2118 | +#line 207 "parsetime.y" | |
2119 | { exectm.tm_mon = 7; ; | |
2120 | break;} | |
2121 | case 58: | |
2122 | -#line 205 "parsetime.y" | |
2123 | +#line 208 "parsetime.y" | |
2124 | { exectm.tm_mon = 8; ; | |
2125 | break;} | |
2126 | case 59: | |
2127 | -#line 206 "parsetime.y" | |
2128 | +#line 209 "parsetime.y" | |
2129 | { exectm.tm_mon = 9; ; | |
2130 | break;} | |
2131 | case 60: | |
2132 | -#line 207 "parsetime.y" | |
2133 | +#line 210 "parsetime.y" | |
2134 | { exectm.tm_mon =10; ; | |
2135 | break;} | |
2136 | case 61: | |
2137 | -#line 208 "parsetime.y" | |
2138 | +#line 211 "parsetime.y" | |
2139 | { exectm.tm_mon =11; ; | |
2140 | break;} | |
2141 | case 62: | |
2142 | -#line 212 "parsetime.y" | |
2143 | +#line 215 "parsetime.y" | |
2144 | { | |
2145 | { | |
2146 | int mnum = -1; | |
2147 | @@ -960,7 +984,7 @@ | |
2148 | ; | |
2149 | break;} | |
2150 | case 63: | |
2151 | -#line 226 "parsetime.y" | |
2152 | +#line 229 "parsetime.y" | |
2153 | { | |
2154 | exectm.tm_mday = -1; | |
2155 | sscanf(yyvsp[0].charval, "%d", &exectm.tm_mday); | |
2156 | @@ -973,7 +997,7 @@ | |
2157 | ; | |
2158 | break;} | |
2159 | case 64: | |
2160 | -#line 239 "parsetime.y" | |
2161 | +#line 242 "parsetime.y" | |
2162 | { | |
2163 | { | |
2164 | int ynum; | |
2165 | @@ -995,35 +1019,35 @@ | |
2166 | ; | |
2167 | break;} | |
2168 | case 65: | |
2169 | -#line 261 "parsetime.y" | |
2170 | +#line 264 "parsetime.y" | |
2171 | { yyval.intval = 0; ; | |
2172 | break;} | |
2173 | case 66: | |
2174 | -#line 262 "parsetime.y" | |
2175 | +#line 265 "parsetime.y" | |
2176 | { yyval.intval = 1; ; | |
2177 | break;} | |
2178 | case 67: | |
2179 | -#line 263 "parsetime.y" | |
2180 | +#line 266 "parsetime.y" | |
2181 | { yyval.intval = 2; ; | |
2182 | break;} | |
2183 | case 68: | |
2184 | -#line 264 "parsetime.y" | |
2185 | +#line 267 "parsetime.y" | |
2186 | { yyval.intval = 3; ; | |
2187 | break;} | |
2188 | case 69: | |
2189 | -#line 265 "parsetime.y" | |
2190 | +#line 268 "parsetime.y" | |
2191 | { yyval.intval = 4; ; | |
2192 | break;} | |
2193 | case 70: | |
2194 | -#line 266 "parsetime.y" | |
2195 | +#line 269 "parsetime.y" | |
2196 | { yyval.intval = 5; ; | |
2197 | break;} | |
2198 | case 71: | |
2199 | -#line 267 "parsetime.y" | |
2200 | +#line 270 "parsetime.y" | |
2201 | { yyval.intval = 6; ; | |
2202 | break;} | |
2203 | case 72: | |
2204 | -#line 271 "parsetime.y" | |
2205 | +#line 274 "parsetime.y" | |
2206 | { | |
2207 | if (sscanf(yyvsp[0].charval, "%d", &yyval.intval) != 1) { | |
2208 | yyerror("Unknown increment"); | |
2209 | @@ -1034,7 +1058,7 @@ | |
2210 | break;} | |
2211 | } | |
2212 | /* the action file gets copied in in place of this dollarsign */ | |
2213 | -#line 465 "/usr/lib/bison.simple" | |
2214 | +#line 498 "/usr/share/misc/bison.simple" | |
2215 | \f | |
2216 | yyvsp -= yylen; | |
2217 | yyssp -= yylen; | |
2218 | @@ -1230,7 +1254,7 @@ | |
2219 | yystate = yyn; | |
2220 | goto yynewstate; | |
2221 | } | |
2222 | -#line 287 "parsetime.y" | |
2223 | +#line 290 "parsetime.y" | |
2224 | ||
2225 | ||
2226 |