mirror of
https://github.com/freebsd/freebsd-src.git
synced 2026-10-28 19:34:43 +01:00
Compare commits
1366
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
58fda9eaae | ||
|
|
1d853e0278 | ||
|
|
37dce6013c | ||
|
|
a5dade3161 | ||
|
|
cd797cd1d1 | ||
|
|
0f77736b12 | ||
|
|
7284e9c511 | ||
|
|
550e118e5c | ||
|
|
094a721e79 | ||
|
|
7ef75d7080 | ||
|
|
f51f831513 | ||
|
|
c2058aa3a2 | ||
|
|
5faba491d5 | ||
|
|
f70efa90e5 | ||
|
|
b974d08d1b | ||
|
|
06fe59e2b8 | ||
|
|
5d6d000083 | ||
|
|
40b4cff1e3 | ||
|
|
577f36d355 | ||
|
|
30d8d5d9ae | ||
|
|
1abb184f19 | ||
|
|
2f03886ea9 | ||
|
|
16d7ebe154 | ||
|
|
70f329d274 | ||
|
|
cd2db9a07a | ||
|
|
9fca4e6198 | ||
|
|
57e93dac9f | ||
|
|
774981f635 | ||
|
|
857dfe36ba | ||
|
|
fa8ab7bdb7 | ||
|
|
119dd04a49 | ||
|
|
c36a6e818e | ||
|
|
c21f229b1c | ||
|
|
d7974d70b4 | ||
|
|
0849640c84 | ||
|
|
e308440fbe | ||
|
|
a596d1b9a8 | ||
|
|
9bc36673a6 | ||
|
|
74c6489ee4 | ||
|
|
34e0dfbebd | ||
|
|
159277267f | ||
|
|
4013c192db | ||
|
|
6f5bf21d4c | ||
|
|
9c430dc9e0 | ||
|
|
7f5bb23c1d | ||
|
|
2c1dcebca0 | ||
|
|
ff1ccc214a | ||
|
|
f205c08ed7 | ||
|
|
3340ad9555 | ||
|
|
2d7e995f19 | ||
|
|
9ce8d0bb72 | ||
|
|
99942795f9 | ||
|
|
fb6a4dd2e8 | ||
|
|
166bd14069 | ||
|
|
dad6974375 | ||
|
|
552e825471 | ||
|
|
8a6d679711 | ||
|
|
9f5f72c1bb | ||
|
|
cd3ebfe5e5 | ||
|
|
0799333e0b | ||
|
|
cfd785510c | ||
|
|
174c306986 | ||
|
|
f60053da85 | ||
|
|
fbae4ec7fb | ||
|
|
b00a49e958 | ||
|
|
edb7bd3156 | ||
|
|
81938d5d76 | ||
|
|
b70dbf495c | ||
|
|
f29858feba | ||
|
|
483cf72739 | ||
|
|
ea546a1f1f | ||
|
|
782b714711 | ||
|
|
b2a910033b | ||
|
|
0cd752ea8a | ||
|
|
28484af338 | ||
|
|
833e5d2257 | ||
|
|
9933533dc2 | ||
|
|
48e57556de | ||
|
|
6dedb13947 | ||
|
|
238f9b7dd0 | ||
|
|
140f888527 | ||
|
|
8bd164d620 | ||
|
|
3b32f6d842 | ||
|
|
d2921d9fea | ||
|
|
e86a2fbc7e | ||
|
|
806e9cd433 | ||
|
|
9a0963757a | ||
|
|
883b3f8663 | ||
|
|
f9e7dd5c6b | ||
|
|
263a4b4fcb | ||
|
|
bea00f1312 | ||
|
|
c5d86155da | ||
|
|
cb9561125c | ||
|
|
eebaa02362 | ||
|
|
22108b216f | ||
|
|
a414eb273e | ||
|
|
9e820d889f | ||
|
|
148c7080c0 | ||
|
|
3044a91778 | ||
|
|
6582bc4dfa | ||
|
|
561b4afb4a | ||
|
|
bff5f5e9ff | ||
|
|
01354234e6 | ||
|
|
efe458a7c4 | ||
|
|
32d1c96f75 | ||
|
|
feea34744e | ||
|
|
30a6af8e2b | ||
|
|
282efc9d57 | ||
|
|
28f6bdbca3 | ||
|
|
3802441141 | ||
|
|
99ab5f9f12 | ||
|
|
392089096e | ||
|
|
68b4856657 | ||
|
|
d3c89bfbce | ||
|
|
de9827e51a | ||
|
|
0e107273cb | ||
|
|
5130136da2 | ||
|
|
176b584210 | ||
|
|
d0040adc10 | ||
|
|
d758acbc3f | ||
|
|
7c72ea24db | ||
|
|
ff2c8bafac | ||
|
|
6209f9d777 | ||
|
|
7e3c485bcc | ||
|
|
c3a35572c8 | ||
|
|
da76281b14 | ||
|
|
ac3805bdee | ||
|
|
ba717f79bf | ||
|
|
8a5fe16cbb | ||
|
|
0bd758d7d5 | ||
|
|
1659592ee6 | ||
|
|
f99bb843f1 | ||
|
|
0c372da7c9 | ||
|
|
ba3b16ea02 | ||
|
|
503fca79e1 | ||
|
|
cc8cea4826 | ||
|
|
3814e6b78b | ||
|
|
7d94c76ec5 | ||
|
|
e00d9114b6 | ||
|
|
678616e527 | ||
|
|
d38c3cbc12 | ||
|
|
ca2103a614 | ||
|
|
e7ca423fe0 | ||
|
|
bd701cf40f | ||
|
|
69ed1a71e3 | ||
|
|
98b5c8dea1 | ||
|
|
edd0aeb8f3 | ||
|
|
931e379f46 | ||
|
|
419ca6d279 | ||
|
|
2c753e2cc1 | ||
|
|
d77c7d1472 | ||
|
|
b774015379 | ||
|
|
2d5c51edc3 | ||
|
|
65746ad47e | ||
|
|
1eb260ee1e | ||
|
|
0a24fcb8f9 | ||
|
|
ca062ca80d | ||
|
|
faee93bd7d | ||
|
|
9f1ca3844b | ||
|
|
2645473437 | ||
|
|
f29b7aea15 | ||
|
|
ecb10c04b7 | ||
|
|
9d1e1b0ad3 | ||
|
|
8c27535398 | ||
|
|
fbab7e4d80 | ||
|
|
4cf98c18cb | ||
|
|
867c3565c2 | ||
|
|
39689f1c5d | ||
|
|
2b22286fcb | ||
|
|
2d4d61b81a | ||
|
|
2f2586aacd | ||
|
|
6fb473b90e | ||
|
|
9c9f7ea1e4 | ||
|
|
e5788a473a | ||
|
|
92d56714ef | ||
|
|
2592eaca75 | ||
|
|
ac63a0c967 | ||
|
|
c7dbfe0332 | ||
|
|
1ea4417ced | ||
|
|
1b9bccd0cc | ||
|
|
75c1be25a2 | ||
|
|
3bbbe6b7ef | ||
|
|
6650be41b1 | ||
|
|
2e95bd0c67 | ||
|
|
86a65428fe | ||
|
|
d9571ed8a5 | ||
|
|
11ec640422 | ||
|
|
abc2381afa | ||
|
|
24b830ed24 | ||
|
|
430ac1d361 | ||
|
|
4132422021 | ||
|
|
5362f6b42b | ||
|
|
c0fdc5b847 | ||
|
|
8e609311ba | ||
|
|
4254a8549e | ||
|
|
3559ae1620 | ||
|
|
985016df61 | ||
|
|
952d84b29e | ||
|
|
75041d7f7f | ||
|
|
d46b8718f9 | ||
|
|
6f76ce454f | ||
|
|
4ecc64c0ad | ||
|
|
4fa6e4dd5f | ||
|
|
02e37ff0f8 | ||
|
|
e5775fee46 | ||
|
|
36b54522b4 | ||
|
|
49de41d385 | ||
|
|
1ad113bf2c | ||
|
|
01a8b32b6a | ||
|
|
5df3954c1f | ||
|
|
e66b342c7c | ||
|
|
3381275516 | ||
|
|
7e75b0b630 | ||
|
|
15ae3e4d1e | ||
|
|
e3489fceb3 | ||
|
|
57d01597d0 | ||
|
|
fb67aa3749 | ||
|
|
a0bda0f5bb | ||
|
|
d6c584f9bb | ||
|
|
3eb7dab076 | ||
|
|
1bbb6817e1 | ||
|
|
d9f154fdd9 | ||
|
|
6c0f31a2fa | ||
|
|
54fd83ca16 | ||
|
|
b312d96d21 | ||
|
|
7f8cc5bddd | ||
|
|
db14669dfb | ||
|
|
7ae0a3a64b | ||
|
|
dffc6f5a6c | ||
|
|
a888b1470b | ||
|
|
d5ef92bb50 | ||
|
|
e1d8bd1cb6 | ||
|
|
e32c95398d | ||
|
|
eb348e2c64 | ||
|
|
105a2f694b | ||
|
|
0916e63b1c | ||
|
|
5d82586d67 | ||
|
|
4d59829c7e | ||
|
|
e297c6daac | ||
|
|
f8537798d9 | ||
|
|
3c435e3d23 | ||
|
|
f95be760ca | ||
|
|
51a97c79a2 | ||
|
|
7f09705be8 | ||
|
|
42ec5893d2 | ||
|
|
cc33cd784d | ||
|
|
74db67661f | ||
|
|
ed1b8a496e | ||
|
|
798ec714a5 | ||
|
|
b13d573bb4 | ||
|
|
2a4fe462a8 | ||
|
|
c08f6e3494 | ||
|
|
15373f4c17 | ||
|
|
39c6e69a5b | ||
|
|
fe0fa91dc2 | ||
|
|
2bdcd69789 | ||
|
|
2fb41f7910 | ||
|
|
457d150b2c | ||
|
|
de6c2f62c6 | ||
|
|
d2d3c68499 | ||
|
|
828a769ad5 | ||
|
|
671ee62092 | ||
|
|
810f9a85d1 | ||
|
|
1ca485ba96 | ||
|
|
e9c5d959f0 | ||
|
|
7783e42d53 | ||
|
|
15be79db1f | ||
|
|
95ef5ab1f5 | ||
|
|
c95e2a4d95 | ||
|
|
9633eb3045 | ||
|
|
9bf7b30ef4 | ||
|
|
d16bb0abff | ||
|
|
193c8cfeb6 | ||
|
|
bca46faf18 | ||
|
|
3dfc68bf7c | ||
|
|
8406b927e4 | ||
|
|
c492cac214 | ||
|
|
3fdde84590 | ||
|
|
bbec084968 | ||
|
|
823616a7a1 | ||
|
|
564481b143 | ||
|
|
a564fe048b | ||
|
|
a90add14bb | ||
|
|
e0815bb3dd | ||
|
|
5d60b0d803 | ||
|
|
c0793ebe10 | ||
|
|
6ba639da10 | ||
|
|
ce58188b0b | ||
|
|
af17b95444 | ||
|
|
5edc3e6661 | ||
|
|
4bdd80f6dd | ||
|
|
03f05a0035 | ||
|
|
77db442628 | ||
|
|
aba46bf6b0 | ||
|
|
cfcd2a898e | ||
|
|
7cd714d4b2 | ||
|
|
86485a0c81 | ||
|
|
2639d9b4b5 | ||
|
|
969434ddc7 | ||
|
|
d7ca24962c | ||
|
|
a360f78b6d | ||
|
|
df760bb31a | ||
|
|
aa9b171377 | ||
|
|
250a316728 | ||
|
|
451580f68a | ||
|
|
4973bd8d87 | ||
|
|
e135c7dac2 | ||
|
|
35dc68d1b9 | ||
|
|
c6b3c9f414 | ||
|
|
0e20ee28ae | ||
|
|
ab47f846ed | ||
|
|
9716063943 | ||
|
|
45b85c325b | ||
|
|
1d3cdd87fb | ||
|
|
0b41984099 | ||
|
|
3f1433e54c | ||
|
|
5291bb6d33 | ||
|
|
02430d3bb7 | ||
|
|
392783eb09 | ||
|
|
72bd75223e | ||
|
|
b4d78d8182 | ||
|
|
4370d18303 | ||
|
|
1ae21ad605 | ||
|
|
d253a26a86 | ||
|
|
f18d406879 | ||
|
|
695cbc763d | ||
|
|
b2fad66833 | ||
|
|
6cb0350862 | ||
|
|
593ce86a8f | ||
|
|
a475101277 | ||
|
|
5a5c688432 | ||
|
|
f37c3d0edb | ||
|
|
ea0aba3406 | ||
|
|
e320ec3a92 | ||
|
|
cb1953555f | ||
|
|
c6b278cf6d | ||
|
|
a2a7d7d2f0 | ||
|
|
4475681252 | ||
|
|
06f5b9fcca | ||
|
|
03a7c56259 | ||
|
|
781e3f24dd | ||
|
|
bd25a249aa | ||
|
|
e0c356382f | ||
|
|
4a1311072d | ||
|
|
74fcfc52e5 | ||
|
|
1c5ec6fc36 | ||
|
|
61d2b0edb2 | ||
|
|
cdc2a0c6d1 | ||
|
|
91c68d8f0a | ||
|
|
776f998eec | ||
|
|
9edfd19475 | ||
|
|
5b4377ec86 | ||
|
|
2720bd6991 | ||
|
|
f9d7405c20 | ||
|
|
6d07a06635 | ||
|
|
f0d0d7c8b6 | ||
|
|
f60953b5e3 | ||
|
|
778ebffe52 | ||
|
|
bd81653b2e | ||
|
|
7f4fe40b49 | ||
|
|
3b798d9bc8 | ||
|
|
f3c1c42ab1 | ||
|
|
1375a07aa6 | ||
|
|
47795419ca | ||
|
|
c66b78f9d7 | ||
|
|
a42a809f7b | ||
|
|
a44b33653e | ||
|
|
ce3371c6f8 | ||
|
|
5a3b741542 | ||
|
|
e3228e50a5 | ||
|
|
738cdc5cab | ||
|
|
6ee3d5e1d6 | ||
|
|
7fd379f055 | ||
|
|
4314b011ae | ||
|
|
b80e4f442a | ||
|
|
225beade92 | ||
|
|
8f67fba8f2 | ||
|
|
d9d495a566 | ||
|
|
ba28e471af | ||
|
|
a607ecb7a6 | ||
|
|
5dc7c2a17c | ||
|
|
ae0ad6d383 | ||
|
|
1fd044f59e | ||
|
|
d7503f8337 | ||
|
|
b95a1533be | ||
|
|
db8b02b7ab | ||
|
|
fbc52f5109 | ||
|
|
718b5ca0ee | ||
|
|
3ce40bc9e9 | ||
|
|
6b46eb2063 | ||
|
|
19fddd40a0 | ||
|
|
21af0f6bd3 | ||
|
|
1d21e829d7 | ||
|
|
7463799021 | ||
|
|
1d30d9a889 | ||
|
|
28096945c4 | ||
|
|
98375250dd | ||
|
|
59718857c7 | ||
|
|
7cbcabad63 | ||
|
|
2619071025 | ||
|
|
68829d454b | ||
|
|
6a8d044d0e | ||
|
|
327b9826ff | ||
|
|
348a9c8117 | ||
|
|
7b1a6c4756 | ||
|
|
92f8c8ef19 | ||
|
|
cd18c7bc51 | ||
|
|
71cab00d41 | ||
|
|
546f59f7b6 | ||
|
|
5878aff7fd | ||
|
|
e159d6868d | ||
|
|
efad87929d | ||
|
|
d1de837000 | ||
|
|
8b6a2ea3bd | ||
|
|
819f7db65a | ||
|
|
d7d8654b2c | ||
|
|
15e9e67906 | ||
|
|
40f2dabf78 | ||
|
|
6b39712eff | ||
|
|
4324a26b46 | ||
|
|
e484f4f382 | ||
|
|
289a730b2f | ||
|
|
de96dc35ad | ||
|
|
b71a4eaed2 | ||
|
|
717cddd0af | ||
|
|
4f818d470e | ||
|
|
e5ce396858 | ||
|
|
49e1e4909e | ||
|
|
f6bb3b675d | ||
|
|
db53871ecf | ||
|
|
ad09c0a554 | ||
|
|
f73ee0ff91 | ||
|
|
260701507a | ||
|
|
8b442691e8 | ||
|
|
c2a80f02c0 | ||
|
|
65cf18a7dd | ||
|
|
b4fcb901bd | ||
|
|
4985d29fbb | ||
|
|
b5f363083e | ||
|
|
fe31407b64 | ||
|
|
0985bbdfe6 | ||
|
|
c118356479 | ||
|
|
bb4d8b3afd | ||
|
|
7cdc23ad5b | ||
|
|
55aaaf05ef | ||
|
|
ee1c267a9c | ||
|
|
2ec944faf1 | ||
|
|
45b1a2125b | ||
|
|
891d76f905 | ||
|
|
a4e0455592 | ||
|
|
da3141419e | ||
|
|
123d1744bb | ||
|
|
bfdfbb2b15 | ||
|
|
2e83bb21c9 | ||
|
|
6db7e392f2 | ||
|
|
7238cbb481 | ||
|
|
6ca1b66ffd | ||
|
|
6a06013b97 | ||
|
|
8742cbb352 | ||
|
|
7ed1f523f7 | ||
|
|
0d76b58cd6 | ||
|
|
e3d5102fe1 | ||
|
|
65bc8706c8 | ||
|
|
a8c93ca12a | ||
|
|
d6e51e019d | ||
|
|
2223caa99f | ||
|
|
b1304bfd19 | ||
|
|
699cda0c71 | ||
|
|
81cd0aae88 | ||
|
|
b8fde9d290 | ||
|
|
200d0483b9 | ||
|
|
2124bd8eab | ||
|
|
c3385c8686 | ||
|
|
feb8a01f20 | ||
|
|
a504276fb2 | ||
|
|
32fbed19a1 | ||
|
|
14c55d75fd | ||
|
|
a77bd38468 | ||
|
|
2bf3c0b3f6 | ||
|
|
172bce96e3 | ||
|
|
dd84a1d30f | ||
|
|
872711df52 | ||
|
|
9f893d6c97 | ||
|
|
4157f6edcb | ||
|
|
cfd8444392 | ||
|
|
b6b01994bd | ||
|
|
ee41216cbe | ||
|
|
35f642bd55 | ||
|
|
b6abecae06 | ||
|
|
228f50a90c | ||
|
|
4a796f06ac | ||
|
|
0bcbf149b4 | ||
|
|
13aea08e0c | ||
|
|
7eb72cf359 | ||
|
|
4e05a3de30 | ||
|
|
8af9c62eb0 | ||
|
|
fa75e25aec | ||
|
|
dcceb2660b | ||
|
|
d5e8280444 | ||
|
|
bfdb5d891a | ||
|
|
c884e41723 | ||
|
|
772a77e1ac | ||
|
|
eafa9c7566 | ||
|
|
ad5b9fec49 | ||
|
|
4eeffb65ce | ||
|
|
3ef095ffe3 | ||
|
|
246ab928c6 | ||
|
|
611dae3a12 | ||
|
|
6f9ab47031 | ||
|
|
df35aaa33b | ||
|
|
5ab2dfb5d8 | ||
|
|
5b0ee2ab36 | ||
|
|
0a62806f6b | ||
|
|
af499912db | ||
|
|
1f3240a32a | ||
|
|
f7cbad04bf | ||
|
|
36e8f74b1e | ||
|
|
da86ea4472 | ||
|
|
db91ad74bc | ||
|
|
4da65bc9b3 | ||
|
|
71ceda0656 | ||
|
|
d0e5f1f593 | ||
|
|
51ad2ea740 | ||
|
|
b18ad4ba0b | ||
|
|
5d340b06c4 | ||
|
|
107b33801f | ||
|
|
018a24737e | ||
|
|
5ddc60ea2b | ||
|
|
319b34a9c9 | ||
|
|
952db856b5 | ||
|
|
0e830819ad | ||
|
|
d4899e9c97 | ||
|
|
3be996d524 | ||
|
|
b97623a625 | ||
|
|
7d6c967676 | ||
|
|
397f751272 | ||
|
|
ec920f94ab | ||
|
|
ff3d6122c4 | ||
|
|
1389908db6 | ||
|
|
604d831520 | ||
|
|
e9fd5fef68 | ||
|
|
a868f939e0 | ||
|
|
4b76112f26 | ||
|
|
d1b0d0c6d9 | ||
|
|
ff546a50ab | ||
|
|
47027d79cd | ||
|
|
bfe485986c | ||
|
|
c14c8fe4e6 | ||
|
|
4dae6a150e | ||
|
|
5c8fe205a5 | ||
|
|
409bb431bc | ||
|
|
259847d5db | ||
|
|
dfbc6f3388 | ||
|
|
00f5d38350 | ||
|
|
cebb1dcecd | ||
|
|
490167d689 | ||
|
|
fbb40e75d2 | ||
|
|
09ac249ef7 | ||
|
|
1ee2531df8 | ||
|
|
33bddb1e66 | ||
|
|
bd2d092451 | ||
|
|
a0ae9f3400 | ||
|
|
63ef6da358 | ||
|
|
c1efe1a7aa | ||
|
|
56716806d4 | ||
|
|
9f96cfef2f | ||
|
|
fd59174ccb | ||
|
|
cc306f9408 | ||
|
|
7a764a6800 | ||
|
|
dbc226137e | ||
|
|
b6801abea7 | ||
|
|
f738826414 | ||
|
|
03dbac95c3 | ||
|
|
0eb7eaa632 | ||
|
|
b705d08004 | ||
|
|
f97c5958a2 | ||
|
|
12b72c70a0 | ||
|
|
e5f2ef17e5 | ||
|
|
0ff8f3d2c4 | ||
|
|
11f89ed0e0 | ||
|
|
300e24ec35 | ||
|
|
93935ca99f | ||
|
|
a973d65e4f | ||
|
|
2de6494775 | ||
|
|
400a3633eb | ||
|
|
344714e322 | ||
|
|
36a22dbe51 | ||
|
|
0d57deb0bc | ||
|
|
c40e1c00ba | ||
|
|
4e6814830f | ||
|
|
22430cc58a | ||
|
|
20f62f09ec | ||
|
|
d978b087d9 | ||
|
|
cd566dac74 | ||
|
|
0973a32841 | ||
|
|
e8bd4f1361 | ||
|
|
f5785ca0ab | ||
|
|
6fdaca7c44 | ||
|
|
d0d8ccdd08 | ||
|
|
352f2bb8c8 | ||
|
|
13b3843ba5 | ||
|
|
8494e988e1 | ||
|
|
244be89431 | ||
|
|
a1277f0b9d | ||
|
|
41ad1c84ba | ||
|
|
bc761f5a62 | ||
|
|
091606bec5 | ||
|
|
24823bbd6a | ||
|
|
2d6ca4979d | ||
|
|
21b8126232 | ||
|
|
293edbf45b | ||
|
|
acfd73794a | ||
|
|
a951c04a08 | ||
|
|
0ecc45f30e | ||
|
|
c4edc884ff | ||
|
|
d461a255ef | ||
|
|
827772f392 | ||
|
|
a1f15600aa | ||
|
|
235010a817 | ||
|
|
01f4653e65 | ||
|
|
f7d63871f4 | ||
|
|
8d94d81122 | ||
|
|
4c12d38788 | ||
|
|
2c3a92aa44 | ||
|
|
a9a7df608a | ||
|
|
2076ecc165 | ||
|
|
3c65ef4cf9 | ||
|
|
851493d66b | ||
|
|
c53360c149 | ||
|
|
a2431f20ef | ||
|
|
a130ff662d | ||
|
|
281be13915 | ||
|
|
47145019aa | ||
|
|
bf3c8f5e1b | ||
|
|
b18453a70b | ||
|
|
4b83f1272b | ||
|
|
d099d73420 | ||
|
|
7fcfedaeed | ||
|
|
5101d8e5ff | ||
|
|
6f8a5af786 | ||
|
|
e83411e836 | ||
|
|
d72611b036 | ||
|
|
f83c32c1ca | ||
|
|
ca485b2bbe | ||
|
|
787e4a854f | ||
|
|
341f45add4 | ||
|
|
86f878b9a2 | ||
|
|
607e29377c | ||
|
|
ee7914bcba | ||
|
|
cdb4e2bcdd | ||
|
|
ff605c853b | ||
|
|
b9bb994e5b | ||
|
|
37507da696 | ||
|
|
cf2c71ccd4 | ||
|
|
b361783b23 | ||
|
|
a01dd05958 | ||
|
|
7c14b26854 | ||
|
|
08fd7397a0 | ||
|
|
7f381b2fd3 | ||
|
|
c352974b02 | ||
|
|
cce8945e38 | ||
|
|
47f4c561ee | ||
|
|
efaa2f692c | ||
|
|
92be9b42e0 | ||
|
|
c2083b304c | ||
|
|
731a1bfd00 | ||
|
|
0442cb0f42 | ||
|
|
1b4489f342 | ||
|
|
a3d0962245 | ||
|
|
93d696bca0 | ||
|
|
bee9e75030 | ||
|
|
a51b295909 | ||
|
|
8cd4bc44a0 | ||
|
|
b47cf6dc98 | ||
|
|
4fdc6a094b | ||
|
|
4a0808cd28 | ||
|
|
c2df88a75b | ||
|
|
572e6beeb8 | ||
|
|
35d887f954 | ||
|
|
2664ff3a46 | ||
|
|
46a4b415e3 | ||
|
|
64819486c8 | ||
|
|
e46151db81 | ||
|
|
bfcde9886a | ||
|
|
cc664844db | ||
|
|
f644bd77c0 | ||
|
|
c6e418e951 | ||
|
|
3f6b2fbf6e | ||
|
|
0f869314ab | ||
|
|
006716326b | ||
|
|
8e56dca7a2 | ||
|
|
1c6c0683a7 | ||
|
|
4f5dc35253 | ||
|
|
55de927aac | ||
|
|
99e6642e40 | ||
|
|
199463994b | ||
|
|
de467b4f75 | ||
|
|
1df0d1d1fb | ||
|
|
dff536952c | ||
|
|
a1be26da45 | ||
|
|
41922368e8 | ||
|
|
a696d2f1d7 | ||
|
|
f5af1a5782 | ||
|
|
19ec4961c7 | ||
|
|
d04d9b359e | ||
|
|
7fed7336ac | ||
|
|
94c02651c0 | ||
|
|
e3e5e6ff69 | ||
|
|
91394b07d4 | ||
|
|
3b778235e0 | ||
|
|
2a43f3492c | ||
|
|
74553924d2 | ||
|
|
dcd1f4359b | ||
|
|
b1eb380805 | ||
|
|
1b9532a4ac | ||
|
|
dee1d1c08b | ||
|
|
b72710abc8 | ||
|
|
835f34e8c1 | ||
|
|
86e2d733c7 | ||
|
|
38284b1179 | ||
|
|
986dfbf46d | ||
|
|
7dc004c39f | ||
|
|
e6dac1726a | ||
|
|
8500b8bc5d | ||
|
|
37ccf4a537 | ||
|
|
e4075b0678 | ||
|
|
8bb8061ffa | ||
|
|
93217c53c3 | ||
|
|
41b5c720a7 | ||
|
|
c1c4cd6142 | ||
|
|
7b6c9f6e28 | ||
|
|
75c36b3df4 | ||
|
|
a4222cae8a | ||
|
|
b88a14b0b4 | ||
|
|
b0f22ca7f6 | ||
|
|
250df70c33 | ||
|
|
e71844d478 | ||
|
|
6374bf48db | ||
|
|
26b6d2da4b | ||
|
|
d273685eba | ||
|
|
718eb9f32c | ||
|
|
d2a7a79701 | ||
|
|
2a0f830619 | ||
|
|
5132f8be42 | ||
|
|
2bfbbd168e | ||
|
|
00dea007f9 | ||
|
|
29d9570c3c | ||
|
|
1dc0d228c7 | ||
|
|
5943544452 | ||
|
|
25502ef4a6 | ||
|
|
0f65f2bec3 | ||
|
|
2531aa1d7a | ||
|
|
4d1c8b7117 | ||
|
|
3908bcdade | ||
|
|
ba3955753a | ||
|
|
6471e57bbc | ||
|
|
1981f1a016 | ||
|
|
79ce3583c4 | ||
|
|
cde091948a | ||
|
|
8acfd8b9eb | ||
|
|
1ec0dd90b0 | ||
|
|
0f97ffd2bb | ||
|
|
aadfc9703f | ||
|
|
3ab8ee7cc4 | ||
|
|
1114e11649 | ||
|
|
9c3591f9f8 | ||
|
|
abf7e48576 | ||
|
|
28f51a944b | ||
|
|
e0f76cccd7 | ||
|
|
e0f6c99051 | ||
|
|
9bfc124881 | ||
|
|
456bc0e053 | ||
|
|
159b78f998 | ||
|
|
cb959c1653 | ||
|
|
df26558a10 | ||
|
|
e8d12112e3 | ||
|
|
ec7c88e98e | ||
|
|
b17a06575d | ||
|
|
39a230145a | ||
|
|
845616cbd7 | ||
|
|
c53ea396aa | ||
|
|
15583d1583 | ||
|
|
077ce9e075 | ||
|
|
3bf6cb3795 | ||
|
|
71f74e3e1d | ||
|
|
f34e97b27d | ||
|
|
cc042886b9 | ||
|
|
5090f23460 | ||
|
|
ccf6b3f17d | ||
|
|
8e0677d6f4 | ||
|
|
f90509e3de | ||
|
|
635e2ca932 | ||
|
|
f8c7bf320a | ||
|
|
30eb504e34 | ||
|
|
2752e5e8db | ||
|
|
0c0edec059 | ||
|
|
6dafc05107 | ||
|
|
b1825ac7ce | ||
|
|
2c7ce2c0b1 | ||
|
|
df58912a11 | ||
|
|
9aa90d8e89 | ||
|
|
24cb5a5d33 | ||
|
|
85e19c1880 | ||
|
|
40ae4344e1 | ||
|
|
7c6750ba69 | ||
|
|
504d1f85cd | ||
|
|
19115570d2 | ||
|
|
539f336c27 | ||
|
|
69df4b3b54 | ||
|
|
3ea35a825a | ||
|
|
8864ff8143 | ||
|
|
8251328bea | ||
|
|
bf52c269bf | ||
|
|
6d4b53ea2f | ||
|
|
641b924ce2 | ||
|
|
341dc955c8 | ||
|
|
50e3135104 | ||
|
|
9875566efd | ||
|
|
4fd4c0c25f | ||
|
|
0dc54e6ef3 | ||
|
|
3e23a6b14f | ||
|
|
aa36fbf059 | ||
|
|
2bbaac6a58 | ||
|
|
7936a54e1a | ||
|
|
e947fb8dcf | ||
|
|
75f025e4ba | ||
|
|
c55a0fda97 | ||
|
|
6ebb7aac7c | ||
|
|
8aa83df477 | ||
|
|
27b9da5771 | ||
|
|
1390b0dc9e | ||
|
|
5e043c9b64 | ||
|
|
1d6b7f4f37 | ||
|
|
0021dea42b | ||
|
|
43938609f2 | ||
|
|
806c6b6bd1 | ||
|
|
2a717c8ef0 | ||
|
|
2ff74cba13 | ||
|
|
be12f2a8c4 | ||
|
|
bcc00ea4fe | ||
|
|
2b737adce2 | ||
|
|
6912e16eec | ||
|
|
829b963ad1 | ||
|
|
cb47727963 | ||
|
|
c6e4f2e0e4 | ||
|
|
c5f0e53278 | ||
|
|
64b96a0ab9 | ||
|
|
d9e0176647 | ||
|
|
22e190c74b | ||
|
|
eacfc5b2b7 | ||
|
|
5110fb0b57 | ||
|
|
3d34903c42 | ||
|
|
030dd5b9d5 | ||
|
|
7234f711d6 | ||
|
|
56e0c1b6d3 | ||
|
|
6f2df13a35 | ||
|
|
64e5ecce66 | ||
|
|
19951d84e2 | ||
|
|
576c18b472 | ||
|
|
749e16e2f8 | ||
|
|
6a602e1006 | ||
|
|
eb5938b3e5 | ||
|
|
03076e6c2f | ||
|
|
3fbd714cc9 | ||
|
|
ba225dfd39 | ||
|
|
e1dc25e975 | ||
|
|
61856de05b | ||
|
|
05ae2208cc | ||
|
|
79a435d37d | ||
|
|
db3a1d549b | ||
|
|
179e28e36c | ||
|
|
33be082330 | ||
|
|
705433bb43 | ||
|
|
9e54c2eb4b | ||
|
|
9827af4c65 | ||
|
|
038d5b11bf | ||
|
|
446a109788 | ||
|
|
3ccf40314e | ||
|
|
9b96b353b1 | ||
|
|
6192382cc3 | ||
|
|
42273597ca | ||
|
|
89e2cbe2d8 | ||
|
|
20e8927a0b | ||
|
|
7dbb38e5c9 | ||
|
|
eedd2adf74 | ||
|
|
8080929a21 | ||
|
|
372d11fcb8 | ||
|
|
e12590d45e | ||
|
|
ed85c193fa | ||
|
|
f2a25b130a | ||
|
|
40809811ac | ||
|
|
f9df96ce14 | ||
|
|
5d3dfa55b7 | ||
|
|
ddcec0c935 | ||
|
|
77b2bce580 | ||
|
|
9368b61dff | ||
|
|
01ff46e957 | ||
|
|
7753a4ff8f | ||
|
|
949f43d363 | ||
|
|
ba0ffec63e | ||
|
|
2053f18c52 | ||
|
|
096eea9580 | ||
|
|
0a93446fc9 | ||
|
|
8096eaa23f | ||
|
|
871f8f2402 | ||
|
|
203420a408 | ||
|
|
42858bc5dc | ||
|
|
a64a6eb73a | ||
|
|
a9d5a8af83 | ||
|
|
95afc49c69 | ||
|
|
ef2717bd1a | ||
|
|
a509f2baa2 | ||
|
|
7097fa3fcc | ||
|
|
9656b239f5 | ||
|
|
94b60387fe | ||
|
|
1c09a1e032 | ||
|
|
98cd737c7c | ||
|
|
97531b18b2 | ||
|
|
e64e577639 | ||
|
|
c07b9adb1e | ||
|
|
ea2636a4f1 | ||
|
|
a81d83c4a9 | ||
|
|
fa9a4b898a | ||
|
|
1fb4031962 | ||
|
|
44212f2579 | ||
|
|
cc47380497 | ||
|
|
bede6b85a8 | ||
|
|
149182d3a4 | ||
|
|
d4e8b5a759 | ||
|
|
70024b9986 | ||
|
|
bc0ea8a56f | ||
|
|
b01d93dc4c | ||
|
|
c5307c8c00 | ||
|
|
6017c6eeb4 | ||
|
|
6c2a45560a | ||
|
|
9c8a5de263 | ||
|
|
4ae86e2573 | ||
|
|
4d1cb90883 | ||
|
|
5b8b376328 | ||
|
|
9138915773 | ||
|
|
10a03405b0 | ||
|
|
69427a0a0a | ||
|
|
fdf613101b | ||
|
|
d6de65481c | ||
|
|
b46cd9f735 | ||
|
|
6e63eaba65 | ||
|
|
34802ec8fa | ||
|
|
2d52962f5f | ||
|
|
690f943d84 | ||
|
|
51ec5e12b8 | ||
|
|
6b4f8e1f85 | ||
|
|
ef9b3f37b5 | ||
|
|
333a2b5971 | ||
|
|
94f53de816 | ||
|
|
7b2290ba2d | ||
|
|
7eb927e138 | ||
|
|
b3f5b52ed2 | ||
|
|
21be55d7c5 | ||
|
|
6ff86f3768 | ||
|
|
68b162decf | ||
|
|
102e46da02 | ||
|
|
ece716c52f | ||
|
|
b4c1ced1b8 | ||
|
|
86e0a635f5 | ||
|
|
d495322c09 | ||
|
|
d3f20f9d3e | ||
|
|
47b2989dd9 | ||
|
|
3a0000d1c2 | ||
|
|
74b28707d3 | ||
|
|
876b19c29e | ||
|
|
d0b928913b | ||
|
|
a66da6ca70 | ||
|
|
fde5f79c13 | ||
|
|
3f503d0462 | ||
|
|
bb00d52f67 | ||
|
|
a307b5d173 | ||
|
|
d2e58cb2be | ||
|
|
d800b746ae | ||
|
|
085a120b9a | ||
|
|
34ea9d678e | ||
|
|
b1b528c400 | ||
|
|
781ffb8d57 | ||
|
|
387c637dd5 | ||
|
|
4eda9d1152 | ||
|
|
658ff59e28 | ||
|
|
3b5e8ff942 | ||
|
|
02bfb1dd9a | ||
|
|
66b48f99a4 | ||
|
|
57def4f658 | ||
|
|
d4bcf12bf7 | ||
|
|
bfb3af199e | ||
|
|
c13013245d | ||
|
|
24a1d23843 | ||
|
|
02daa126c4 | ||
|
|
fc2866c839 | ||
|
|
234baacdab | ||
|
|
29f9063b61 | ||
|
|
2ade633172 | ||
|
|
d7d1d3874a | ||
|
|
fcb29a1474 | ||
|
|
3f3f445bd5 | ||
|
|
81f011cc3f | ||
|
|
373f79de3f | ||
|
|
7ffc7c093a | ||
|
|
0ac38d6117 | ||
|
|
59a945cbac | ||
|
|
13b0ce83ca | ||
|
|
8628f8d024 | ||
|
|
e8bd89d9f7 | ||
|
|
4a9fd85bf6 | ||
|
|
f3859c5bca | ||
|
|
04697e4baf | ||
|
|
8d15dfacb4 | ||
|
|
105935406a | ||
|
|
6aa293c419 | ||
|
|
75fe8f2ef8 | ||
|
|
b4800da0e1 | ||
|
|
f3f3c39b10 | ||
|
|
69abd966e6 | ||
|
|
bded1e134a | ||
|
|
f5d2e6eca6 | ||
|
|
fbfbead8da | ||
|
|
465e2892ab | ||
|
|
92be3a5a74 | ||
|
|
c7f9abca58 | ||
|
|
d31fbb15e0 | ||
|
|
e389af2874 | ||
|
|
348fbc7337 | ||
|
|
3afdd8d1d0 | ||
|
|
be70a2ea60 | ||
|
|
5f58e9ea0b | ||
|
|
5f4af4e6fb | ||
|
|
b34b7c803d | ||
|
|
3a4c9efab8 | ||
|
|
1f0ebe423f | ||
|
|
00b1febb5d | ||
|
|
8afb7bc24f | ||
|
|
496badda6d | ||
|
|
1b7ea40cda | ||
|
|
9c0c0e1679 | ||
|
|
c8c3aaa473 | ||
|
|
4b2e0a44a5 | ||
|
|
c89a609275 | ||
|
|
434fc4d31b | ||
|
|
9439c24cd1 | ||
|
|
1c3d6f234f | ||
|
|
99c916a936 | ||
|
|
46396cf220 | ||
|
|
9d894450ac | ||
|
|
973c478f70 | ||
|
|
3a1b21169d | ||
|
|
d8c1178077 | ||
|
|
4c397ee92b | ||
|
|
e1a0d6a03f | ||
|
|
9ede1684a6 | ||
|
|
ddb07f71e6 | ||
|
|
e330d442a8 | ||
|
|
97d97ffbf5 | ||
|
|
1308cef2f8 | ||
|
|
590b505a0e | ||
|
|
e28bca9e91 | ||
|
|
d8b38c218f | ||
|
|
c701169a62 | ||
|
|
80eca0a4ae | ||
|
|
4a3ad92e56 | ||
|
|
c128d0f0d8 | ||
|
|
dcf568e0cc | ||
|
|
7628121836 | ||
|
|
e4c78cb757 | ||
|
|
0bb2f6e0a6 | ||
|
|
3078e45e58 | ||
|
|
e03e2e9d48 | ||
|
|
adbc3b1151 | ||
|
|
0c308e0d5f | ||
|
|
acfebd302b | ||
|
|
cb493a4954 | ||
|
|
fca6553859 | ||
|
|
8407c41935 | ||
|
|
e1c2234c83 | ||
|
|
df8754fbcf | ||
|
|
048e703337 | ||
|
|
d8d8652248 | ||
|
|
6f5f2cb57d | ||
|
|
6dae1017f7 | ||
|
|
b7b3f1099e | ||
|
|
16d7782804 | ||
|
|
d0a0dab62b | ||
|
|
aca277dc65 | ||
|
|
bd3eb31c11 | ||
|
|
a967b76e76 | ||
|
|
96ddf27cca | ||
|
|
f3120dab30 | ||
|
|
c6d4553b2e | ||
|
|
55a7d0ebfe | ||
|
|
cec9523d96 | ||
|
|
b5210be97a | ||
|
|
4e1ba7492c | ||
|
|
5a6a0320d6 | ||
|
|
513baaf768 | ||
|
|
2557ffa5ad | ||
|
|
7de6b2074f | ||
|
|
139b650c2c | ||
|
|
bd1f61604c | ||
|
|
90ba11f6d5 | ||
|
|
ad25dba192 | ||
|
|
e1ab69c8cc | ||
|
|
804d7abecf | ||
|
|
30691f8b05 | ||
|
|
b726277245 | ||
|
|
2a5264e1d6 | ||
|
|
ee6a127ac5 | ||
|
|
d99e457ef6 | ||
|
|
a4e6fbb107 | ||
|
|
1f73d5d9e2 | ||
|
|
c2ab390008 | ||
|
|
48b3430472 | ||
|
|
3ca93691cd | ||
|
|
7963e369cb | ||
|
|
45fd906371 | ||
|
|
29417690fe | ||
|
|
580bb49dcf | ||
|
|
f802850cf5 | ||
|
|
311acf9934 | ||
|
|
5403781400 | ||
|
|
0e6bdf81e8 | ||
|
|
f76dd96876 | ||
|
|
6465fa58bd | ||
|
|
cec3b4f452 | ||
|
|
e8a7173de2 | ||
|
|
ba862318f8 | ||
|
|
7b3c2ce2ca | ||
|
|
672d78d57a | ||
|
|
2b7f9bf670 | ||
|
|
1ada62dd1a | ||
|
|
5035c9e703 | ||
|
|
8d10cf576f | ||
|
|
4bfba7976d | ||
|
|
b9c6c4c25f | ||
|
|
1dfc0b9c14 | ||
|
|
2b356edc62 | ||
|
|
aa838e3828 | ||
|
|
667d5c4277 | ||
|
|
bc58be694f | ||
|
|
140a431f1d | ||
|
|
ff22054259 | ||
|
|
3a65a3324f | ||
|
|
0689914d5b | ||
|
|
1f47b4c653 | ||
|
|
51fbdd8cc6 | ||
|
|
1412a24e10 | ||
|
|
f86245bda7 | ||
|
|
f986cc537b | ||
|
|
1130347c0d | ||
|
|
5c85749b4b | ||
|
|
4624bdaff1 | ||
|
|
096841941a | ||
|
|
8781d1d5a2 | ||
|
|
832bb0cd6e | ||
|
|
0096ba6e8e | ||
|
|
d1b33a0ce9 | ||
|
|
81a6bd7e7b | ||
|
|
987734934d | ||
|
|
29a53a6a3e | ||
|
|
a84203ca83 | ||
|
|
227997559f | ||
|
|
4834f0a82a | ||
|
|
815dbf8902 | ||
|
|
f9e7653b57 | ||
|
|
a4c1f42fd9 | ||
|
|
1e72a39aad | ||
|
|
a5d7031781 | ||
|
|
76fa314dd8 | ||
|
|
2609a67214 | ||
|
|
b71661dea6 | ||
|
|
cb36ab0892 | ||
|
|
5fc18bae0d | ||
|
|
711faa97c1 | ||
|
|
668af9eab3 | ||
|
|
05fe90fd56 | ||
|
|
f2dadae42c | ||
|
|
21e8b4e9b6 | ||
|
|
6b412e17f7 | ||
|
|
645259b64b | ||
|
|
2c65b0f445 | ||
|
|
303e965973 | ||
|
|
21ec5d57a1 | ||
|
|
8bf99afffa | ||
|
|
e2567457c4 | ||
|
|
53bb664490 | ||
|
|
e84b0e25a8 | ||
|
|
3d9498fefb | ||
|
|
c3f5ce2c89 | ||
|
|
92795a754e | ||
|
|
4111408ce8 | ||
|
|
c9a97e01f9 | ||
|
|
bd215737ce | ||
|
|
baa6809233 | ||
|
|
fca87d1f87 | ||
|
|
eada637063 | ||
|
|
753ea67a0d | ||
|
|
ba91714311 | ||
|
|
9d3c6ae56f | ||
|
|
c1bec91561 | ||
|
|
fdd8ac1c99 | ||
|
|
1a347167ba | ||
|
|
34afec3448 | ||
|
|
c10fde9ae8 | ||
|
|
7c9e33390b | ||
|
|
f03160b6be | ||
|
|
5c000bc56b | ||
|
|
0248af23c7 | ||
|
|
5587b10cba | ||
|
|
16f6001dcd | ||
|
|
0d70227a37 | ||
|
|
f04955eda7 | ||
|
|
4f92d8ca37 | ||
|
|
5ebf1bdc90 | ||
|
|
f7544289df | ||
|
|
d44632d227 | ||
|
|
bd5cb03d53 | ||
|
|
a40616facd | ||
|
|
5a0e741321 | ||
|
|
34e01a6a8c | ||
|
|
3f3c16a281 | ||
|
|
02e87fb04d | ||
|
|
f9f16bab83 | ||
|
|
c05223252e | ||
|
|
97e4a62f6c | ||
|
|
79281b8c46 | ||
|
|
d2665f6e47 | ||
|
|
7259dc4d1c | ||
|
|
44a0b9c913 | ||
|
|
b927236735 | ||
|
|
5efdce9dae | ||
|
|
563e7ab749 | ||
|
|
316393ca3a | ||
|
|
774dae5241 | ||
|
|
baf8971320 | ||
|
|
2c1d5d5334 | ||
|
|
91b2b3245b | ||
|
|
1e5ab4abda | ||
|
|
3827a84454 | ||
|
|
dd519d5db7 | ||
|
|
4014897ab8 | ||
|
|
07bde7804e | ||
|
|
518eb64df0 | ||
|
|
8d1b112c08 | ||
|
|
dd6e44fc25 | ||
|
|
01f27c1983 | ||
|
|
4fabc0dda0 | ||
|
|
1a7bd87aea | ||
|
|
ab166bf533 | ||
|
|
7576049b44 | ||
|
|
96649a11ba | ||
|
|
22e8c93e84 | ||
|
|
de6956e773 | ||
|
|
6f06384e3b | ||
|
|
9cb180ee2b | ||
|
|
c04d342795 | ||
|
|
0d6dc7d62f | ||
|
|
b45093ebf1 | ||
|
|
8f5ebac6b6 | ||
|
|
d3f0a04c01 | ||
|
|
a7cfa8509d | ||
|
|
0c5455ea41 | ||
|
|
542cc0cc3a | ||
|
|
6975473a84 | ||
|
|
7028cf659a | ||
|
|
a377ec823d | ||
|
|
9535cfa20b | ||
|
|
3cc39485dc | ||
|
|
be7ed497b5 | ||
|
|
1ba8c062ea | ||
|
|
f94f5633e2 | ||
|
|
241f5848a6 | ||
|
|
790391cd43 | ||
|
|
3630e2ac9d | ||
|
|
bbe047c6c8 | ||
|
|
6dfa0f0826 | ||
|
|
67004a5a11 | ||
|
|
cfdbac8e6f | ||
|
|
1d88f7b6a4 | ||
|
|
e63077627d | ||
|
|
66efb5dc47 | ||
|
|
8c99299542 | ||
|
|
32dff0fc6d | ||
|
|
74e25a17db | ||
|
|
a7379d76a6 | ||
|
|
5a19f7969c | ||
|
|
921c0f0d9e | ||
|
|
fe5e8620cc | ||
|
|
965421b54d | ||
|
|
0f50fb4bd6 | ||
|
|
a546571623 | ||
|
|
80fe0eb6c3 | ||
|
|
9e1207e68d | ||
|
|
cc8134f09c | ||
|
|
fad75284cb | ||
|
|
2e722a4135 | ||
|
|
826e078aaf | ||
|
|
af43be1171 | ||
|
|
0246864aa4 | ||
|
|
1de895fa49 | ||
|
|
ca1af3ff24 | ||
|
|
07ae59ab4b | ||
|
|
0093c1988a | ||
|
|
0a58c7c043 | ||
|
|
d7170388da | ||
|
|
f7cd9a9848 | ||
|
|
2803a9eac5 | ||
|
|
adba700527 | ||
|
|
611b2d774f | ||
|
|
f8195b2b9a | ||
|
|
f1c135a3ca | ||
|
|
0498ced479 | ||
|
|
1cb5db813f | ||
|
|
edf370bf6d | ||
|
|
efcca0aff1 | ||
|
|
b4b03ff370 | ||
|
|
1a85394192 | ||
|
|
f9424f4ad4 | ||
|
|
825cb47018 | ||
|
|
c34bd31f6f | ||
|
|
a89f0c33cc | ||
|
|
b680f5d735 | ||
|
|
701af9441f | ||
|
|
d5c8c609ec | ||
|
|
71a7c1fda3 | ||
|
|
987f9b4452 | ||
|
|
ca77c19193 | ||
|
|
a1af27d25d | ||
|
|
1a7998233f | ||
|
|
1d62b489cc | ||
|
|
9fb8b86a16 | ||
|
|
f644a7c83f | ||
|
|
dd5bb3d1a8 | ||
|
|
49fa85ded8 | ||
|
|
f5ee59a1d5 | ||
|
|
5768cfc933 | ||
|
|
7c4208e9ef | ||
|
|
abe33d0f51 | ||
|
|
2b03fcd7bb | ||
|
|
44fe3d3ca9 | ||
|
|
0d38a3f3db | ||
|
|
846e8c5723 | ||
|
|
36064a6b24 | ||
|
|
93e23a2faf | ||
|
|
eb5b2da2f9 | ||
|
|
f1d8ddb4e7 | ||
|
|
080ea059c6 | ||
|
|
57e49685d4 | ||
|
|
33ea35f28c | ||
|
|
0072a2d595 | ||
|
|
24ced61308 | ||
|
|
452f949ede | ||
|
|
656209045f | ||
|
|
b497ecc823 | ||
|
|
514cfadcaa | ||
|
|
07f3fa6afa | ||
|
|
b1421c5fb2 | ||
|
|
d5c983603e | ||
|
|
2f42479640 | ||
|
|
dc8a0f913a | ||
|
|
7c8bf61583 | ||
|
|
bd5d5a5a7b | ||
|
|
8a4502c8d5 |
No files matched your search
@@ -1,10 +1,8 @@
|
||||
#
|
||||
# $Id: Makefile,v 1.109.2.3 1997/04/11 16:57:40 asami Exp $
|
||||
# $Id: Makefile,v 1.109.2.18 1997/09/17 23:50:26 rgrimes Exp $
|
||||
#
|
||||
# Make command line options:
|
||||
# -DCLOBBER will remove /usr/include
|
||||
# -DMAKE_LOCAL to add ./local to the SUBDIR list
|
||||
# -DMAKE_PORTS to add ./ports to the SUBDIR list
|
||||
# -DMAKE_EBONES to build eBones (KerberosIV)
|
||||
# -DALLLANG to build documentation for all languages
|
||||
# (where available -- see share/doc/Makefile)
|
||||
@@ -19,11 +17,13 @@
|
||||
# -DNOGAMES do not go into games subdir
|
||||
# -DNOSHARE do not go into share subdir
|
||||
# -DNOINFO do not make or install info files
|
||||
# LOCAL_DIRS="list of dirs" to add additional dirs to the SUBDIR list
|
||||
|
||||
#
|
||||
# The intended user-driven targets are:
|
||||
# world - rebuild *everything*, including glue to help do upgrades.
|
||||
# reinstall - use an existing (eg: NFS mounted) build to do an update.
|
||||
# buildworld - rebuild *everything*, including glue to help do upgrades
|
||||
# installworld- install everything built by "buildworld"
|
||||
# world - buildworld + installworld
|
||||
# update - convenient way to update your source tree (eg: sup/cvs)
|
||||
# most - build user commands, no libraries or include files
|
||||
# installmost - install user commands, no libraries or include files
|
||||
@@ -32,6 +32,9 @@
|
||||
# /usr/share/mk. These include:
|
||||
# obj depend all install clean cleandepend cleanobj
|
||||
|
||||
.if (!make(world)) && (!make(buildworld)) && (!make(installworld))
|
||||
.MAKEFLAGS:= ${.MAKEFLAGS} -m ${.CURDIR}/share/mk
|
||||
.endif
|
||||
|
||||
# Put initial settings here.
|
||||
SUBDIR=
|
||||
@@ -89,11 +92,12 @@ SUBDIR+= etc
|
||||
|
||||
# These are last, since it is nice to at least get the base system
|
||||
# rebuilt before you do them.
|
||||
.if defined(MAKE_LOCAL) & exists(local) & exists(local/Makefile)
|
||||
SUBDIR+= local
|
||||
.if defined(LOCAL_DIRS)
|
||||
.for _DIR in ${LOCAL_DIRS}
|
||||
.if exists(${_DIR}) & exists(${_DIR}/Makefile)
|
||||
SUBDIR+= ${_DIR}
|
||||
.endif
|
||||
.if defined(MAKE_PORTS) & exists(ports) & exists(ports/Makefile)
|
||||
SUBDIR+= ports
|
||||
.endfor
|
||||
.endif
|
||||
|
||||
# Handle -DNOOBJDIR, -DNOCLEAN and -DNOCLEANDIR
|
||||
@@ -113,8 +117,8 @@ CLEANDIR= cleandir
|
||||
.endif
|
||||
.endif
|
||||
|
||||
SUP?= sup
|
||||
SUPFLAGS?= -v
|
||||
SUP?= sup
|
||||
SUPFLAGS?= -v
|
||||
|
||||
#
|
||||
# While building tools for bootstrapping, we dont need to waste time on
|
||||
@@ -135,87 +139,14 @@ world:
|
||||
@echo "make world started on `LC_TIME=C date`"
|
||||
@echo "--------------------------------------------------------------"
|
||||
.if target(pre-world)
|
||||
@echo
|
||||
@echo "--------------------------------------------------------------"
|
||||
@echo " Making 'pre-world' target"
|
||||
@echo "--------------------------------------------------------------"
|
||||
cd ${.CURDIR} && ${MAKE} pre-world
|
||||
@echo
|
||||
.endif
|
||||
@echo "--------------------------------------------------------------"
|
||||
@echo " Making hierarchy"
|
||||
@echo "--------------------------------------------------------------"
|
||||
cd ${.CURDIR} && ${MAKE} hierarchy
|
||||
@echo
|
||||
@echo "--------------------------------------------------------------"
|
||||
@echo " Rebuilding /usr/share/mk"
|
||||
@echo "--------------------------------------------------------------"
|
||||
cd ${.CURDIR} && ${MAKE} mk
|
||||
@echo
|
||||
@echo "--------------------------------------------------------------"
|
||||
@echo " Cleaning up the source tree"
|
||||
@echo "--------------------------------------------------------------"
|
||||
.if defined(NOCLEAN)
|
||||
@echo "Not cleaning anything! I sure hope you know what you are doing!"
|
||||
.else
|
||||
cd ${.CURDIR} && ${MAKE} ${CLEANDIR}
|
||||
.endif
|
||||
@echo
|
||||
.if !defined(NOOBJDIR)
|
||||
@echo "--------------------------------------------------------------"
|
||||
@echo " Rebuilding the obj tree"
|
||||
@echo "--------------------------------------------------------------"
|
||||
cd ${.CURDIR} && ${MAKE} obj
|
||||
@echo
|
||||
.endif
|
||||
@echo "--------------------------------------------------------------"
|
||||
@echo " Rebuilding bootstrap tools"
|
||||
@echo "--------------------------------------------------------------"
|
||||
cd ${.CURDIR} && ${MAKE} bootstrap
|
||||
@echo
|
||||
@echo "--------------------------------------------------------------"
|
||||
@echo " Rebuilding tools necessary to build the include files"
|
||||
@echo "--------------------------------------------------------------"
|
||||
cd ${.CURDIR} && ${MAKE} include-tools
|
||||
@echo
|
||||
@echo "--------------------------------------------------------------"
|
||||
@echo " Rebuilding /usr/include"
|
||||
@echo "--------------------------------------------------------------"
|
||||
cd ${.CURDIR} && ${MAKE} includes
|
||||
@echo
|
||||
@echo "--------------------------------------------------------------"
|
||||
@echo " Rebuilding tools needed to build the libraries"
|
||||
@echo "--------------------------------------------------------------"
|
||||
cd ${.CURDIR} && ${MAKE} lib-tools
|
||||
@echo
|
||||
@echo "--------------------------------------------------------------"
|
||||
@echo " Rebuilding /usr/lib"
|
||||
@echo "--------------------------------------------------------------"
|
||||
cd ${.CURDIR} && ${MAKE} libraries
|
||||
@echo
|
||||
@echo "--------------------------------------------------------------"
|
||||
@echo " Rebuilding sgml tools, symorder, groff and zic(8)"
|
||||
@echo "--------------------------------------------------------------"
|
||||
cd ${.CURDIR} && ${MAKE} build-tools
|
||||
@echo
|
||||
@echo "--------------------------------------------------------------"
|
||||
@echo " Rebuilding dependencies"
|
||||
@echo "--------------------------------------------------------------"
|
||||
cd ${.CURDIR} && ${MAKE} depend
|
||||
@echo
|
||||
@echo "--------------------------------------------------------------"
|
||||
@echo " Building everything.."
|
||||
@echo "--------------------------------------------------------------"
|
||||
cd ${.CURDIR} && ${MAKE} all
|
||||
@echo
|
||||
@echo "--------------------------------------------------------------"
|
||||
@echo " Installing everything.."
|
||||
@echo "--------------------------------------------------------------"
|
||||
cd ${.CURDIR} && ${MAKE} install
|
||||
@echo
|
||||
@echo "--------------------------------------------------------------"
|
||||
@echo " Rebuilding man page indexes"
|
||||
@echo "--------------------------------------------------------------"
|
||||
cd ${.CURDIR}/share/man && ${MAKE} makedb
|
||||
cd ${.CURDIR} && ${MAKE} buildworld
|
||||
cd ${.CURDIR} && ${MAKE} installworld
|
||||
.if target(post-world)
|
||||
@echo
|
||||
@echo "--------------------------------------------------------------"
|
||||
@@ -228,6 +159,132 @@ world:
|
||||
@echo "make world completed on `LC_TIME=C date`"
|
||||
@echo "--------------------------------------------------------------"
|
||||
|
||||
.if defined(MAKEOBJDIRPREFIX)
|
||||
WORLDTMP= ${MAKEOBJDIRPREFIX}${.CURDIR}/tmp
|
||||
.else
|
||||
WORLDTMP= /usr/obj${.CURDIR}/tmp
|
||||
.endif
|
||||
STRICTTMPPATH= ${WORLDTMP}/sbin:${WORLDTMP}/usr/sbin:${WORLDTMP}/bin:${WORLDTMP}/usr/bin
|
||||
TMPPATH= ${STRICTTMPPATH}:${PATH}
|
||||
|
||||
# XXX COMPILER_PATH is needed for finding cc1, ld and as
|
||||
# XXX GCC_EXEC_PREFIX is for *crt.o. It is probably unnecssary now
|
||||
# tbat LIBRARY_PATH is set. We still can't use -nostdlib, since gcc
|
||||
# wouldn't link *crt.o or libgcc if it were used.
|
||||
# XXX LD_LIBRARY_PATH is for ld.so. It is also used by ld, although we don't
|
||||
# want that - all compile-time library paths should be resolved by gcc.
|
||||
# It fails for set[ug]id executables (are any used?).
|
||||
COMPILER_ENV= BISON_SIMPLE=${WORLDTMP}/usr/share/misc/bison.simple \
|
||||
COMPILER_PATH=${WORLDTMP}/usr/libexec:${WORLDTMP}/usr/bin \
|
||||
GCC_EXEC_PREFIX=${WORLDTMP}/usr/lib/ \
|
||||
LD_LIBRARY_PATH=${WORLDTMP}${SHLIBDIR} \
|
||||
LIBRARY_PATH=${WORLDTMP}${SHLIBDIR}:${WORLDTMP}/usr/lib
|
||||
|
||||
BMAKEENV= PATH=${TMPPATH} ${COMPILER_ENV} NOEXTRADEPEND=t
|
||||
XMAKEENV= PATH=${STRICTTMPPATH} ${COMPILER_ENV} \
|
||||
CC='cc -nostdinc' # XXX -nostdlib
|
||||
|
||||
# used to compile and install 'make' in temporary build tree
|
||||
IBMAKE= ${BMAKEENV} ${MAKE} DESTDIR=${WORLDTMP}
|
||||
# bootstrap make
|
||||
BMAKE= ${BMAKEENV} ${WORLDTMP}/usr/bin/${MAKE} DESTDIR=${WORLDTMP}
|
||||
# cross make used for compilation
|
||||
XMAKE= ${XMAKEENV} ${WORLDTMP}/usr/bin/${MAKE} DESTDIR=${WORLDTMP}
|
||||
# cross make used for final installation
|
||||
IXMAKE= ${XMAKEENV} ${WORLDTMP}/usr/bin/${MAKE}
|
||||
|
||||
#
|
||||
# buildworld
|
||||
#
|
||||
# Attempt to rebuild the entire system, with reasonable chance of
|
||||
# success, regardless of how old your existing system is.
|
||||
#
|
||||
buildworld:
|
||||
.if !defined(NOCLEAN)
|
||||
@echo
|
||||
@echo "--------------------------------------------------------------"
|
||||
@echo " Cleaning up the temporary build tree"
|
||||
@echo "--------------------------------------------------------------"
|
||||
mkdir -p ${WORLDTMP}
|
||||
chflags -R noschg ${WORLDTMP}/
|
||||
rm -rf ${WORLDTMP}
|
||||
.endif
|
||||
@echo
|
||||
@echo "--------------------------------------------------------------"
|
||||
@echo " Making make"
|
||||
@echo "--------------------------------------------------------------"
|
||||
mkdir -p ${WORLDTMP}/usr/bin
|
||||
cd ${.CURDIR}/usr.bin/make && \
|
||||
${IBMAKE} -I${.CURDIR}/share/mk ${OBJDIR} clean cleandepend depend && \
|
||||
${IBMAKE} -I${.CURDIR}/share/mk ${MK_FLAGS} all install clean cleandepend
|
||||
@echo
|
||||
@echo "--------------------------------------------------------------"
|
||||
@echo " Making hierarchy"
|
||||
@echo "--------------------------------------------------------------"
|
||||
cd ${.CURDIR} && ${BMAKE} hierarchy
|
||||
.if !defined(NOCLEAN)
|
||||
@echo
|
||||
@echo "--------------------------------------------------------------"
|
||||
@echo " Cleaning up the obj tree"
|
||||
@echo "--------------------------------------------------------------"
|
||||
cd ${.CURDIR} && ${BMAKE} ${CLEANDIR}
|
||||
.endif
|
||||
.if !defined(NOOBJDIR)
|
||||
@echo
|
||||
@echo "--------------------------------------------------------------"
|
||||
@echo " Rebuilding the obj tree"
|
||||
@echo "--------------------------------------------------------------"
|
||||
cd ${.CURDIR} && ${BMAKE} obj
|
||||
.endif
|
||||
@echo
|
||||
@echo "--------------------------------------------------------------"
|
||||
@echo " Rebuilding bootstrap tools"
|
||||
@echo "--------------------------------------------------------------"
|
||||
cd ${.CURDIR} && ${BMAKE} bootstrap
|
||||
@echo
|
||||
@echo "--------------------------------------------------------------"
|
||||
@echo " Rebuilding tools necessary to build the include files"
|
||||
@echo "--------------------------------------------------------------"
|
||||
cd ${.CURDIR} && ${BMAKE} include-tools
|
||||
@echo
|
||||
@echo "--------------------------------------------------------------"
|
||||
@echo " Rebuilding /usr/include"
|
||||
@echo "--------------------------------------------------------------"
|
||||
cd ${.CURDIR} && SHARED=symlinks ${BMAKE} includes
|
||||
@echo
|
||||
@echo "--------------------------------------------------------------"
|
||||
@echo " Rebuilding tools needed to build the libraries"
|
||||
@echo "--------------------------------------------------------------"
|
||||
cd ${.CURDIR} && ${BMAKE} lib-tools
|
||||
@echo
|
||||
@echo "--------------------------------------------------------------"
|
||||
@echo " Rebuilding /usr/lib"
|
||||
@echo "--------------------------------------------------------------"
|
||||
cd ${.CURDIR} && ${BMAKE} libraries
|
||||
@echo
|
||||
@echo "--------------------------------------------------------------"
|
||||
@echo " Rebuilding all other tools needed to build the world"
|
||||
@echo "--------------------------------------------------------------"
|
||||
cd ${.CURDIR} && ${BMAKE} build-tools
|
||||
@echo
|
||||
@echo "--------------------------------------------------------------"
|
||||
@echo " Rebuilding dependencies"
|
||||
@echo "--------------------------------------------------------------"
|
||||
cd ${.CURDIR} && ${XMAKE} depend
|
||||
@echo
|
||||
@echo "--------------------------------------------------------------"
|
||||
@echo " Building everything.."
|
||||
@echo "--------------------------------------------------------------"
|
||||
cd ${.CURDIR} && ${XMAKE} all
|
||||
|
||||
#
|
||||
# installworld
|
||||
#
|
||||
# Installs everything compiled by a 'buildworld'.
|
||||
#
|
||||
installworld:
|
||||
cd ${.CURDIR} && ${IXMAKE} reinstall
|
||||
|
||||
#
|
||||
# reinstall
|
||||
#
|
||||
@@ -242,11 +299,6 @@ reinstall:
|
||||
cd ${.CURDIR} && ${MAKE} hierarchy
|
||||
@echo
|
||||
@echo "--------------------------------------------------------------"
|
||||
@echo " Rebuilding /usr/share/mk"
|
||||
@echo "--------------------------------------------------------------"
|
||||
cd ${.CURDIR} && ${MAKE} mk
|
||||
@echo
|
||||
@echo "--------------------------------------------------------------"
|
||||
@echo " Installing everything.."
|
||||
@echo "--------------------------------------------------------------"
|
||||
cd ${.CURDIR} && ${MAKE} install
|
||||
@@ -256,7 +308,6 @@ reinstall:
|
||||
@echo "--------------------------------------------------------------"
|
||||
cd ${.CURDIR}/share/man && ${MAKE} makedb
|
||||
|
||||
|
||||
#
|
||||
# update
|
||||
#
|
||||
@@ -280,10 +331,9 @@ update:
|
||||
@echo "--------------------------------------------------------------"
|
||||
@echo "Updating /usr/src from cvs repository" ${CVSROOT}
|
||||
@echo "--------------------------------------------------------------"
|
||||
cd ${.CURDIR} && cvs -q update -P -d
|
||||
cd ${.CURDIR} && cvs -q update -P -d -r RELENG_2_2
|
||||
.endif
|
||||
|
||||
|
||||
#
|
||||
# most
|
||||
#
|
||||
@@ -350,34 +400,39 @@ installmost:
|
||||
hierarchy:
|
||||
cd ${.CURDIR}/etc && ${MAKE} distrib-dirs
|
||||
|
||||
#
|
||||
# mk - update the /usr/share/mk makefiles.
|
||||
#
|
||||
mk:
|
||||
cd ${.CURDIR}/share/mk && ${MAKE} install
|
||||
|
||||
#
|
||||
# bootstrap - [re]build tools needed to run the actual build, this includes
|
||||
# tools needed by 'make depend', as some tools are needed to generate source
|
||||
# for the dependency information to be gathered from.
|
||||
#
|
||||
bootstrap:
|
||||
.if defined(DESTDIR)
|
||||
rm -f ${DESTDIR}/usr/src/sys
|
||||
ln -s ${.CURDIR}/sys ${DESTDIR}/usr/src
|
||||
cd ${.CURDIR}/include && find -dx . | cpio -dump ${DESTDIR}/usr/include
|
||||
cd ${.CURDIR}/include && make symlinks
|
||||
.endif
|
||||
cd ${.CURDIR}/usr.bin/make && ${MAKE} depend && \
|
||||
${MAKE} ${MK_FLAGS} all install ${CLEANDIR} ${OBJDIR}
|
||||
cd ${.CURDIR}/usr.bin/xinstall && ${MAKE} depend && \
|
||||
${MAKE} ${MK_FLAGS} all install ${CLEANDIR} ${OBJDIR}
|
||||
cd ${.CURDIR}/usr.bin/lex && ${MAKE} bootstrap && ${MAKE} depend && \
|
||||
${MAKE} ${MK_FLAGS} -DNOLIB all install ${CLEANDIR} ${OBJDIR}
|
||||
${MAKE} ${MK_FLAGS} -DNOLIB all install ${CLEANDIR}
|
||||
.if !defined(NOOBJDIR)
|
||||
cd ${.CURDIR}/usr.bin/lex && ${MAKE} obj
|
||||
.endif
|
||||
|
||||
#
|
||||
# include-tools - generally the same as 'bootstrap', except that it's for
|
||||
# things that are specifically needed to generate include files.
|
||||
#
|
||||
# XXX should be merged with bootstrap, it's not worth keeeping them seperate
|
||||
# XXX should be merged with bootstrap, it's not worth keeeping them separate.
|
||||
# Well, maybe it is now. We force 'cleandepend' here to avoid dependencies
|
||||
# on cleaned away headers in ${WORLDTMP}.
|
||||
#
|
||||
include-tools:
|
||||
cd ${.CURDIR}/usr.bin/rpcgen && ${MAKE} depend && \
|
||||
${MAKE} ${MK_FLAGS} depend all install ${CLEANDIR} ${OBJDIR}
|
||||
cd ${.CURDIR}/usr.bin/rpcgen && ${MAKE} cleandepend depend && \
|
||||
${MAKE} ${MK_FLAGS} all install ${CLEANDIR} ${OBJDIR}
|
||||
|
||||
#
|
||||
# includes - possibly generate and install the include files.
|
||||
@@ -388,25 +443,26 @@ includes:
|
||||
mtree -deU -f ${.CURDIR}/etc/mtree/BSD.include.dist \
|
||||
-p ${DESTDIR}/usr/include
|
||||
.endif
|
||||
cd ${.CURDIR}/include/rpcsvc && ${MAKE} all
|
||||
cd ${.CURDIR}/include && ${MAKE} install
|
||||
cd ${.CURDIR}/include && ${MAKE} all install
|
||||
cd ${.CURDIR}/gnu/include && ${MAKE} install
|
||||
cd ${.CURDIR}/gnu/lib/libreadline && ${MAKE} beforeinstall
|
||||
cd ${.CURDIR}/gnu/lib/libregex && ${MAKE} beforeinstall
|
||||
cd ${.CURDIR}/gnu/lib/libstdc++ && ${MAKE} beforeinstall
|
||||
cd ${.CURDIR}/gnu/lib/libg++ && ${MAKE} beforeinstall
|
||||
cd ${.CURDIR}/gnu/lib/libdialog && ${MAKE} beforeinstall
|
||||
cd ${.CURDIR}/gnu/lib/libstdc++ && ${MAKE} beforeinstall
|
||||
cd ${.CURDIR}/gnu/lib/libg++ && ${MAKE} beforeinstall
|
||||
cd ${.CURDIR}/gnu/lib/libdialog && ${MAKE} beforeinstall
|
||||
.if exists(eBones) && !defined(NOCRYPT) && defined(MAKE_EBONES)
|
||||
cd ${.CURDIR}/eBones/include && ${MAKE} beforeinstall
|
||||
cd ${.CURDIR}/eBones/lib/libkrb && ${MAKE} beforeinstall
|
||||
cd ${.CURDIR}/eBones/lib/libkadm && ${MAKE} beforeinstall
|
||||
.endif
|
||||
cd ${.CURDIR}/lib/csu/i386 && ${MAKE} beforeinstall
|
||||
cd ${.CURDIR}/lib/libalias && ${MAKE} beforeinstall
|
||||
cd ${.CURDIR}/lib/libc && ${MAKE} beforeinstall
|
||||
cd ${.CURDIR}/lib/libcurses && ${MAKE} beforeinstall
|
||||
cd ${.CURDIR}/lib/libedit && ${MAKE} beforeinstall
|
||||
cd ${.CURDIR}/lib/libftpio && ${MAKE} beforeinstall
|
||||
cd ${.CURDIR}/lib/libmd && ${MAKE} beforeinstall
|
||||
cd ${.CURDIR}/lib/libmytinfo && ${MAKE} beforeinstall
|
||||
cd ${.CURDIR}/lib/libmytinfo && ${MAKE} beforeinstall
|
||||
cd ${.CURDIR}/lib/libncurses && ${MAKE} beforeinstall
|
||||
.if !defined(WANT_CSRG_LIBM)
|
||||
cd ${.CURDIR}/lib/msun && ${MAKE} beforeinstall
|
||||
@@ -414,42 +470,36 @@ includes:
|
||||
cd ${.CURDIR}/lib/libpcap && ${MAKE} beforeinstall
|
||||
cd ${.CURDIR}/lib/librpcsvc && ${MAKE} beforeinstall
|
||||
cd ${.CURDIR}/lib/libskey && ${MAKE} beforeinstall
|
||||
cd ${.CURDIR}/lib/libtcl && ${MAKE} beforeinstall
|
||||
cd ${.CURDIR}/lib/libtermcap && ${MAKE} beforeinstall
|
||||
cd ${.CURDIR}/lib/libcom_err && ${MAKE} beforeinstall
|
||||
cd ${.CURDIR}/lib/libss && ${MAKE} beforeinstall
|
||||
cd ${.CURDIR}/lib/libscsi && ${MAKE} beforeinstall
|
||||
cd ${.CURDIR}/lib/libutil && ${MAKE} beforeinstall
|
||||
cd ${.CURDIR}/lib/libz && ${MAKE} beforeinstall
|
||||
|
||||
#
|
||||
# lib-tools - build tools to compile and install the libraries.
|
||||
#
|
||||
# XXX gperf is required for cc
|
||||
# XXX a new ld and tsort is required for cc
|
||||
lib-tools:
|
||||
cd ${.CURDIR}/usr.bin/tsort && ${MAKE} depend && \
|
||||
${MAKE} ${MK_FLAGS} all install ${CLEANDIR} ${OBJDIR}
|
||||
cd ${.CURDIR}/gnu/usr.bin/ld && ${MAKE} depend && \
|
||||
${MAKE} ${MK_FLAGS} all install ${CLEANDIR} ${OBJDIR}
|
||||
cd ${.CURDIR}/gnu/usr.bin/as && ${MAKE} depend && \
|
||||
${MAKE} ${MK_FLAGS} all install ${CLEANDIR} ${OBJDIR}
|
||||
cd ${.CURDIR}/usr.bin/ar && ${MAKE} depend && \
|
||||
${MAKE} ${MK_FLAGS} all install ${CLEANDIR} ${OBJDIR}
|
||||
cd ${.CURDIR}/usr.bin/ranlib && ${MAKE} depend && \
|
||||
${MAKE} ${MK_FLAGS} all install ${CLEANDIR} ${OBJDIR}
|
||||
cd ${.CURDIR}/usr.bin/nm && ${MAKE} depend && \
|
||||
${MAKE} ${MK_FLAGS} all install ${CLEANDIR} ${OBJDIR}
|
||||
cd ${.CURDIR}/usr.bin/lex/lib && ${MAKE} depend && \
|
||||
${MAKE} ${MK_FLAGS} all install ${CLEANDIR} ${OBJDIR}
|
||||
cd ${.CURDIR}/usr.bin/compile_et && ${MAKE} depend && \
|
||||
${MAKE} ${MK_FLAGS} all install ${CLEANDIR} ${OBJDIR} && \
|
||||
rm -f /usr/sbin/compile_et
|
||||
cd ${.CURDIR}/usr.bin/mk_cmds && ${MAKE} depend && \
|
||||
${MAKE} ${MK_FLAGS} all install ${CLEANDIR} ${OBJDIR}
|
||||
cd ${.CURDIR}/gnu/usr.bin/bison && ${MAKE} depend && \
|
||||
${MAKE} ${MK_FLAGS} all install ${CLEANDIR} ${OBJDIR}
|
||||
cd ${.CURDIR}/gnu/usr.bin/gperf && ${MAKE} depend && \
|
||||
${MAKE} ${MK_FLAGS} all install ${CLEANDIR} ${OBJDIR}
|
||||
cd ${.CURDIR}/gnu/usr.bin/cc && ${MAKE} depend && \
|
||||
.for d in \
|
||||
gnu/usr.bin/gperf \
|
||||
gnu/usr.bin/ld \
|
||||
usr.bin/tsort \
|
||||
gnu/usr.bin/as \
|
||||
gnu/usr.bin/bison \
|
||||
gnu/usr.bin/cc \
|
||||
usr.bin/ar \
|
||||
usr.bin/compile_et \
|
||||
usr.bin/lex/lib \
|
||||
usr.bin/mk_cmds \
|
||||
usr.bin/nm \
|
||||
usr.bin/ranlib \
|
||||
usr.bin/uudecode
|
||||
cd ${.CURDIR}/$d && ${MAKE} depend && \
|
||||
${MAKE} ${MK_FLAGS} all install ${CLEANDIR} ${OBJDIR}
|
||||
.endfor
|
||||
|
||||
#
|
||||
# libraries - build and install the libraries
|
||||
@@ -499,18 +549,70 @@ libraries:
|
||||
#
|
||||
# build-tools - build and install any other tools needed to complete the
|
||||
# compile and install.
|
||||
# ifdef stale
|
||||
# bc and cpp are required to build groff. Otherwise, the order here is
|
||||
# mostly historical, i.e., bogus.
|
||||
# chmod is used to build gcc's tmpmultilib[2] at obscure times.
|
||||
# endif stale
|
||||
# XXX uname is a bug - the target should not depend on the host.
|
||||
#
|
||||
build-tools:
|
||||
.for d in \
|
||||
share/info \
|
||||
gnu/usr.bin/texinfo \
|
||||
usr.bin/symorder \
|
||||
usr.bin/sgmls \
|
||||
usr.bin/sgmlfmt \
|
||||
share/sgml \
|
||||
usr.sbin/zic \
|
||||
bin/cat \
|
||||
bin/chmod \
|
||||
bin/cp \
|
||||
bin/date \
|
||||
bin/dd \
|
||||
bin/echo \
|
||||
bin/expr \
|
||||
bin/hostname \
|
||||
bin/ln \
|
||||
bin/ls \
|
||||
bin/mkdir \
|
||||
bin/mv \
|
||||
bin/rm \
|
||||
bin/sh \
|
||||
bin/test \
|
||||
gnu/usr.bin/awk \
|
||||
gnu/usr.bin/groff
|
||||
gnu/usr.bin/bc \
|
||||
gnu/usr.bin/grep \
|
||||
gnu/usr.bin/groff \
|
||||
gnu/usr.bin/gzip \
|
||||
gnu/usr.bin/man/makewhatis \
|
||||
gnu/usr.bin/sort \
|
||||
gnu/usr.bin/texinfo \
|
||||
share/info \
|
||||
usr.bin/basename \
|
||||
usr.bin/cap_mkdb \
|
||||
usr.bin/chflags \
|
||||
usr.bin/cmp \
|
||||
usr.bin/col \
|
||||
usr.bin/cpp \
|
||||
usr.bin/expand \
|
||||
usr.bin/file2c \
|
||||
usr.bin/find \
|
||||
usr.bin/gencat \
|
||||
usr.bin/lorder \
|
||||
usr.bin/m4 \
|
||||
usr.bin/mkdep \
|
||||
usr.bin/paste \
|
||||
usr.bin/sed \
|
||||
usr.bin/size \
|
||||
usr.bin/soelim \
|
||||
usr.bin/strip \
|
||||
usr.bin/symorder \
|
||||
usr.bin/touch \
|
||||
usr.bin/tr \
|
||||
usr.bin/true \
|
||||
usr.bin/uname \
|
||||
usr.bin/uuencode \
|
||||
usr.bin/vgrind \
|
||||
usr.bin/vi \
|
||||
usr.bin/wc \
|
||||
usr.bin/yacc \
|
||||
usr.sbin/chown \
|
||||
usr.sbin/mtree \
|
||||
usr.sbin/zic
|
||||
cd ${.CURDIR}/$d && ${MAKE} depend && \
|
||||
${MAKE} ${MK_FLAGS} all install ${CLEANDIR} ${OBJDIR}
|
||||
.endfor
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
This is the top level of the FreeBSD source directory. This file
|
||||
was last revised on: $Id$
|
||||
was last revised on: $Id: README,v 1.7 1997/01/01 14:06:29 jkh Exp $
|
||||
|
||||
For copyright information, please see the file COPYRIGHT in this
|
||||
directory (additional copyright information also exists for some
|
||||
@@ -10,8 +10,9 @@ The Makefile in this directory supports a number of targets for
|
||||
building components (or all) of the FreeBSD source tree, the most
|
||||
commonly used one being ``world'', which rebuilds and installs
|
||||
everything in the FreeBSD system from the source tree except the
|
||||
kernel. Please see the top of the Makefile for more information on
|
||||
the standard build targets and compile-time flags.
|
||||
kernel and the contents of /etc. Please see the top of the Makefile
|
||||
in this directory for more information on the standard build targets
|
||||
and compile-time flags.
|
||||
|
||||
Building a kernel with config(1) is a somewhat more involved process,
|
||||
documentation for which can be found at:
|
||||
|
||||
+4
-4
@@ -33,17 +33,17 @@
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: cat.c,v 1.4 1996/09/28 21:19:27 imp Exp $
|
||||
* $Id: cat.c,v 1.5 1996/09/30 15:45:36 ache Exp $
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
static char copyright[] =
|
||||
static char const copyright[] =
|
||||
"@(#) Copyright (c) 1989, 1993\n\
|
||||
The Regents of the University of California. All rights reserved.\n";
|
||||
#endif /* not lint */
|
||||
|
||||
#ifndef lint
|
||||
static char sccsid[] = "@(#)cat.c 8.2 (Berkeley) 4/27/95";
|
||||
static char const sccsid[] = "@(#)cat.c 8.2 (Berkeley) 4/27/95";
|
||||
#endif /* not lint */
|
||||
|
||||
#include <sys/param.h>
|
||||
@@ -78,7 +78,7 @@ main(argc, argv)
|
||||
|
||||
setlocale(LC_CTYPE, "");
|
||||
|
||||
while ((ch = getopt(argc, argv, "benstuv")) != EOF)
|
||||
while ((ch = getopt(argc, argv, "benstuv")) != -1)
|
||||
switch (ch) {
|
||||
case 'b':
|
||||
bflag = nflag = 1; /* -b implies -n */
|
||||
|
||||
+1
-3
@@ -1,9 +1,7 @@
|
||||
# $Id: $
|
||||
# $Id: Makefile,v 1.1.1.1 1997/03/06 15:30:06 joerg Exp $
|
||||
# @(#)Makefile 8.1 (Berkeley) 6/6/93
|
||||
|
||||
PROG= chio
|
||||
SRCS= chio.c
|
||||
BINOWN= root
|
||||
BINMODE=4555
|
||||
|
||||
.include <bsd.prog.mk>
|
||||
+2
-1
@@ -124,7 +124,7 @@ specify whether the media units are to be inverted before insertion into
|
||||
.Pa <dst1 ET/EU>
|
||||
and
|
||||
.Pa <dst2 ET/EU>
|
||||
respecitively.
|
||||
respectively.
|
||||
.Pp
|
||||
Note that not all medium changers support the
|
||||
.Nm exchange
|
||||
@@ -194,6 +194,7 @@ Configures the changer to use picker 2 (third picker) for operations.
|
||||
/dev/ch0 - default changer device
|
||||
.Sh SEE ALSO
|
||||
.Xr mt 1 ,
|
||||
.Xr ch 4 ,
|
||||
.Xr mount 8 .
|
||||
.Sh AUTHOR
|
||||
The
|
||||
|
||||
+23
-19
@@ -1,4 +1,4 @@
|
||||
/* $Id: $ */
|
||||
/* $Id: chio.c,v 1.1.1.1.2.1 1997/06/06 16:02:01 charnier Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1996 Jason R. Thorpe <[email protected]>
|
||||
@@ -47,8 +47,6 @@
|
||||
#include "defs.h"
|
||||
#include "pathnames.h"
|
||||
|
||||
extern char *__progname; /* from crt0.o */
|
||||
|
||||
static void usage __P((void));
|
||||
static void cleanup __P((void));
|
||||
static int parse_element_type __P((char *));
|
||||
@@ -103,7 +101,6 @@ main(argc, argv)
|
||||
char **argv;
|
||||
{
|
||||
int ch, i;
|
||||
char *cp;
|
||||
|
||||
while ((ch = getopt(argc, argv, "f:")) != -1) {
|
||||
switch (ch) {
|
||||
@@ -209,8 +206,8 @@ do_move(cname, argc, argv)
|
||||
return (0);
|
||||
|
||||
usage:
|
||||
fprintf(stderr, "usage: %s %s "
|
||||
"<from ET> <from EU> <to ET> <to EU> [inv]\n", __progname, cname);
|
||||
fprintf(stderr, "usage: chio %s "
|
||||
"<from ET> <from EU> <to ET> <to EU> [inv]\n", cname);
|
||||
return (1);
|
||||
}
|
||||
|
||||
@@ -302,9 +299,9 @@ do_exchange(cname, argc, argv)
|
||||
return (0);
|
||||
|
||||
usage:
|
||||
fprintf(stderr, "usage: %s %s <src ET> <src EU> <dst1 ET> <dst1 EU>\n"
|
||||
" [<dst2 ET> <dst2 EU>] [inv1] [inv2]\n",
|
||||
__progname, cname);
|
||||
fprintf(stderr,
|
||||
"usage: chio %s <src ET> <src EU> <dst1 ET> <dst1 EU>\n"
|
||||
" [<dst2 ET> <dst2 EU>] [inv1] [inv2]\n", cname);
|
||||
return (1);
|
||||
}
|
||||
|
||||
@@ -363,8 +360,7 @@ do_position(cname, argc, argv)
|
||||
return (0);
|
||||
|
||||
usage:
|
||||
fprintf(stderr, "usage: %s %s <to ET> <to EU> [inv]\n",
|
||||
__progname, cname);
|
||||
fprintf(stderr, "usage: chio %s <to ET> <to EU> [inv]\n", cname);
|
||||
return (1);
|
||||
}
|
||||
|
||||
@@ -400,7 +396,7 @@ do_params(cname, argc, argv)
|
||||
return (0);
|
||||
|
||||
usage:
|
||||
fprintf(stderr, "usage: %s %s\n", __progname, cname);
|
||||
fprintf(stderr, "usage: chio %s\n", cname);
|
||||
return (1);
|
||||
}
|
||||
|
||||
@@ -427,7 +423,7 @@ do_getpicker(cname, argc, argv)
|
||||
return (0);
|
||||
|
||||
usage:
|
||||
fprintf(stderr, "usage: %s %s\n", __progname, cname);
|
||||
fprintf(stderr, "usage: chio %s\n", cname);
|
||||
return (1);
|
||||
}
|
||||
|
||||
@@ -456,7 +452,7 @@ do_setpicker(cname, argc, argv)
|
||||
return (0);
|
||||
|
||||
usage:
|
||||
fprintf(stderr, "usage: %s %s <picker>\n", __progname, cname);
|
||||
fprintf(stderr, "usage: chio %s <picker>\n", cname);
|
||||
return (1);
|
||||
}
|
||||
|
||||
@@ -470,7 +466,10 @@ do_status(cname, argc, argv)
|
||||
struct changer_params data;
|
||||
u_int8_t *statusp;
|
||||
int i, count, chet, schet, echet;
|
||||
char *cmdname, *description;
|
||||
char *description;
|
||||
|
||||
count = 0;
|
||||
description = NULL;
|
||||
|
||||
/*
|
||||
* On a status command, we expect the following:
|
||||
@@ -562,8 +561,7 @@ do_status(cname, argc, argv)
|
||||
return (0);
|
||||
|
||||
usage:
|
||||
fprintf(stderr, "usage: %s %s [<element type>]\n", __progname,
|
||||
cname);
|
||||
fprintf(stderr, "usage: chio %s [<element type>]\n", cname);
|
||||
return (1);
|
||||
}
|
||||
|
||||
@@ -637,7 +635,8 @@ bits_to_string(v, cp)
|
||||
np++;
|
||||
if ((v & (1 << (f - 1))) == 0)
|
||||
continue;
|
||||
bp += sprintf(bp, "%c%.*s", sep, np - cp, cp);
|
||||
bp += snprintf(bp, sizeof(buf) - (bp - &buf[0]),
|
||||
"%c%.*s", sep, np - cp, cp);
|
||||
sep = ',';
|
||||
}
|
||||
if (sep != '<')
|
||||
@@ -657,7 +656,12 @@ cleanup()
|
||||
static void
|
||||
usage()
|
||||
{
|
||||
int i;
|
||||
|
||||
fprintf(stderr, "usage: %s command arg1 arg2 ...\n", __progname);
|
||||
fprintf(stderr, "usage: chio [-f changer] command [args ...]\n");
|
||||
fprintf(stderr, "commands:");
|
||||
for (i = 0; commands[i].cc_name; i++)
|
||||
fprintf(stderr, " %s", commands[i].cc_name);
|
||||
fprintf(stderr, "\n");
|
||||
exit(1);
|
||||
}
|
||||
+4
-4
@@ -30,17 +30,17 @@
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: chmod.c,v 1.4 1995/03/19 13:27:43 joerg Exp $
|
||||
* $Id: chmod.c,v 1.5.2.1 1997/08/24 10:30:25 jkh Exp $
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
static char copyright[] =
|
||||
static char const copyright[] =
|
||||
"@(#) Copyright (c) 1989, 1993, 1994\n\
|
||||
The Regents of the University of California. All rights reserved.\n";
|
||||
#endif /* not lint */
|
||||
|
||||
#ifndef lint
|
||||
static char sccsid[] = "@(#)chmod.c 8.8 (Berkeley) 4/1/94";
|
||||
static char const sccsid[] = "@(#)chmod.c 8.8 (Berkeley) 4/1/94";
|
||||
#endif /* not lint */
|
||||
|
||||
#include <sys/types.h>
|
||||
@@ -73,7 +73,7 @@ main(argc, argv)
|
||||
set = NULL;
|
||||
omode = 0;
|
||||
Hflag = Lflag = Pflag = Rflag = fflag = hflag = 0;
|
||||
while ((ch = getopt(argc, argv, "HLPRXfgorstuwx")) != EOF)
|
||||
while ((ch = getopt(argc, argv, "HLPRXfgorstuwx")) != -1)
|
||||
switch (ch) {
|
||||
case 'H':
|
||||
Hflag = 1;
|
||||
|
||||
+13
-6
@@ -33,17 +33,17 @@
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: cp.c,v 1.9 1996/02/19 05:56:33 pst Exp $
|
||||
* $Id: cp.c,v 1.10 1996/03/08 06:58:06 wosch Exp $
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
static char copyright[] =
|
||||
static char const copyright[] =
|
||||
"@(#) Copyright (c) 1988, 1993, 1994\n\
|
||||
The Regents of the University of California. All rights reserved.\n";
|
||||
#endif /* not lint */
|
||||
|
||||
#ifndef lint
|
||||
static char sccsid[] = "@(#)cp.c 8.2 (Berkeley) 4/1/94";
|
||||
static char const sccsid[] = "@(#)cp.c 8.2 (Berkeley) 4/1/94";
|
||||
#endif /* not lint */
|
||||
|
||||
/*
|
||||
@@ -51,7 +51,7 @@ static char sccsid[] = "@(#)cp.c 8.2 (Berkeley) 4/1/94";
|
||||
*
|
||||
* The global PATH_T structure "to" always contains the path to the
|
||||
* current target file. Since fts(3) does not change directories,
|
||||
* this path can be either absolute or dot-realative.
|
||||
* this path can be either absolute or dot-relative.
|
||||
*
|
||||
* The basic algorithm is to initialize "to" and use fts(3) to traverse
|
||||
* the file hierarchy rooted in the argument list. A trivial case is the
|
||||
@@ -105,7 +105,7 @@ main(argc, argv)
|
||||
char *target;
|
||||
|
||||
Hflag = Lflag = Pflag = 0;
|
||||
while ((ch = getopt(argc, argv, "HLPRfipr")) != EOF)
|
||||
while ((ch = getopt(argc, argv, "HLPRfipr")) != -1)
|
||||
switch (ch) {
|
||||
case 'H':
|
||||
Hflag = 1;
|
||||
@@ -253,7 +253,7 @@ copy(argv, type, fts_options)
|
||||
struct stat to_stat;
|
||||
FTS *ftsp;
|
||||
FTSENT *curr;
|
||||
int base, dne, nlen, rval;
|
||||
int base = 0, dne, nlen, rval;
|
||||
char *p, *target_mid;
|
||||
|
||||
if ((ftsp = fts_open(argv, fts_options, mastercmp)) == NULL)
|
||||
@@ -341,6 +341,13 @@ copy(argv, type, fts_options)
|
||||
(void)fts_set(ftsp, curr, FTS_SKIP);
|
||||
continue;
|
||||
}
|
||||
if (!S_ISDIR(curr->fts_statp->st_mode) &&
|
||||
S_ISDIR(to_stat.st_mode)) {
|
||||
warnx("cannot overwrite directory %s with non-directory %s",
|
||||
to.p_path, curr->fts_path);
|
||||
rval = 1;
|
||||
continue;
|
||||
}
|
||||
dne = 0;
|
||||
}
|
||||
|
||||
|
||||
+3
-3
@@ -30,11 +30,11 @@
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: utils.c,v 1.6 1996/02/18 18:48:26 wosch Exp wosch $
|
||||
* $Id: utils.c,v 1.9 1996/03/08 06:58:08 wosch Exp $
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
static char sccsid[] = "@(#)utils.c 8.3 (Berkeley) 4/1/94";
|
||||
static char const sccsid[] = "@(#)utils.c 8.3 (Berkeley) 4/1/94";
|
||||
#endif /* not lint */
|
||||
|
||||
#include <sys/param.h>
|
||||
@@ -121,7 +121,7 @@ copy_file(entp, dne)
|
||||
#ifdef VM_AND_BUFFER_CACHE_SYNCHRONIZED
|
||||
if (fs->st_size <= 8 * 1048576) {
|
||||
if ((p = mmap(NULL, (size_t)fs->st_size, PROT_READ,
|
||||
0, from_fd, (off_t)0)) == (char *)-1) {
|
||||
MAP_SHARED, from_fd, (off_t)0)) == MAP_FAILED) {
|
||||
warn("%s", entp->fts_path);
|
||||
rval = 1;
|
||||
} else {
|
||||
|
||||
+15
-15
@@ -1,5 +1,5 @@
|
||||
# @(#)Makefile 8.1 (Berkeley) 5/31/93
|
||||
# $Id$
|
||||
# $Id: Makefile,v 1.5 1994/09/24 02:53:44 davidg Exp $
|
||||
#
|
||||
# C Shell with process control; VM/UNIX VAX Makefile
|
||||
# Bill Joy UC Berkeley; Jim Kulp IIASA, Austria
|
||||
@@ -11,7 +11,7 @@ DFLAGS=-DBUILTIN -DFILEC -DNLS -DSHORT_STRINGS
|
||||
CFLAGS+=-I${.CURDIR} -I. ${DFLAGS}
|
||||
SRCS= alloc.c char.c const.c csh.c dir.c dol.c err.c exec.c exp.c file.c \
|
||||
func.c glob.c hist.c init.c lex.c misc.c parse.c printf.c proc.c \
|
||||
sem.c set.c str.c time.c const.h err.h
|
||||
sem.c set.c str.c time.c const.h errnum.h
|
||||
.PATH: ${.CURDIR}/../../usr.bin/printf
|
||||
|
||||
MAN1= csh.1
|
||||
@@ -19,23 +19,23 @@ MLINKS= csh.1 limit.1 csh.1 alias.1 csh.1 bg.1 csh.1 dirs.1 csh.1 fg.1 \
|
||||
csh.1 foreach.1 csh.1 history.1 csh.1 jobs.1 csh.1 popd.1 \
|
||||
csh.1 pushd.1 csh.1 rehash.1 csh.1 repeat.1 csh.1 suspend.1 \
|
||||
csh.1 stop.1 csh.1 source.1
|
||||
CLEANFILES+=err.h const.h
|
||||
CLEANFILES+=const.h errnum.h
|
||||
|
||||
const.h: err.h
|
||||
const.h: errnum.h
|
||||
|
||||
err.h: err.c
|
||||
@rm -f $@
|
||||
@echo '/* Do not edit this file, make creates it. */' > $@
|
||||
@echo '#ifndef _h_sh_err' >> $@
|
||||
@echo '#define _h_sh_err' >> $@
|
||||
egrep 'ERR_' ${.CURDIR}/$*.c | egrep '^#define' >> $@
|
||||
@echo '#endif /* _h_sh_err */' >> $@
|
||||
errnum.h: err.c
|
||||
@rm -f ${.TARGET}
|
||||
@echo '/* Do not edit this file, make creates it. */' > ${.TARGET}
|
||||
@echo '#ifndef _h_sh_error' >> ${.TARGET}
|
||||
@echo '#define _h_sh_error' >> ${.TARGET}
|
||||
egrep 'ERR_' ${.ALLSRC} | egrep '^#define' >> ${.TARGET}
|
||||
@echo '#endif /* _h_sh_error */' >> ${.TARGET}
|
||||
|
||||
const.h: const.c
|
||||
@rm -f $@
|
||||
@echo '/* Do not edit this file, make creates it. */' > $@
|
||||
${CC} -E ${CFLAGS} ${.CURDIR}/$*.c | egrep 'Char STR' | \
|
||||
@rm -f ${.TARGET}
|
||||
@echo '/* Do not edit this file, make creates it. */' > ${.TARGET}
|
||||
${CC} -E ${CFLAGS} ${.ALLSRC} | egrep 'Char STR' | \
|
||||
sed -e 's/Char \([a-zA-Z0-9_]*\)\(.*\)/extern Char \1[];/' | \
|
||||
sort >> $@
|
||||
sort >> ${.TARGET}
|
||||
|
||||
.include <bsd.prog.mk>
|
||||
+19
-19
@@ -30,7 +30,7 @@
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: csh.c,v 1.5 1995/07/07 23:14:36 ache Exp $
|
||||
* $Id: csh.c,v 1.6 1995/10/23 23:08:25 ache Exp $
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
@@ -114,10 +114,10 @@ main(argc, argv)
|
||||
int argc;
|
||||
char **argv;
|
||||
{
|
||||
register Char *cp;
|
||||
register char *tcp;
|
||||
register int f;
|
||||
register char **tempv;
|
||||
Char *cp;
|
||||
char *tcp;
|
||||
int f;
|
||||
char **tempv;
|
||||
struct sigvec osv;
|
||||
|
||||
cshin = stdin;
|
||||
@@ -603,9 +603,9 @@ void
|
||||
importpath(cp)
|
||||
Char *cp;
|
||||
{
|
||||
register int i = 0;
|
||||
register Char *dp;
|
||||
register Char **pv;
|
||||
int i = 0;
|
||||
Char *dp;
|
||||
Char **pv;
|
||||
int c;
|
||||
|
||||
for (dp = cp; *dp; dp++)
|
||||
@@ -623,7 +623,7 @@ importpath(cp)
|
||||
if ((c = *dp) == ':' || c == 0) {
|
||||
*dp = 0;
|
||||
if (*cp != '/' && (euid == 0 || uid == 0) &&
|
||||
(intact || intty && isatty(SHOUT)))
|
||||
(intact || (intty && isatty(SHOUT))))
|
||||
(void) fprintf(csherr,
|
||||
"Warning: imported path contains relative components\n");
|
||||
pv[i++] = Strsave(*cp ? cp : STRdot);
|
||||
@@ -647,7 +647,7 @@ static int
|
||||
srccat(cp, dp)
|
||||
Char *cp, *dp;
|
||||
{
|
||||
register Char *ep = Strspl(cp, dp);
|
||||
Char *ep = Strspl(cp, dp);
|
||||
char *ptr = short2str(ep);
|
||||
|
||||
xfree((ptr_t) ep);
|
||||
@@ -662,7 +662,7 @@ srcfile(f, onlyown, flag)
|
||||
char *f;
|
||||
bool onlyown, flag;
|
||||
{
|
||||
register int unit;
|
||||
int unit;
|
||||
|
||||
if ((unit = open(f, O_RDONLY)) == -1)
|
||||
return 0;
|
||||
@@ -680,7 +680,7 @@ srcfile(f, onlyown, flag)
|
||||
int insource;
|
||||
static void
|
||||
srcunit(unit, onlyown, hflg)
|
||||
register int unit;
|
||||
int unit;
|
||||
bool onlyown, hflg;
|
||||
{
|
||||
/* We have to push down a lot of state here */
|
||||
@@ -731,7 +731,7 @@ srcunit(unit, onlyown, hflg)
|
||||
if (setintr)
|
||||
omask = sigblock(sigmask(SIGINT));
|
||||
/* Setup the new values of the state stuff saved above */
|
||||
bcopy((char *) &B, (char *) &(saveB), sizeof(B));
|
||||
memmove((char *) &(saveB), (char *) &B, sizeof(B));
|
||||
fbuf = NULL;
|
||||
fseekp = feobp = fblocks = 0;
|
||||
oSHIN = SHIN, SHIN = unit, arginp = 0, onelflg = 0;
|
||||
@@ -756,7 +756,7 @@ srcunit(unit, onlyown, hflg)
|
||||
if (setintr)
|
||||
(void) sigsetmask(omask);
|
||||
if (oSHIN >= 0) {
|
||||
register int i;
|
||||
int i;
|
||||
|
||||
/* We made it to the new state... free up its storage */
|
||||
/* This code could get run twice but xfree doesn't care */
|
||||
@@ -765,7 +765,7 @@ srcunit(unit, onlyown, hflg)
|
||||
xfree((ptr_t) fbuf);
|
||||
|
||||
/* Reset input arena */
|
||||
bcopy((char *) &(saveB), (char *) &B, sizeof(B));
|
||||
memmove((char *) &B, (char *) &(saveB), sizeof(B));
|
||||
|
||||
(void) close(SHIN), SHIN = oSHIN;
|
||||
arginp = oarginp, onelflg = oonelflg;
|
||||
@@ -1120,7 +1120,7 @@ dosource(v, t)
|
||||
struct command *t;
|
||||
|
||||
{
|
||||
register Char *f;
|
||||
Char *f;
|
||||
bool hflg = 0;
|
||||
Char buf[BUFSIZ];
|
||||
|
||||
@@ -1150,8 +1150,8 @@ dosource(v, t)
|
||||
static void
|
||||
mailchk()
|
||||
{
|
||||
register struct varent *v;
|
||||
register Char **vp;
|
||||
struct varent *v;
|
||||
Char **vp;
|
||||
time_t t;
|
||||
int intvl, cnt;
|
||||
struct stat stb;
|
||||
@@ -1338,7 +1338,7 @@ defaultpath()
|
||||
void
|
||||
printprompt()
|
||||
{
|
||||
register Char *cp;
|
||||
Char *cp;
|
||||
|
||||
if (!whyles) {
|
||||
for (cp = value(STRprompt); *cp; cp++)
|
||||
|
||||
+4
-6
@@ -31,7 +31,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)csh.h 8.1 (Berkeley) 5/31/93
|
||||
* $Id$
|
||||
* $Id: csh.h,v 1.2 1994/09/24 02:53:52 davidg Exp $
|
||||
*/
|
||||
|
||||
/*
|
||||
@@ -84,7 +84,7 @@ typedef void *ptr_t;
|
||||
|
||||
#include "const.h"
|
||||
#include "char.h"
|
||||
#include "err.h"
|
||||
#include "errnum.h"
|
||||
|
||||
#define xmalloc(i) Malloc(i)
|
||||
#define xrealloc(p, i) Realloc(p, i)
|
||||
@@ -187,8 +187,8 @@ jmp_buf reslab;
|
||||
#define setexit() (setjmp(reslab))
|
||||
#define reset() longjmp(reslab, 1)
|
||||
/* Should use structure assignment here */
|
||||
#define getexit(a) bcopy((char *)reslab, ((char *)(a)), sizeof reslab)
|
||||
#define resexit(a) bcopy((char *)(a), (char *)reslab, sizeof reslab)
|
||||
#define getexit(a) memmove((char *)(a), (char *)reslab, sizeof reslab)
|
||||
#define resexit(a) memmove((char *)reslab, (char *)(a), sizeof reslab)
|
||||
|
||||
Char *gointr; /* Label for an onintr transfer */
|
||||
|
||||
@@ -421,8 +421,6 @@ struct varent {
|
||||
#define v_right v_link[1]
|
||||
#define v_parent v_link[2]
|
||||
|
||||
struct varent *adrof1();
|
||||
|
||||
#define adrof(v) adrof1(v, &shvhed)
|
||||
#define value(v) value1(v, &shvhed)
|
||||
|
||||
|
||||
+25
-25
@@ -30,7 +30,7 @@
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: dir.c,v 1.3 1995/05/30 00:06:30 rgrimes Exp $
|
||||
* $Id: dir.c,v 1.4 1995/06/18 14:34:48 ache Exp $
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
@@ -75,9 +75,9 @@ void
|
||||
dinit(hp)
|
||||
Char *hp;
|
||||
{
|
||||
register char *tcp;
|
||||
register Char *cp;
|
||||
register struct directory *dp;
|
||||
char *tcp;
|
||||
Char *cp;
|
||||
struct directory *dp;
|
||||
char path[MAXPATHLEN];
|
||||
static char *emsg = "csh: Trying to start from \"%s\"\n";
|
||||
|
||||
@@ -145,7 +145,7 @@ Char *dp;
|
||||
* Don't call set() directly cause if the directory contains ` or
|
||||
* other junk characters glob will fail.
|
||||
*/
|
||||
register Char **vec = (Char **) xmalloc((size_t) (2 * sizeof(Char **)));
|
||||
Char **vec = (Char **) xmalloc((size_t) (2 * sizeof(Char **)));
|
||||
|
||||
vec[0] = Strsave(dp);
|
||||
vec[1] = 0;
|
||||
@@ -203,7 +203,7 @@ dodirs(v, t)
|
||||
static void
|
||||
printdirs()
|
||||
{
|
||||
register struct directory *dp;
|
||||
struct directory *dp;
|
||||
Char *s, *hp = value(STRhome);
|
||||
int idx, len, cur;
|
||||
|
||||
@@ -240,7 +240,7 @@ printdirs()
|
||||
|
||||
void
|
||||
dtildepr(home, dir)
|
||||
register Char *home, *dir;
|
||||
Char *home, *dir;
|
||||
{
|
||||
|
||||
if (!eq(home, STRslash) && prefix(home, dir))
|
||||
@@ -340,8 +340,8 @@ dochngd(v, t)
|
||||
Char **v;
|
||||
struct command *t;
|
||||
{
|
||||
register Char *cp;
|
||||
register struct directory *dp;
|
||||
Char *cp;
|
||||
struct directory *dp;
|
||||
|
||||
skipargs(&v, " [<dir>]");
|
||||
printd = 0;
|
||||
@@ -389,7 +389,7 @@ dgoto(cp)
|
||||
Char *dp;
|
||||
|
||||
if (*cp != '/') {
|
||||
register Char *p, *q;
|
||||
Char *p, *q;
|
||||
int cwdlen;
|
||||
|
||||
for (p = dcwd->di_name; *p++;)
|
||||
@@ -423,9 +423,9 @@ dgoto(cp)
|
||||
*/
|
||||
static Char *
|
||||
dfollow(cp)
|
||||
register Char *cp;
|
||||
Char *cp;
|
||||
{
|
||||
register Char *dp;
|
||||
Char *dp;
|
||||
struct varent *c;
|
||||
char ebuf[MAXPATHLEN];
|
||||
int serrno;
|
||||
@@ -449,7 +449,7 @@ dfollow(cp)
|
||||
if (cp[0] != '/' && !prefix(STRdotsl, cp) && !prefix(STRdotdotsl, cp)
|
||||
&& (c = adrof(STRcdpath))) {
|
||||
Char **cdp;
|
||||
register Char *p;
|
||||
Char *p;
|
||||
Char buf[MAXPATHLEN];
|
||||
|
||||
for (cdp = c->vec; *cdp; cdp++) {
|
||||
@@ -491,7 +491,7 @@ dopushd(v, t)
|
||||
Char **v;
|
||||
struct command *t;
|
||||
{
|
||||
register struct directory *dp;
|
||||
struct directory *dp;
|
||||
|
||||
skipargs(&v, " [<dir>|+<n>]");
|
||||
printd = 1;
|
||||
@@ -523,7 +523,7 @@ dopushd(v, t)
|
||||
stderror(ERR_SYSTEM, tmp, strerror(errno));
|
||||
}
|
||||
else {
|
||||
register Char *ccp;
|
||||
Char *ccp;
|
||||
|
||||
ccp = dfollow(*v);
|
||||
dp = (struct directory *) xcalloc(sizeof(struct directory), 1);
|
||||
@@ -542,11 +542,11 @@ dopushd(v, t)
|
||||
*/
|
||||
static struct directory *
|
||||
dfind(cp)
|
||||
register Char *cp;
|
||||
Char *cp;
|
||||
{
|
||||
register struct directory *dp;
|
||||
register int i;
|
||||
register Char *ep;
|
||||
struct directory *dp;
|
||||
int i;
|
||||
Char *ep;
|
||||
|
||||
if (*cp++ != '+')
|
||||
return (0);
|
||||
@@ -576,7 +576,7 @@ dopopd(v, t)
|
||||
Char **v;
|
||||
struct command *t;
|
||||
{
|
||||
register struct directory *dp, *p = NULL;
|
||||
struct directory *dp, *p = NULL;
|
||||
|
||||
skipargs(&v, " [+<n>]");
|
||||
printd = 1;
|
||||
@@ -614,7 +614,7 @@ dopopd(v, t)
|
||||
*/
|
||||
void
|
||||
dfree(dp)
|
||||
register struct directory *dp;
|
||||
struct directory *dp;
|
||||
{
|
||||
|
||||
if (dp->di_count != 0) {
|
||||
@@ -633,10 +633,10 @@ dfree(dp)
|
||||
*/
|
||||
Char *
|
||||
dcanon(cp, p)
|
||||
register Char *cp, *p;
|
||||
Char *cp, *p;
|
||||
{
|
||||
register Char *sp;
|
||||
register Char *p1, *p2; /* general purpose */
|
||||
Char *sp;
|
||||
Char *p1, *p2; /* general purpose */
|
||||
bool slash;
|
||||
|
||||
Char link[MAXPATHLEN];
|
||||
@@ -923,7 +923,7 @@ dcanon(cp, p)
|
||||
*/
|
||||
static void
|
||||
dnewcwd(dp)
|
||||
register struct directory *dp;
|
||||
struct directory *dp;
|
||||
{
|
||||
dcwd = dp;
|
||||
dset(dcwd->di_name);
|
||||
|
||||
+23
-23
@@ -30,7 +30,7 @@
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: dol.c,v 1.2 1994/09/24 02:53:56 davidg Exp $
|
||||
* $Id: dol.c,v 1.3 1995/05/30 00:06:31 rgrimes Exp $
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
@@ -105,10 +105,10 @@ static void Dtestq __P((int));
|
||||
*/
|
||||
void
|
||||
Dfix(t)
|
||||
register struct command *t;
|
||||
struct command *t;
|
||||
{
|
||||
register Char **pp;
|
||||
register Char *p;
|
||||
Char **pp;
|
||||
Char *p;
|
||||
|
||||
if (noexec)
|
||||
return;
|
||||
@@ -130,7 +130,7 @@ Dfix(t)
|
||||
*/
|
||||
Char *
|
||||
Dfix1(cp)
|
||||
register Char *cp;
|
||||
Char *cp;
|
||||
{
|
||||
Char *Dv[2];
|
||||
|
||||
@@ -173,8 +173,8 @@ static Char *
|
||||
Dpack(wbuf, wp)
|
||||
Char *wbuf, *wp;
|
||||
{
|
||||
register int c;
|
||||
register int i = MAXWLEN - (wp - wbuf);
|
||||
int c;
|
||||
int i = MAXWLEN - (wp - wbuf);
|
||||
|
||||
for (;;) {
|
||||
c = DgetC(DODOL);
|
||||
@@ -220,11 +220,11 @@ Dpack(wbuf, wp)
|
||||
static int
|
||||
Dword()
|
||||
{
|
||||
register int c, c1;
|
||||
int c, c1;
|
||||
Char wbuf[BUFSIZ];
|
||||
register Char *wp = wbuf;
|
||||
register int i = MAXWLEN;
|
||||
register bool dolflg;
|
||||
Char *wp = wbuf;
|
||||
int i = MAXWLEN;
|
||||
bool dolflg;
|
||||
bool sofar = 0, done = 0;
|
||||
|
||||
while (!done) {
|
||||
@@ -340,9 +340,9 @@ Dword()
|
||||
*/
|
||||
static int
|
||||
DgetC(flag)
|
||||
register int flag;
|
||||
int flag;
|
||||
{
|
||||
register int c;
|
||||
int c;
|
||||
|
||||
top:
|
||||
if ((c = Dpeekc) != '\0') {
|
||||
@@ -401,8 +401,8 @@ dolerror(s)
|
||||
static void
|
||||
Dgetdol()
|
||||
{
|
||||
register Char *np;
|
||||
register struct varent *vp = NULL;
|
||||
Char *np;
|
||||
struct varent *vp = NULL;
|
||||
Char name[4 * MAXVARLEN + 1];
|
||||
int c, sc;
|
||||
int subscr = 0, lwb = 1, upb = 0;
|
||||
@@ -574,7 +574,7 @@ Dgetdol()
|
||||
else if (*np != '-')
|
||||
stderror(ERR_MISSING, '-');
|
||||
else {
|
||||
register int i = upb;
|
||||
int i = upb;
|
||||
|
||||
np++;
|
||||
if (Isdigit(*np)) {
|
||||
@@ -632,7 +632,7 @@ eatbrac:
|
||||
static void
|
||||
fixDolMod()
|
||||
{
|
||||
register int c;
|
||||
int c;
|
||||
|
||||
c = DgetC(0);
|
||||
if (c == ':') {
|
||||
@@ -691,9 +691,9 @@ fixDolMod()
|
||||
|
||||
static void
|
||||
setDolp(cp)
|
||||
register Char *cp;
|
||||
Char *cp;
|
||||
{
|
||||
register Char *dp;
|
||||
Char *dp;
|
||||
int i;
|
||||
|
||||
if (dolnmod == 0 || dolmcnt == 0) {
|
||||
@@ -804,7 +804,7 @@ unDredc(c)
|
||||
static int
|
||||
Dredc()
|
||||
{
|
||||
register int c;
|
||||
int c;
|
||||
|
||||
if ((c = Dpeekrd) != '\0') {
|
||||
Dpeekrd = 0;
|
||||
@@ -822,7 +822,7 @@ Dredc()
|
||||
|
||||
static void
|
||||
Dtestq(c)
|
||||
register int c;
|
||||
int c;
|
||||
{
|
||||
|
||||
if (cmap(c, QUOTES))
|
||||
@@ -839,11 +839,11 @@ void
|
||||
heredoc(term)
|
||||
Char *term;
|
||||
{
|
||||
register int c;
|
||||
int c;
|
||||
Char *Dv[2];
|
||||
Char obuf[BUFSIZ], lbuf[BUFSIZ], mbuf[BUFSIZ];
|
||||
int ocnt, lcnt, mcnt;
|
||||
register Char *lbp, *obp, *mbp;
|
||||
Char *lbp, *obp, *mbp;
|
||||
Char **vp;
|
||||
bool quoted;
|
||||
char *tmp;
|
||||
|
||||
+2
-2
@@ -30,7 +30,7 @@
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id$
|
||||
* $Id: err.c,v 1.2 1994/09/24 02:53:57 davidg Exp $
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
@@ -342,7 +342,7 @@ stderror(id, va_alist)
|
||||
#endif
|
||||
{
|
||||
va_list va;
|
||||
register Char **v;
|
||||
Char **v;
|
||||
int flags = id & ERR_FLAGS;
|
||||
|
||||
id &= ~ERR_FLAGS;
|
||||
|
||||
+26
-26
@@ -30,7 +30,7 @@
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: exec.c,v 1.3 1995/05/30 00:06:32 rgrimes Exp $
|
||||
* $Id: exec.c,v 1.4 1995/06/18 14:20:16 ache Exp $
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
@@ -113,10 +113,10 @@ doexec(v, t)
|
||||
Char **v;
|
||||
struct command *t;
|
||||
{
|
||||
register Char *dp, **pv, **av, *sav;
|
||||
register struct varent *pathv;
|
||||
register bool slash;
|
||||
register int hashval = 0, hashval1, i;
|
||||
Char *dp, **pv, **av, *sav;
|
||||
struct varent *pathv;
|
||||
bool slash;
|
||||
int hashval = 0, hashval1, i;
|
||||
Char *blk[2];
|
||||
|
||||
/*
|
||||
@@ -265,12 +265,12 @@ pexerr()
|
||||
static void
|
||||
texec(sf, st)
|
||||
Char *sf;
|
||||
register Char **st;
|
||||
Char **st;
|
||||
{
|
||||
register char **t;
|
||||
register char *f;
|
||||
register struct varent *v;
|
||||
register Char **vp;
|
||||
char **t;
|
||||
char *f;
|
||||
struct varent *v;
|
||||
Char **vp;
|
||||
Char *lastsh[2];
|
||||
int fd;
|
||||
unsigned char c;
|
||||
@@ -361,7 +361,7 @@ texec(sf, st)
|
||||
void
|
||||
execash(t, kp)
|
||||
Char **t;
|
||||
register struct command *kp;
|
||||
struct command *kp;
|
||||
{
|
||||
int saveIN, saveOUT, saveDIAG, saveSTD;
|
||||
int oSHIN;
|
||||
@@ -446,8 +446,8 @@ dohash(v, t)
|
||||
struct command *t;
|
||||
{
|
||||
DIR *dirp;
|
||||
register struct dirent *dp;
|
||||
register int cnt;
|
||||
struct dirent *dp;
|
||||
int cnt;
|
||||
int i = 0;
|
||||
struct varent *pathv = adrof(STRpath);
|
||||
Char **pv;
|
||||
@@ -504,9 +504,9 @@ hashstat(v, t)
|
||||
*/
|
||||
static int
|
||||
hashname(cp)
|
||||
register Char *cp;
|
||||
Char *cp;
|
||||
{
|
||||
register long h = 0;
|
||||
long h = 0;
|
||||
|
||||
while (*cp)
|
||||
h = hash(h, *cp++);
|
||||
@@ -517,11 +517,11 @@ static int
|
||||
iscommand(name)
|
||||
Char *name;
|
||||
{
|
||||
register Char **pv;
|
||||
register Char *sav;
|
||||
register struct varent *v;
|
||||
register bool slash = any(short2str(name), '/');
|
||||
register int hashval = 0, hashval1, i;
|
||||
Char **pv;
|
||||
Char *sav;
|
||||
struct varent *v;
|
||||
bool slash = any(short2str(name), '/');
|
||||
int hashval = 0, hashval1, i;
|
||||
|
||||
v = adrof(STRpath);
|
||||
if (v == 0 || v->vec[0] == 0 || slash)
|
||||
@@ -618,7 +618,7 @@ executable(dir, name, dir_ok)
|
||||
/*ARGSUSED*/
|
||||
void
|
||||
dowhich(v, c)
|
||||
register Char **v;
|
||||
Char **v;
|
||||
struct command *c;
|
||||
{
|
||||
struct wordent lex[3];
|
||||
@@ -652,9 +652,9 @@ static void
|
||||
tellmewhat(lex)
|
||||
struct wordent *lex;
|
||||
{
|
||||
register int i;
|
||||
register struct biltins *bptr;
|
||||
register struct wordent *sp = lex->next;
|
||||
int i;
|
||||
struct biltins *bptr;
|
||||
struct wordent *sp = lex->next;
|
||||
bool aliased = 0;
|
||||
Char *s0, *s1, *s2, *cmd;
|
||||
Char qc;
|
||||
@@ -706,8 +706,8 @@ tellmewhat(lex)
|
||||
sp->word = cmd = globone(sp->word, G_IGNORE);
|
||||
|
||||
if ((i = iscommand(strip(sp->word))) != 0) {
|
||||
register Char **pv;
|
||||
register struct varent *v;
|
||||
Char **pv;
|
||||
struct varent *v;
|
||||
bool slash = any(short2str(sp->word), '/');
|
||||
|
||||
v = adrof(STRpath);
|
||||
|
||||
+45
-45
@@ -30,7 +30,7 @@
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id$
|
||||
* $Id: exp.c,v 1.2 1994/09/24 02:54:00 davidg Exp $
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
@@ -91,23 +91,23 @@ static void etraci __P((char *, int, Char ***));
|
||||
|
||||
int
|
||||
expr(vp)
|
||||
register Char ***vp;
|
||||
Char ***vp;
|
||||
{
|
||||
return (exp0(vp, 0));
|
||||
}
|
||||
|
||||
int
|
||||
exp0(vp, ignore)
|
||||
register Char ***vp;
|
||||
Char ***vp;
|
||||
bool ignore;
|
||||
{
|
||||
register int p1 = exp1(vp, ignore);
|
||||
int p1 = exp1(vp, ignore);
|
||||
|
||||
#ifdef EDEBUG
|
||||
etraci("exp0 p1", p1, vp);
|
||||
#endif
|
||||
if (**vp && eq(**vp, STRor2)) {
|
||||
register int p2;
|
||||
int p2;
|
||||
|
||||
(*vp)++;
|
||||
p2 = exp0(vp, (ignore & IGNORE) || p1);
|
||||
@@ -121,16 +121,16 @@ exp0(vp, ignore)
|
||||
|
||||
static int
|
||||
exp1(vp, ignore)
|
||||
register Char ***vp;
|
||||
Char ***vp;
|
||||
bool ignore;
|
||||
{
|
||||
register int p1 = exp2(vp, ignore);
|
||||
int p1 = exp2(vp, ignore);
|
||||
|
||||
#ifdef EDEBUG
|
||||
etraci("exp1 p1", p1, vp);
|
||||
#endif
|
||||
if (**vp && eq(**vp, STRand2)) {
|
||||
register int p2;
|
||||
int p2;
|
||||
|
||||
(*vp)++;
|
||||
p2 = exp1(vp, (ignore & IGNORE) || !p1);
|
||||
@@ -144,16 +144,16 @@ exp1(vp, ignore)
|
||||
|
||||
static int
|
||||
exp2(vp, ignore)
|
||||
register Char ***vp;
|
||||
Char ***vp;
|
||||
bool ignore;
|
||||
{
|
||||
register int p1 = exp2a(vp, ignore);
|
||||
int p1 = exp2a(vp, ignore);
|
||||
|
||||
#ifdef EDEBUG
|
||||
etraci("exp3 p1", p1, vp);
|
||||
#endif
|
||||
if (**vp && eq(**vp, STRor)) {
|
||||
register int p2;
|
||||
int p2;
|
||||
|
||||
(*vp)++;
|
||||
p2 = exp2(vp, ignore);
|
||||
@@ -167,16 +167,16 @@ exp2(vp, ignore)
|
||||
|
||||
static int
|
||||
exp2a(vp, ignore)
|
||||
register Char ***vp;
|
||||
Char ***vp;
|
||||
bool ignore;
|
||||
{
|
||||
register int p1 = exp2b(vp, ignore);
|
||||
int p1 = exp2b(vp, ignore);
|
||||
|
||||
#ifdef EDEBUG
|
||||
etraci("exp2a p1", p1, vp);
|
||||
#endif
|
||||
if (**vp && eq(**vp, STRcaret)) {
|
||||
register int p2;
|
||||
int p2;
|
||||
|
||||
(*vp)++;
|
||||
p2 = exp2a(vp, ignore);
|
||||
@@ -190,16 +190,16 @@ exp2a(vp, ignore)
|
||||
|
||||
static int
|
||||
exp2b(vp, ignore)
|
||||
register Char ***vp;
|
||||
Char ***vp;
|
||||
bool ignore;
|
||||
{
|
||||
register int p1 = exp2c(vp, ignore);
|
||||
int p1 = exp2c(vp, ignore);
|
||||
|
||||
#ifdef EDEBUG
|
||||
etraci("exp2b p1", p1, vp);
|
||||
#endif
|
||||
if (**vp && eq(**vp, STRand)) {
|
||||
register int p2;
|
||||
int p2;
|
||||
|
||||
(*vp)++;
|
||||
p2 = exp2b(vp, ignore);
|
||||
@@ -213,12 +213,12 @@ exp2b(vp, ignore)
|
||||
|
||||
static int
|
||||
exp2c(vp, ignore)
|
||||
register Char ***vp;
|
||||
Char ***vp;
|
||||
bool ignore;
|
||||
{
|
||||
register Char *p1 = exp3(vp, ignore);
|
||||
register Char *p2;
|
||||
register int i;
|
||||
Char *p1 = exp3(vp, ignore);
|
||||
Char *p2;
|
||||
int i;
|
||||
|
||||
#ifdef EDEBUG
|
||||
etracc("exp2c p1", p1, vp);
|
||||
@@ -261,11 +261,11 @@ exp2c(vp, ignore)
|
||||
|
||||
static Char *
|
||||
exp3(vp, ignore)
|
||||
register Char ***vp;
|
||||
Char ***vp;
|
||||
bool ignore;
|
||||
{
|
||||
register Char *p1, *p2;
|
||||
register int i;
|
||||
Char *p1, *p2;
|
||||
int i;
|
||||
|
||||
p1 = exp3a(vp, ignore);
|
||||
#ifdef EDEBUG
|
||||
@@ -307,11 +307,11 @@ exp3(vp, ignore)
|
||||
|
||||
static Char *
|
||||
exp3a(vp, ignore)
|
||||
register Char ***vp;
|
||||
Char ***vp;
|
||||
bool ignore;
|
||||
{
|
||||
register Char *p1, *p2, *op;
|
||||
register int i;
|
||||
Char *p1, *p2, *op;
|
||||
int i;
|
||||
|
||||
p1 = exp4(vp, ignore);
|
||||
#ifdef EDEBUG
|
||||
@@ -337,18 +337,18 @@ exp3a(vp, ignore)
|
||||
|
||||
static Char *
|
||||
exp4(vp, ignore)
|
||||
register Char ***vp;
|
||||
Char ***vp;
|
||||
bool ignore;
|
||||
{
|
||||
register Char *p1, *p2;
|
||||
register int i = 0;
|
||||
Char *p1, *p2;
|
||||
int i = 0;
|
||||
|
||||
p1 = exp5(vp, ignore);
|
||||
#ifdef EDEBUG
|
||||
etracc("exp4 p1", p1, vp);
|
||||
#endif
|
||||
if (isa(**vp, ADDOP)) {
|
||||
register Char *op = *(*vp)++;
|
||||
Char *op = *(*vp)++;
|
||||
|
||||
p2 = exp4(vp, ignore);
|
||||
#ifdef EDEBUG
|
||||
@@ -374,18 +374,18 @@ exp4(vp, ignore)
|
||||
|
||||
static Char *
|
||||
exp5(vp, ignore)
|
||||
register Char ***vp;
|
||||
Char ***vp;
|
||||
bool ignore;
|
||||
{
|
||||
register Char *p1, *p2;
|
||||
register int i = 0;
|
||||
Char *p1, *p2;
|
||||
int i = 0;
|
||||
|
||||
p1 = exp6(vp, ignore);
|
||||
#ifdef EDEBUG
|
||||
etracc("exp5 p1", p1, vp);
|
||||
#endif
|
||||
if (isa(**vp, MULOP)) {
|
||||
register Char *op = *(*vp)++;
|
||||
Char *op = *(*vp)++;
|
||||
|
||||
p2 = exp5(vp, ignore);
|
||||
#ifdef EDEBUG
|
||||
@@ -421,11 +421,11 @@ exp5(vp, ignore)
|
||||
|
||||
static Char *
|
||||
exp6(vp, ignore)
|
||||
register Char ***vp;
|
||||
Char ***vp;
|
||||
bool ignore;
|
||||
{
|
||||
int ccode, i = 0;
|
||||
register Char *cp, *dp, *ep;
|
||||
Char *cp, *dp, *ep;
|
||||
|
||||
if (**vp == 0)
|
||||
stderror(ERR_NAME | ERR_EXPRESSION);
|
||||
@@ -461,7 +461,7 @@ exp6(vp, ignore)
|
||||
return (putn(ccode));
|
||||
}
|
||||
if (eq(**vp, STRLbrace)) {
|
||||
register Char **v;
|
||||
Char **v;
|
||||
struct command faket;
|
||||
Char *fakecom[2];
|
||||
|
||||
@@ -600,18 +600,18 @@ exp6(vp, ignore)
|
||||
|
||||
static void
|
||||
evalav(v)
|
||||
register Char **v;
|
||||
Char **v;
|
||||
{
|
||||
struct wordent paraml1;
|
||||
register struct wordent *hp = ¶ml1;
|
||||
struct wordent *hp = ¶ml1;
|
||||
struct command *t;
|
||||
register struct wordent *wdp = hp;
|
||||
struct wordent *wdp = hp;
|
||||
|
||||
set(STRstatus, Strsave(STR0));
|
||||
hp->prev = hp->next = hp;
|
||||
hp->word = STRNULL;
|
||||
while (*v) {
|
||||
register struct wordent *new =
|
||||
struct wordent *new =
|
||||
(struct wordent *) xcalloc(1, sizeof *wdp);
|
||||
|
||||
new->prev = wdp;
|
||||
@@ -631,8 +631,8 @@ evalav(v)
|
||||
|
||||
static int
|
||||
isa(cp, what)
|
||||
register Char *cp;
|
||||
register int what;
|
||||
Char *cp;
|
||||
int what;
|
||||
{
|
||||
if (cp == 0)
|
||||
return ((what & RESTOP) != 0);
|
||||
@@ -680,7 +680,7 @@ isa(cp, what)
|
||||
|
||||
static int
|
||||
egetn(cp)
|
||||
register Char *cp;
|
||||
Char *cp;
|
||||
{
|
||||
if (*cp && *cp != '-' && !Isdigit(*cp))
|
||||
stderror(ERR_NAME | ERR_EXPRESSION);
|
||||
|
||||
+2
-2
@@ -31,7 +31,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)extern.h 8.1 (Berkeley) 5/31/93
|
||||
* $Id$
|
||||
* $Id: extern.h,v 1.2 1994/09/24 02:54:02 davidg Exp $
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
@@ -161,7 +161,7 @@ Char *globone __P((Char *, int));
|
||||
int Gmatch __P((Char *, Char *));
|
||||
void ginit __P((void));
|
||||
Char **globall __P((Char **));
|
||||
void rscan __P((Char **, void (*)()));
|
||||
void rscan __P((Char **, void (*)(int)));
|
||||
void tglob __P((Char **));
|
||||
void trim __P((Char **));
|
||||
#ifdef FILEC
|
||||
|
||||
+27
-27
@@ -30,7 +30,7 @@
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: file.c,v 1.3 1995/05/30 00:06:33 rgrimes Exp $
|
||||
* $Id: file.c,v 1.4 1995/06/18 14:08:44 ache Exp $
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
@@ -160,7 +160,7 @@ static void
|
||||
pushback(string)
|
||||
Char *string;
|
||||
{
|
||||
register Char *p;
|
||||
Char *p;
|
||||
struct termios tty, tty_normal;
|
||||
int omask;
|
||||
char c;
|
||||
@@ -184,8 +184,8 @@ pushback(string)
|
||||
*/
|
||||
static void
|
||||
catn(des, src, count)
|
||||
register Char *des, *src;
|
||||
register int count;
|
||||
Char *des, *src;
|
||||
int count;
|
||||
{
|
||||
while (--count >= 0 && *des)
|
||||
des++;
|
||||
@@ -201,8 +201,8 @@ catn(des, src, count)
|
||||
*/
|
||||
static void
|
||||
copyn(des, src, count)
|
||||
register Char *des, *src;
|
||||
register int count;
|
||||
Char *des, *src;
|
||||
int count;
|
||||
{
|
||||
while (--count >= 0)
|
||||
if ((*des++ = *src++) == 0)
|
||||
@@ -251,7 +251,7 @@ print_by_column(dir, items, count)
|
||||
Char *dir, *items[];
|
||||
int count;
|
||||
{
|
||||
register int i, rows, r, c, maxwidth = 0, columns;
|
||||
int i, rows, r, c, maxwidth = 0, columns;
|
||||
|
||||
if (ioctl(SHOUT, TIOCGWINSZ, (ioctl_t) & win) < 0 || win.ws_col == 0)
|
||||
win.ws_col = 80;
|
||||
@@ -266,7 +266,7 @@ print_by_column(dir, items, count)
|
||||
for (c = 0; c < columns; c++) {
|
||||
i = c * rows + r;
|
||||
if (i < count) {
|
||||
register int w;
|
||||
int w;
|
||||
|
||||
(void) fprintf(cshout, "%s", vis_str(items[i]));
|
||||
(void) fputc(dir ? filetype(dir, items[i]) : ' ', cshout);
|
||||
@@ -292,8 +292,8 @@ static Char *
|
||||
tilde(new, old)
|
||||
Char *new, *old;
|
||||
{
|
||||
register Char *o, *p;
|
||||
register struct passwd *pw;
|
||||
Char *o, *p;
|
||||
struct passwd *pw;
|
||||
static Char person[40];
|
||||
|
||||
if (old[0] != '~')
|
||||
@@ -375,7 +375,7 @@ static void
|
||||
extract_dir_and_name(path, dir, name)
|
||||
Char *path, *dir, *name;
|
||||
{
|
||||
register Char *p;
|
||||
Char *p;
|
||||
|
||||
p = Strrchr(path, '/');
|
||||
if (p == NULL) {
|
||||
@@ -393,8 +393,8 @@ getentry(dir_fd, looking_for_lognames)
|
||||
DIR *dir_fd;
|
||||
int looking_for_lognames;
|
||||
{
|
||||
register struct passwd *pw;
|
||||
register struct dirent *dirp;
|
||||
struct passwd *pw;
|
||||
struct dirent *dirp;
|
||||
|
||||
if (looking_for_lognames) {
|
||||
if ((pw = getpwent()) == NULL)
|
||||
@@ -408,9 +408,9 @@ getentry(dir_fd, looking_for_lognames)
|
||||
|
||||
static void
|
||||
free_items(items)
|
||||
register Char **items;
|
||||
Char **items;
|
||||
{
|
||||
register int i;
|
||||
int i;
|
||||
|
||||
for (i = 0; items[i]; i++)
|
||||
xfree((ptr_t) items[i]);
|
||||
@@ -436,9 +436,9 @@ tsearch(word, command, max_word_length)
|
||||
int max_word_length;
|
||||
{
|
||||
static Char **items = NULL;
|
||||
register DIR *dir_fd;
|
||||
register numitems = 0, ignoring = TRUE, nignored = 0;
|
||||
register name_length, looking_for_lognames;
|
||||
DIR *dir_fd;
|
||||
int numitems = 0, ignoring = TRUE, nignored = 0;
|
||||
int name_length, looking_for_lognames;
|
||||
Char tilded_dir[MAXPATHLEN + 1], dir[MAXPATHLEN + 1];
|
||||
Char name[MAXNAMLEN + 1], extended_name[MAXNAMLEN + 1];
|
||||
Char *entry;
|
||||
@@ -547,8 +547,8 @@ recognize(extended_name, entry, name_length, numitems)
|
||||
if (numitems == 1) /* 1st match */
|
||||
copyn(extended_name, entry, MAXNAMLEN);
|
||||
else { /* 2nd & subsequent matches */
|
||||
register Char *x, *ent;
|
||||
register int len = 0;
|
||||
Char *x, *ent;
|
||||
int len = 0;
|
||||
|
||||
x = extended_name;
|
||||
for (ent = entry; *x && *x == *ent++; x++, len++)
|
||||
@@ -567,7 +567,7 @@ recognize(extended_name, entry, name_length, numitems)
|
||||
*/
|
||||
static int
|
||||
is_prefix(check, template)
|
||||
register Char *check, *template;
|
||||
Char *check, *template;
|
||||
{
|
||||
do
|
||||
if (*check == 0)
|
||||
@@ -584,7 +584,7 @@ static int
|
||||
is_suffix(check, template)
|
||||
Char *check, *template;
|
||||
{
|
||||
register Char *c, *t;
|
||||
Char *c, *t;
|
||||
|
||||
for (c = check; *c++;)
|
||||
continue;
|
||||
@@ -603,7 +603,7 @@ tenex(inputline, inputline_size)
|
||||
Char *inputline;
|
||||
int inputline_size;
|
||||
{
|
||||
register int numitems, num_read;
|
||||
int numitems, num_read;
|
||||
char tinputline[BUFSIZ];
|
||||
|
||||
|
||||
@@ -613,8 +613,8 @@ tenex(inputline, inputline_size)
|
||||
int i;
|
||||
static Char delims[] = {' ', '\'', '"', '\t', ';', '&', '<',
|
||||
'>', '(', ')', '|', '^', '%', '\0'};
|
||||
register Char *str_end, *word_start, last_Char, should_retype;
|
||||
register int space_left;
|
||||
Char *str_end, *word_start, last_Char, should_retype;
|
||||
int space_left;
|
||||
COMMAND command;
|
||||
|
||||
for (i = 0; i < num_read; i++)
|
||||
@@ -671,10 +671,10 @@ tenex(inputline, inputline_size)
|
||||
|
||||
static int
|
||||
ignored(entry)
|
||||
register Char *entry;
|
||||
Char *entry;
|
||||
{
|
||||
struct varent *vp;
|
||||
register Char **cp;
|
||||
Char **cp;
|
||||
|
||||
if ((vp = adrof(STRfignore)) == NULL || (cp = vp->vec) == NULL)
|
||||
return (FALSE);
|
||||
|
||||
+51
-52
@@ -30,7 +30,7 @@
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: func.c,v 1.4 1995/10/23 23:08:26 ache Exp $
|
||||
* $Id: func.c,v 1.5 1996/08/11 23:10:38 ache Exp $
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
@@ -72,8 +72,8 @@ struct biltins *
|
||||
isbfunc(t)
|
||||
struct command *t;
|
||||
{
|
||||
register Char *cp = t->t_dcom[0];
|
||||
register struct biltins *bp, *bp1, *bp2;
|
||||
Char *cp = t->t_dcom[0];
|
||||
struct biltins *bp, *bp1, *bp2;
|
||||
static struct biltins label = {"", dozip, 0, 0};
|
||||
static struct biltins foregnd = {"%job", dofg1, 0, 0};
|
||||
static struct biltins backgnd = {"%job &", dobg1, 0, 0};
|
||||
@@ -96,7 +96,7 @@ isbfunc(t)
|
||||
* one past the end.
|
||||
*/
|
||||
for (bp1 = bfunc, bp2 = bfunc + nbfunc; bp1 < bp2;) {
|
||||
register i;
|
||||
int i;
|
||||
|
||||
bp = bp1 + ((bp2 - bp1) >> 1);
|
||||
if ((i = *cp - *bp->bname) == 0 &&
|
||||
@@ -112,8 +112,8 @@ isbfunc(t)
|
||||
|
||||
void
|
||||
func(t, bp)
|
||||
register struct command *t;
|
||||
register struct biltins *bp;
|
||||
struct command *t;
|
||||
struct biltins *bp;
|
||||
{
|
||||
int i;
|
||||
|
||||
@@ -133,8 +133,8 @@ doonintr(v, t)
|
||||
Char **v;
|
||||
struct command *t;
|
||||
{
|
||||
register Char *cp;
|
||||
register Char *vv = v[1];
|
||||
Char *cp;
|
||||
Char *vv = v[1];
|
||||
|
||||
if (parintr == SIG_IGN)
|
||||
return;
|
||||
@@ -194,8 +194,8 @@ doalias(v, t)
|
||||
Char **v;
|
||||
struct command *t;
|
||||
{
|
||||
register struct varent *vp;
|
||||
register Char *p;
|
||||
struct varent *vp;
|
||||
Char *p;
|
||||
|
||||
v++;
|
||||
p = *v++;
|
||||
@@ -265,8 +265,8 @@ doif(v, kp)
|
||||
Char **v;
|
||||
struct command *kp;
|
||||
{
|
||||
register int i;
|
||||
register Char **vv;
|
||||
int i;
|
||||
Char **vv;
|
||||
|
||||
v++;
|
||||
i = expr(&v);
|
||||
@@ -302,7 +302,7 @@ doif(v, kp)
|
||||
*/
|
||||
static void
|
||||
reexecute(kp)
|
||||
register struct command *kp;
|
||||
struct command *kp;
|
||||
{
|
||||
kp->t_dflg &= F_SAVE;
|
||||
kp->t_dflg |= F_REPEAT;
|
||||
@@ -339,7 +339,7 @@ void
|
||||
gotolab(lab)
|
||||
Char *lab;
|
||||
{
|
||||
register struct whyle *wp;
|
||||
struct whyle *wp;
|
||||
/*
|
||||
* While we still can, locate any unknown ends of existing loops. This
|
||||
* obscure code is the WORST result of the fact that we don't really parse.
|
||||
@@ -365,7 +365,7 @@ doswitch(v, t)
|
||||
Char **v;
|
||||
struct command *t;
|
||||
{
|
||||
register Char *cp, *lp;
|
||||
Char *cp, *lp;
|
||||
|
||||
v++;
|
||||
if (!*v || *(*v++) != '(')
|
||||
@@ -419,8 +419,8 @@ doforeach(v, t)
|
||||
Char **v;
|
||||
struct command *t;
|
||||
{
|
||||
register Char *cp, *sp;
|
||||
register struct whyle *nwp;
|
||||
Char *cp, *sp;
|
||||
struct whyle *nwp;
|
||||
|
||||
v++;
|
||||
sp = cp = strip(*v);
|
||||
@@ -463,8 +463,8 @@ dowhile(v, t)
|
||||
Char **v;
|
||||
struct command *t;
|
||||
{
|
||||
register int status;
|
||||
register bool again = whyles != 0 && SEEKEQ(&whyles->w_start, &lineloc) &&
|
||||
int status;
|
||||
bool again = whyles != 0 && SEEKEQ(&whyles->w_start, &lineloc) &&
|
||||
whyles->w_fename == 0;
|
||||
|
||||
v++;
|
||||
@@ -479,7 +479,7 @@ dowhile(v, t)
|
||||
if (*v)
|
||||
stderror(ERR_NAME | ERR_EXPRESSION);
|
||||
if (!again) {
|
||||
register struct whyle *nwp =
|
||||
struct whyle *nwp =
|
||||
(struct whyle *) xcalloc(1, sizeof(*nwp));
|
||||
|
||||
nwp->w_start = lineloc;
|
||||
@@ -564,8 +564,8 @@ dorepeat(v, kp)
|
||||
Char **v;
|
||||
struct command *kp;
|
||||
{
|
||||
register int i;
|
||||
register sigset_t omask = 0;
|
||||
int i;
|
||||
sigset_t omask = 0;
|
||||
|
||||
i = getn(v[1]);
|
||||
if (setintr)
|
||||
@@ -593,10 +593,10 @@ doswbrk(v, t)
|
||||
|
||||
int
|
||||
srchx(cp)
|
||||
register Char *cp;
|
||||
Char *cp;
|
||||
{
|
||||
register struct srch *sp, *sp1, *sp2;
|
||||
register i;
|
||||
struct srch *sp, *sp1, *sp2;
|
||||
int i;
|
||||
|
||||
/*
|
||||
* Binary search Sp1 is the beginning of the current search range. Sp2 is
|
||||
@@ -622,12 +622,12 @@ static Char *Sgoal;
|
||||
static void
|
||||
search(type, level, goal)
|
||||
int type;
|
||||
register int level;
|
||||
int level;
|
||||
Char *goal;
|
||||
{
|
||||
Char wordbuf[BUFSIZ];
|
||||
register Char *aword = wordbuf;
|
||||
register Char *cp;
|
||||
Char *aword = wordbuf;
|
||||
Char *cp;
|
||||
|
||||
Stype = type;
|
||||
Sgoal = goal;
|
||||
@@ -722,10 +722,10 @@ search(type, level, goal)
|
||||
|
||||
static int
|
||||
getword(wp)
|
||||
register Char *wp;
|
||||
Char *wp;
|
||||
{
|
||||
register int found = 0;
|
||||
register int c, d;
|
||||
int found = 0;
|
||||
int c, d;
|
||||
int kwd = 0;
|
||||
Char *owp = wp;
|
||||
|
||||
@@ -851,7 +851,7 @@ wfree()
|
||||
btell(&o);
|
||||
|
||||
for (; whyles; whyles = nwp) {
|
||||
register struct whyle *wp = whyles;
|
||||
struct whyle *wp = whyles;
|
||||
nwp = wp->w_next;
|
||||
|
||||
/*
|
||||
@@ -901,9 +901,9 @@ doglob(v, t)
|
||||
static void
|
||||
xecho(sep, v)
|
||||
int sep;
|
||||
register Char **v;
|
||||
Char **v;
|
||||
{
|
||||
register Char *cp;
|
||||
Char *cp;
|
||||
int nonl = 0;
|
||||
|
||||
if (setintr)
|
||||
@@ -924,7 +924,7 @@ xecho(sep, v)
|
||||
if (sep == ' ' && *v && eq(*v, STRmn))
|
||||
nonl++, v++;
|
||||
while ((cp = *v++) != NULL) {
|
||||
register int c;
|
||||
int c;
|
||||
|
||||
while ((c = *cp++) != '\0')
|
||||
(void) vis_fputc(c | QUOTE, cshout);
|
||||
@@ -952,7 +952,7 @@ dosetenv(v, t)
|
||||
|
||||
v++;
|
||||
if ((vp = *v++) == 0) {
|
||||
register Char **ep;
|
||||
Char **ep;
|
||||
|
||||
if (setintr)
|
||||
(void) sigsetmask(sigblock((sigset_t) 0) & ~sigmask(SIGINT));
|
||||
@@ -1045,8 +1045,8 @@ void
|
||||
Setenv(name, val)
|
||||
Char *name, *val;
|
||||
{
|
||||
register Char **ep = STR_environ;
|
||||
register Char *cp, *dp;
|
||||
Char **ep = STR_environ;
|
||||
Char *cp, *dp;
|
||||
Char *blk[2];
|
||||
Char **oep = ep;
|
||||
|
||||
@@ -1078,8 +1078,8 @@ static void
|
||||
Unsetenv(name)
|
||||
Char *name;
|
||||
{
|
||||
register Char **ep = STR_environ;
|
||||
register Char *cp, *dp;
|
||||
Char **ep = STR_environ;
|
||||
Char *cp, *dp;
|
||||
Char **oep = ep;
|
||||
|
||||
for (; *ep; ep++) {
|
||||
@@ -1104,8 +1104,8 @@ doumask(v, t)
|
||||
Char **v;
|
||||
struct command *t;
|
||||
{
|
||||
register Char *cp = v[1];
|
||||
register int i;
|
||||
Char *cp = v[1];
|
||||
int i;
|
||||
|
||||
if (cp == 0) {
|
||||
i = umask(0);
|
||||
@@ -1151,7 +1151,7 @@ static struct limits *
|
||||
findlim(cp)
|
||||
Char *cp;
|
||||
{
|
||||
register struct limits *lp, *res;
|
||||
struct limits *lp, *res;
|
||||
|
||||
res = (struct limits *) NULL;
|
||||
for (lp = limits; lp->limconst >= 0; lp++)
|
||||
@@ -1173,8 +1173,8 @@ dolimit(v, t)
|
||||
Char **v;
|
||||
struct command *t;
|
||||
{
|
||||
register struct limits *lp;
|
||||
register RLIM_TYPE limit;
|
||||
struct limits *lp;
|
||||
RLIM_TYPE limit;
|
||||
char hard = 0;
|
||||
|
||||
v++;
|
||||
@@ -1199,11 +1199,10 @@ dolimit(v, t)
|
||||
|
||||
static RLIM_TYPE
|
||||
getval(lp, v)
|
||||
register struct limits *lp;
|
||||
struct limits *lp;
|
||||
Char **v;
|
||||
{
|
||||
register float f;
|
||||
double atof();
|
||||
float f;
|
||||
Char *cp = *v++;
|
||||
|
||||
f = atof(short2str(cp));
|
||||
@@ -1283,7 +1282,7 @@ limtail(cp, str)
|
||||
/*ARGSUSED*/
|
||||
static void
|
||||
plim(lp, hard)
|
||||
register struct limits *lp;
|
||||
struct limits *lp;
|
||||
Char hard;
|
||||
{
|
||||
struct rlimit rlim;
|
||||
@@ -1310,7 +1309,7 @@ dounlimit(v, t)
|
||||
Char **v;
|
||||
struct command *t;
|
||||
{
|
||||
register struct limits *lp;
|
||||
struct limits *lp;
|
||||
int lerr = 0;
|
||||
Char hard = 0;
|
||||
|
||||
@@ -1336,7 +1335,7 @@ dounlimit(v, t)
|
||||
|
||||
static int
|
||||
setlim(lp, hard, limit)
|
||||
register struct limits *lp;
|
||||
struct limits *lp;
|
||||
Char hard;
|
||||
RLIM_TYPE limit;
|
||||
{
|
||||
@@ -1368,7 +1367,7 @@ dosuspend(v, t)
|
||||
{
|
||||
int ctpgrp;
|
||||
|
||||
void (*old) ();
|
||||
void (*old) __P((int));
|
||||
|
||||
if (loginsh)
|
||||
stderror(ERR_SUSPLOG);
|
||||
|
||||
+15
-15
@@ -30,7 +30,7 @@
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: glob.c,v 1.5 1996/08/12 21:32:15 ache Exp $
|
||||
* $Id: glob.c,v 1.6 1996/10/31 07:22:48 ache Exp $
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
@@ -553,10 +553,10 @@ ginit()
|
||||
|
||||
void
|
||||
rscan(t, f)
|
||||
register Char **t;
|
||||
void (*f) ();
|
||||
Char **t;
|
||||
void (*f) __P((int));
|
||||
{
|
||||
register Char *p;
|
||||
Char *p;
|
||||
|
||||
while ((p = *t++) != NULL)
|
||||
while (*p)
|
||||
@@ -565,9 +565,9 @@ rscan(t, f)
|
||||
|
||||
void
|
||||
trim(t)
|
||||
register Char **t;
|
||||
Char **t;
|
||||
{
|
||||
register Char *p;
|
||||
Char *p;
|
||||
|
||||
while ((p = *t++) != NULL)
|
||||
while (*p)
|
||||
@@ -576,9 +576,9 @@ trim(t)
|
||||
|
||||
void
|
||||
tglob(t)
|
||||
register Char **t;
|
||||
Char **t;
|
||||
{
|
||||
register Char *p, c;
|
||||
Char *p, c;
|
||||
|
||||
while ((p = *t++) != NULL) {
|
||||
if (*p == '~' || *p == '=')
|
||||
@@ -622,7 +622,7 @@ dobackp(cp, literal)
|
||||
Char *cp;
|
||||
bool literal;
|
||||
{
|
||||
register Char *lp, *rp;
|
||||
Char *lp, *rp;
|
||||
Char *ep, word[MAXPATHLEN];
|
||||
|
||||
if (pargv) {
|
||||
@@ -667,8 +667,8 @@ backeval(cp, literal)
|
||||
Char *cp;
|
||||
bool literal;
|
||||
{
|
||||
register int icnt, c;
|
||||
register Char *ip;
|
||||
int icnt, c;
|
||||
Char *ip;
|
||||
struct command faket;
|
||||
bool hadnl;
|
||||
int pvec[2], quoted;
|
||||
@@ -851,9 +851,9 @@ Gmatch(string, pattern)
|
||||
|
||||
static int
|
||||
pmatch(string, pattern)
|
||||
register Char *string, *pattern;
|
||||
Char *string, *pattern;
|
||||
{
|
||||
register Char stringc, patternc;
|
||||
Char stringc, patternc;
|
||||
int match, negate_range;
|
||||
Char rangec;
|
||||
|
||||
@@ -910,7 +910,7 @@ void
|
||||
Gcat(s1, s2)
|
||||
Char *s1, *s2;
|
||||
{
|
||||
register Char *p, *q;
|
||||
Char *p, *q;
|
||||
int n;
|
||||
|
||||
for (p = s1; *p++;)
|
||||
@@ -934,7 +934,7 @@ Gcat(s1, s2)
|
||||
#ifdef FILEC
|
||||
int
|
||||
sortscmp(a, b)
|
||||
register const ptr_t a, b;
|
||||
const ptr_t a, b;
|
||||
{
|
||||
#if defined(NLS) && !defined(NOSTRCOLL)
|
||||
char buf[2048];
|
||||
|
||||
+8
-8
@@ -30,7 +30,7 @@
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id$
|
||||
* $Id: hist.c,v 1.2 1994/09/24 02:54:06 davidg Exp $
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
@@ -56,8 +56,8 @@ void
|
||||
savehist(sp)
|
||||
struct wordent *sp;
|
||||
{
|
||||
register struct Hist *hp, *np;
|
||||
register int histlen = 0;
|
||||
struct Hist *hp, *np;
|
||||
int histlen = 0;
|
||||
Char *cp;
|
||||
|
||||
/* throw away null lines */
|
||||
@@ -65,7 +65,7 @@ savehist(sp)
|
||||
return;
|
||||
cp = value(STRhistory);
|
||||
if (*cp) {
|
||||
register Char *p = cp;
|
||||
Char *p = cp;
|
||||
|
||||
while (*p) {
|
||||
if (!Isdigit(*p)) {
|
||||
@@ -86,10 +86,10 @@ savehist(sp)
|
||||
struct Hist *
|
||||
enthist(event, lp, docopy)
|
||||
int event;
|
||||
register struct wordent *lp;
|
||||
struct wordent *lp;
|
||||
bool docopy;
|
||||
{
|
||||
register struct Hist *np;
|
||||
struct Hist *np;
|
||||
|
||||
np = (struct Hist *) xmalloc((size_t) sizeof(*np));
|
||||
np->Hnum = np->Href = event;
|
||||
@@ -109,7 +109,7 @@ enthist(event, lp, docopy)
|
||||
|
||||
static void
|
||||
hfree(hp)
|
||||
register struct Hist *hp;
|
||||
struct Hist *hp;
|
||||
{
|
||||
|
||||
freelex(&hp->Hlex);
|
||||
@@ -177,7 +177,7 @@ dohist1(hp, np, rflg, hflg)
|
||||
|
||||
static void
|
||||
phist(hp, hflg)
|
||||
register struct Hist *hp;
|
||||
struct Hist *hp;
|
||||
int hflg;
|
||||
{
|
||||
if (hflg == 0)
|
||||
|
||||
+47
-47
@@ -30,7 +30,7 @@
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: lex.c,v 1.3 1995/05/30 00:06:35 rgrimes Exp $
|
||||
* $Id: lex.c,v 1.4 1995/08/10 05:13:42 ache Exp $
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
@@ -142,9 +142,9 @@ static Char getCtmp;
|
||||
|
||||
int
|
||||
lex(hp)
|
||||
register struct wordent *hp;
|
||||
struct wordent *hp;
|
||||
{
|
||||
register struct wordent *wdp;
|
||||
struct wordent *wdp;
|
||||
int c;
|
||||
|
||||
btell(&lineloc);
|
||||
@@ -165,7 +165,7 @@ lex(hp)
|
||||
* be ready and rarin to go even if it is interrupted.
|
||||
*/
|
||||
do {
|
||||
register struct wordent *new;
|
||||
struct wordent *new;
|
||||
|
||||
new = (struct wordent *) xmalloc((size_t) sizeof(*wdp));
|
||||
new->word = 0;
|
||||
@@ -184,7 +184,7 @@ prlex(fp, sp0)
|
||||
FILE *fp;
|
||||
struct wordent *sp0;
|
||||
{
|
||||
register struct wordent *sp = sp0->next;
|
||||
struct wordent *sp = sp0->next;
|
||||
|
||||
for (;;) {
|
||||
(void) fprintf(fp, "%s", vis_str(sp->word));
|
||||
@@ -198,15 +198,15 @@ prlex(fp, sp0)
|
||||
|
||||
void
|
||||
copylex(hp, fp)
|
||||
register struct wordent *hp;
|
||||
register struct wordent *fp;
|
||||
struct wordent *hp;
|
||||
struct wordent *fp;
|
||||
{
|
||||
register struct wordent *wdp;
|
||||
struct wordent *wdp;
|
||||
|
||||
wdp = hp;
|
||||
fp = fp->next;
|
||||
do {
|
||||
register struct wordent *new;
|
||||
struct wordent *new;
|
||||
|
||||
new = (struct wordent *) xmalloc((size_t) sizeof(*wdp));
|
||||
new->prev = wdp;
|
||||
@@ -221,9 +221,9 @@ copylex(hp, fp)
|
||||
|
||||
void
|
||||
freelex(vp)
|
||||
register struct wordent *vp;
|
||||
struct wordent *vp;
|
||||
{
|
||||
register struct wordent *fp;
|
||||
struct wordent *fp;
|
||||
|
||||
while (vp->next != vp) {
|
||||
fp = vp->next;
|
||||
@@ -237,11 +237,11 @@ freelex(vp)
|
||||
static Char *
|
||||
word()
|
||||
{
|
||||
register Char c, c1;
|
||||
register Char *wp;
|
||||
Char c, c1;
|
||||
Char *wp;
|
||||
Char wbuf[BUFSIZ];
|
||||
register bool dolflg;
|
||||
register int i;
|
||||
bool dolflg;
|
||||
int i;
|
||||
|
||||
wp = wbuf;
|
||||
i = BUFSIZ - 4;
|
||||
@@ -358,9 +358,9 @@ ret:
|
||||
|
||||
static int
|
||||
getC1(flag)
|
||||
register int flag;
|
||||
int flag;
|
||||
{
|
||||
register Char c;
|
||||
Char c;
|
||||
|
||||
while (1) {
|
||||
if ((c = peekc) != '\0') {
|
||||
@@ -416,9 +416,9 @@ getC1(flag)
|
||||
static void
|
||||
getdol()
|
||||
{
|
||||
register Char *np, *ep;
|
||||
Char *np, *ep;
|
||||
Char name[4 * MAXVARLEN + 1];
|
||||
register int c;
|
||||
int c;
|
||||
int sc;
|
||||
bool special = 0, toolong;
|
||||
|
||||
@@ -650,9 +650,9 @@ static void
|
||||
getexcl(sc)
|
||||
int sc;
|
||||
{
|
||||
register struct wordent *hp, *ip;
|
||||
struct wordent *hp, *ip;
|
||||
int left, right, dol;
|
||||
register int c;
|
||||
int c;
|
||||
|
||||
if (sc == 0) {
|
||||
sc = getC(0);
|
||||
@@ -727,9 +727,9 @@ static struct wordent *
|
||||
getsub(en)
|
||||
struct wordent *en;
|
||||
{
|
||||
register Char *cp;
|
||||
Char *cp;
|
||||
int delim;
|
||||
register int c;
|
||||
int c;
|
||||
int sc;
|
||||
bool global;
|
||||
Char orhsb[sizeof(rhsb) / sizeof(Char)];
|
||||
@@ -872,12 +872,12 @@ dosub(sc, en, global)
|
||||
struct wordent lexi;
|
||||
bool didsub = 0, didone = 0;
|
||||
struct wordent *hp = &lexi;
|
||||
register struct wordent *wdp;
|
||||
register int i = exclc;
|
||||
struct wordent *wdp;
|
||||
int i = exclc;
|
||||
|
||||
wdp = hp;
|
||||
while (--i >= 0) {
|
||||
register struct wordent *new =
|
||||
struct wordent *new =
|
||||
(struct wordent *) xcalloc(1, sizeof *wdp);
|
||||
|
||||
new->word = 0;
|
||||
@@ -924,8 +924,8 @@ subword(cp, type, adid)
|
||||
bool *adid;
|
||||
{
|
||||
Char wbuf[BUFSIZ];
|
||||
register Char *wp, *mp, *np;
|
||||
register int i;
|
||||
Char *wp, *mp, *np;
|
||||
int i;
|
||||
|
||||
*adid = 0;
|
||||
switch (type) {
|
||||
@@ -996,8 +996,8 @@ domod(cp, type)
|
||||
Char *cp;
|
||||
int type;
|
||||
{
|
||||
register Char *wp, *xp;
|
||||
register int c;
|
||||
Char *wp, *xp;
|
||||
int c;
|
||||
|
||||
switch (type) {
|
||||
|
||||
@@ -1042,7 +1042,7 @@ domod(cp, type)
|
||||
|
||||
static int
|
||||
matchs(str, pat)
|
||||
register Char *str, *pat;
|
||||
Char *str, *pat;
|
||||
{
|
||||
while (*str && *pat && *str == *pat)
|
||||
str++, pat++;
|
||||
@@ -1051,11 +1051,11 @@ matchs(str, pat)
|
||||
|
||||
static int
|
||||
getsel(al, ar, dol)
|
||||
register int *al, *ar;
|
||||
int *al, *ar;
|
||||
int dol;
|
||||
{
|
||||
register int c = getC(0);
|
||||
register int i;
|
||||
int c = getC(0);
|
||||
int i;
|
||||
bool first = *al < 0;
|
||||
|
||||
switch (c) {
|
||||
@@ -1139,9 +1139,9 @@ static struct wordent *
|
||||
gethent(sc)
|
||||
int sc;
|
||||
{
|
||||
register struct Hist *hp;
|
||||
register Char *np;
|
||||
register int c;
|
||||
struct Hist *hp;
|
||||
Char *np;
|
||||
int c;
|
||||
int event;
|
||||
bool back = 0;
|
||||
|
||||
@@ -1258,12 +1258,12 @@ findev(cp, anyarg)
|
||||
Char *cp;
|
||||
bool anyarg;
|
||||
{
|
||||
register struct Hist *hp;
|
||||
struct Hist *hp;
|
||||
|
||||
for (hp = Histlist.Hnext; hp; hp = hp->Hnext) {
|
||||
Char *dp;
|
||||
register Char *p, *q;
|
||||
register struct wordent *lp = hp->Hlex.next;
|
||||
Char *p, *q;
|
||||
struct wordent *lp = hp->Hlex.next;
|
||||
int argno = 0;
|
||||
|
||||
/*
|
||||
@@ -1307,7 +1307,7 @@ findev(cp, anyarg)
|
||||
|
||||
static void
|
||||
setexclp(cp)
|
||||
register Char *cp;
|
||||
Char *cp;
|
||||
{
|
||||
if (cp && cp[0] == '\n')
|
||||
return;
|
||||
@@ -1325,7 +1325,7 @@ int
|
||||
readc(wanteof)
|
||||
bool wanteof;
|
||||
{
|
||||
register int c;
|
||||
int c;
|
||||
static sincereal;
|
||||
|
||||
aret = F_SEEK;
|
||||
@@ -1440,10 +1440,10 @@ reread:
|
||||
static int
|
||||
bgetc()
|
||||
{
|
||||
register int buf, off, c;
|
||||
int buf, off, c;
|
||||
|
||||
#ifdef FILEC
|
||||
register int numleft = 0, roomleft;
|
||||
int numleft = 0, roomleft;
|
||||
Char ttyline[BUFSIZ];
|
||||
#endif
|
||||
char tbuf[BUFSIZ + 1];
|
||||
@@ -1474,7 +1474,7 @@ bgetc()
|
||||
again:
|
||||
buf = (int) fseekp / BUFSIZ;
|
||||
if (buf >= fblocks) {
|
||||
register Char **nfbuf =
|
||||
Char **nfbuf =
|
||||
(Char **) xcalloc((size_t) (fblocks + 2),
|
||||
sizeof(Char **));
|
||||
|
||||
@@ -1505,7 +1505,7 @@ again:
|
||||
goto again;
|
||||
}
|
||||
if (c > 0)
|
||||
bcopy(ttyline, fbuf[buf] + off, c * sizeof(Char));
|
||||
memmove(fbuf[buf] + off, ttyline, c * sizeof(Char));
|
||||
numleft = 0;
|
||||
}
|
||||
else {
|
||||
@@ -1549,7 +1549,7 @@ again:
|
||||
static void
|
||||
bfree()
|
||||
{
|
||||
register int sb, i;
|
||||
int sb, i;
|
||||
|
||||
if (cantell)
|
||||
return;
|
||||
|
||||
+33
-33
@@ -30,7 +30,7 @@
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: misc.c,v 1.2 1994/09/24 02:54:10 davidg Exp $
|
||||
* $Id: misc.c,v 1.3 1996/09/28 14:32:01 bde Exp $
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
@@ -53,8 +53,8 @@ static int renum __P((int, int));
|
||||
|
||||
int
|
||||
any(s, c)
|
||||
register char *s;
|
||||
register int c;
|
||||
char *s;
|
||||
int c;
|
||||
{
|
||||
if (!s)
|
||||
return (0); /* Check for nil pointer */
|
||||
@@ -77,10 +77,10 @@ setzero(cp, i)
|
||||
|
||||
char *
|
||||
strsave(s)
|
||||
register char *s;
|
||||
char *s;
|
||||
{
|
||||
char *n;
|
||||
register char *p;
|
||||
char *p;
|
||||
|
||||
if (s == NULL)
|
||||
s = "";
|
||||
@@ -94,7 +94,7 @@ strsave(s)
|
||||
|
||||
Char **
|
||||
blkend(up)
|
||||
register Char **up;
|
||||
Char **up;
|
||||
{
|
||||
|
||||
while (*up)
|
||||
@@ -106,7 +106,7 @@ blkend(up)
|
||||
void
|
||||
blkpr(fp, av)
|
||||
FILE *fp;
|
||||
register Char **av;
|
||||
Char **av;
|
||||
{
|
||||
|
||||
for (; *av; av++) {
|
||||
@@ -118,9 +118,9 @@ blkpr(fp, av)
|
||||
|
||||
int
|
||||
blklen(av)
|
||||
register Char **av;
|
||||
Char **av;
|
||||
{
|
||||
register int i = 0;
|
||||
int i = 0;
|
||||
|
||||
while (*av++)
|
||||
i++;
|
||||
@@ -130,9 +130,9 @@ blklen(av)
|
||||
Char **
|
||||
blkcpy(oav, bv)
|
||||
Char **oav;
|
||||
register Char **bv;
|
||||
Char **bv;
|
||||
{
|
||||
register Char **av = oav;
|
||||
Char **av = oav;
|
||||
|
||||
while ((*av++ = *bv++) != NULL)
|
||||
continue;
|
||||
@@ -152,7 +152,7 @@ void
|
||||
blkfree(av0)
|
||||
Char **av0;
|
||||
{
|
||||
register Char **av = av0;
|
||||
Char **av = av0;
|
||||
|
||||
if (!av0)
|
||||
return;
|
||||
@@ -163,9 +163,9 @@ blkfree(av0)
|
||||
|
||||
Char **
|
||||
saveblk(v)
|
||||
register Char **v;
|
||||
Char **v;
|
||||
{
|
||||
register Char **newv =
|
||||
Char **newv =
|
||||
(Char **) xcalloc((size_t) (blklen(v) + 1), sizeof(Char **));
|
||||
Char **onewv = newv;
|
||||
|
||||
@@ -177,11 +177,11 @@ saveblk(v)
|
||||
#ifdef NOTUSED
|
||||
char *
|
||||
strstr(s, t)
|
||||
register char *s, *t;
|
||||
char *s, *t;
|
||||
{
|
||||
do {
|
||||
register char *ss = s;
|
||||
register char *tt = t;
|
||||
char *ss = s;
|
||||
char *tt = t;
|
||||
|
||||
do
|
||||
if (*tt == '\0')
|
||||
@@ -199,7 +199,7 @@ strspl(cp, dp)
|
||||
char *cp, *dp;
|
||||
{
|
||||
char *ep;
|
||||
register char *p, *q;
|
||||
char *p, *q;
|
||||
|
||||
if (!cp)
|
||||
cp = "";
|
||||
@@ -221,9 +221,9 @@ strspl(cp, dp)
|
||||
|
||||
Char **
|
||||
blkspl(up, vp)
|
||||
register Char **up, **vp;
|
||||
Char **up, **vp;
|
||||
{
|
||||
register Char **wp =
|
||||
Char **wp =
|
||||
(Char **) xcalloc((size_t) (blklen(up) + blklen(vp) + 1),
|
||||
sizeof(Char **));
|
||||
|
||||
@@ -233,7 +233,7 @@ blkspl(up, vp)
|
||||
|
||||
Char
|
||||
lastchr(cp)
|
||||
register Char *cp;
|
||||
Char *cp;
|
||||
{
|
||||
|
||||
if (!cp)
|
||||
@@ -252,7 +252,7 @@ lastchr(cp)
|
||||
void
|
||||
closem()
|
||||
{
|
||||
register int f, flimit;
|
||||
int f, flimit;
|
||||
|
||||
for (f = 0, flimit = getdtablesize(); f < flimit; f++)
|
||||
if (f != SHIN && f != SHOUT && f != SHERR && f != OLDSTD &&
|
||||
@@ -277,7 +277,7 @@ donefds()
|
||||
*/
|
||||
int
|
||||
dmove(i, j)
|
||||
register int i, j;
|
||||
int i, j;
|
||||
{
|
||||
|
||||
if (i == j || i < 0)
|
||||
@@ -296,7 +296,7 @@ dmove(i, j)
|
||||
|
||||
int
|
||||
dcopy(i, j)
|
||||
register int i, j;
|
||||
int i, j;
|
||||
{
|
||||
|
||||
if (i == j || i < 0 || (j < 0 && i > 2))
|
||||
@@ -311,9 +311,9 @@ dcopy(i, j)
|
||||
|
||||
static int
|
||||
renum(i, j)
|
||||
register int i, j;
|
||||
int i, j;
|
||||
{
|
||||
register int k = dup(i);
|
||||
int k = dup(i);
|
||||
|
||||
if (k < 0)
|
||||
return (-1);
|
||||
@@ -334,10 +334,10 @@ renum(i, j)
|
||||
*/
|
||||
void
|
||||
lshift(v, c)
|
||||
register Char **v;
|
||||
register int c;
|
||||
Char **v;
|
||||
int c;
|
||||
{
|
||||
register Char **u;
|
||||
Char **u;
|
||||
|
||||
for (u = v; *u && --c >= 0; u++)
|
||||
xfree((ptr_t) *u);
|
||||
@@ -363,7 +363,7 @@ number(cp)
|
||||
|
||||
Char **
|
||||
copyblk(v)
|
||||
register Char **v;
|
||||
Char **v;
|
||||
{
|
||||
Char **nv = (Char **) xcalloc((size_t) (blklen(v) + 1), sizeof(Char **));
|
||||
|
||||
@@ -373,7 +373,7 @@ copyblk(v)
|
||||
#ifndef SHORT_STRINGS
|
||||
char *
|
||||
strend(cp)
|
||||
register char *cp;
|
||||
char *cp;
|
||||
{
|
||||
if (!cp)
|
||||
return (cp);
|
||||
@@ -388,7 +388,7 @@ Char *
|
||||
strip(cp)
|
||||
Char *cp;
|
||||
{
|
||||
register Char *dp = cp;
|
||||
Char *dp = cp;
|
||||
|
||||
if (!cp)
|
||||
return (cp);
|
||||
@@ -408,7 +408,7 @@ udvar(name)
|
||||
|
||||
int
|
||||
prefix(sub, str)
|
||||
register Char *sub, *str;
|
||||
Char *sub, *str;
|
||||
{
|
||||
|
||||
for (;;) {
|
||||
|
||||
+30
-30
@@ -30,7 +30,7 @@
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: parse.c,v 1.2 1994/09/24 02:54:11 davidg Exp $
|
||||
* $Id: parse.c,v 1.3 1995/05/30 00:06:37 rgrimes Exp $
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
@@ -79,7 +79,7 @@ static int aleft;
|
||||
extern int hleft;
|
||||
void
|
||||
alias(lex)
|
||||
register struct wordent *lex;
|
||||
struct wordent *lex;
|
||||
{
|
||||
jmp_buf osetexit;
|
||||
|
||||
@@ -99,7 +99,7 @@ alias(lex)
|
||||
|
||||
static void
|
||||
asyntax(p1, p2)
|
||||
register struct wordent *p1, *p2;
|
||||
struct wordent *p1, *p2;
|
||||
{
|
||||
while (p1 != p2)
|
||||
if (any(";&\n", p1->word[0]))
|
||||
@@ -113,10 +113,10 @@ asyntax(p1, p2)
|
||||
static void
|
||||
asyn0(p1, p2)
|
||||
struct wordent *p1;
|
||||
register struct wordent *p2;
|
||||
struct wordent *p2;
|
||||
{
|
||||
register struct wordent *p;
|
||||
register int l = 0;
|
||||
struct wordent *p;
|
||||
int l = 0;
|
||||
|
||||
for (p = p1; p != p2; p = p->next)
|
||||
switch (p->word[0]) {
|
||||
@@ -153,11 +153,11 @@ asyn0(p1, p2)
|
||||
static void
|
||||
asyn3(p1, p2)
|
||||
struct wordent *p1;
|
||||
register struct wordent *p2;
|
||||
struct wordent *p2;
|
||||
{
|
||||
register struct varent *ap;
|
||||
struct varent *ap;
|
||||
struct wordent alout;
|
||||
register bool redid;
|
||||
bool redid;
|
||||
|
||||
if (p1 == p2)
|
||||
return;
|
||||
@@ -203,9 +203,9 @@ asyn3(p1, p2)
|
||||
|
||||
static struct wordent *
|
||||
freenod(p1, p2)
|
||||
register struct wordent *p1, *p2;
|
||||
struct wordent *p1, *p2;
|
||||
{
|
||||
register struct wordent *retp = p1->prev;
|
||||
struct wordent *retp = p1->prev;
|
||||
|
||||
while (p1 != p2) {
|
||||
xfree((ptr_t) p1->word);
|
||||
@@ -229,7 +229,7 @@ freenod(p1, p2)
|
||||
*/
|
||||
struct command *
|
||||
syntax(p1, p2, flags)
|
||||
register struct wordent *p1, *p2;
|
||||
struct wordent *p1, *p2;
|
||||
int flags;
|
||||
{
|
||||
|
||||
@@ -251,8 +251,8 @@ syn0(p1, p2, flags)
|
||||
struct wordent *p1, *p2;
|
||||
int flags;
|
||||
{
|
||||
register struct wordent *p;
|
||||
register struct command *t, *t1;
|
||||
struct wordent *p;
|
||||
struct command *t, *t1;
|
||||
int l;
|
||||
|
||||
l = 0;
|
||||
@@ -319,8 +319,8 @@ syn1(p1, p2, flags)
|
||||
struct wordent *p1, *p2;
|
||||
int flags;
|
||||
{
|
||||
register struct wordent *p;
|
||||
register struct command *t;
|
||||
struct wordent *p;
|
||||
struct command *t;
|
||||
int l;
|
||||
|
||||
l = 0;
|
||||
@@ -360,9 +360,9 @@ syn1a(p1, p2, flags)
|
||||
struct wordent *p1, *p2;
|
||||
int flags;
|
||||
{
|
||||
register struct wordent *p;
|
||||
register struct command *t;
|
||||
register int l = 0;
|
||||
struct wordent *p;
|
||||
struct command *t;
|
||||
int l = 0;
|
||||
|
||||
for (p = p1; p != p2; p = p->next)
|
||||
switch (p->word[0]) {
|
||||
@@ -401,9 +401,9 @@ syn1b(p1, p2, flags)
|
||||
struct wordent *p1, *p2;
|
||||
int flags;
|
||||
{
|
||||
register struct wordent *p;
|
||||
register struct command *t;
|
||||
register int l = 0;
|
||||
struct wordent *p;
|
||||
struct command *t;
|
||||
int l = 0;
|
||||
|
||||
for (p = p1; p != p2; p = p->next)
|
||||
switch (p->word[0]) {
|
||||
@@ -441,9 +441,9 @@ syn2(p1, p2, flags)
|
||||
struct wordent *p1, *p2;
|
||||
int flags;
|
||||
{
|
||||
register struct wordent *p, *pn;
|
||||
register struct command *t;
|
||||
register int l = 0;
|
||||
struct wordent *p, *pn;
|
||||
struct command *t;
|
||||
int l = 0;
|
||||
int f;
|
||||
|
||||
for (p = p1; p != p2; p = p->next)
|
||||
@@ -492,10 +492,10 @@ syn3(p1, p2, flags)
|
||||
struct wordent *p1, *p2;
|
||||
int flags;
|
||||
{
|
||||
register struct wordent *p;
|
||||
struct wordent *p;
|
||||
struct wordent *lp, *rp;
|
||||
register struct command *t;
|
||||
register int l;
|
||||
struct command *t;
|
||||
int l;
|
||||
Char **av;
|
||||
int n, c;
|
||||
bool specp = 0;
|
||||
@@ -668,9 +668,9 @@ again:
|
||||
|
||||
void
|
||||
freesyn(t)
|
||||
register struct command *t;
|
||||
struct command *t;
|
||||
{
|
||||
register Char **v;
|
||||
Char **v;
|
||||
|
||||
if (t == 0)
|
||||
return;
|
||||
|
||||
+2
-2
@@ -1,4 +1,4 @@
|
||||
/*
|
||||
/*-
|
||||
* Copyright (c) 1988, 1993
|
||||
* The Regents of the University of California. All rights reserved.
|
||||
*
|
||||
@@ -31,7 +31,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)pathnames.h 8.1 (Berkeley) 5/31/93
|
||||
* $Id$
|
||||
* $Id: pathnames.h,v 1.2 1994/09/24 02:54:12 davidg Exp $
|
||||
*/
|
||||
|
||||
#define _PATH_BIN "/bin"
|
||||
|
||||
+44
-44
@@ -30,7 +30,7 @@
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id$
|
||||
* $Id: proc.c,v 1.2 1994/09/24 02:54:13 davidg Exp $
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
@@ -82,9 +82,9 @@ void
|
||||
pchild(notused)
|
||||
int notused;
|
||||
{
|
||||
register struct process *pp;
|
||||
register struct process *fp;
|
||||
register int pid;
|
||||
struct process *pp;
|
||||
struct process *fp;
|
||||
int pid;
|
||||
extern int insource;
|
||||
union wait w;
|
||||
int jobflags;
|
||||
@@ -201,7 +201,7 @@ found:
|
||||
void
|
||||
pnote()
|
||||
{
|
||||
register struct process *pp;
|
||||
struct process *pp;
|
||||
int flags;
|
||||
sigset_t omask;
|
||||
|
||||
@@ -225,7 +225,7 @@ pnote()
|
||||
void
|
||||
pwait()
|
||||
{
|
||||
register struct process *fp, *pp;
|
||||
struct process *fp, *pp;
|
||||
sigset_t omask;
|
||||
|
||||
/*
|
||||
@@ -253,9 +253,9 @@ pwait()
|
||||
*/
|
||||
void
|
||||
pjwait(pp)
|
||||
register struct process *pp;
|
||||
struct process *pp;
|
||||
{
|
||||
register struct process *fp;
|
||||
struct process *fp;
|
||||
int jobflags, reason;
|
||||
sigset_t omask;
|
||||
|
||||
@@ -345,7 +345,7 @@ dowait(v, t)
|
||||
Char **v;
|
||||
struct command *t;
|
||||
{
|
||||
register struct process *pp;
|
||||
struct process *pp;
|
||||
sigset_t omask;
|
||||
|
||||
pjobs++;
|
||||
@@ -367,7 +367,7 @@ loop:
|
||||
static void
|
||||
pflushall()
|
||||
{
|
||||
register struct process *pp;
|
||||
struct process *pp;
|
||||
|
||||
for (pp = proclist.p_next; pp != NULL; pp = pp->p_next)
|
||||
if (pp->p_pid)
|
||||
@@ -381,10 +381,10 @@ pflushall()
|
||||
*/
|
||||
static void
|
||||
pflush(pp)
|
||||
register struct process *pp;
|
||||
struct process *pp;
|
||||
{
|
||||
register struct process *np;
|
||||
register int idx;
|
||||
struct process *np;
|
||||
int idx;
|
||||
|
||||
if (pp->p_pid == 0) {
|
||||
(void) fprintf(csherr, "BUG: process flushed twice");
|
||||
@@ -415,7 +415,7 @@ pflush(pp)
|
||||
*/
|
||||
static void
|
||||
pclrcurr(pp)
|
||||
register struct process *pp;
|
||||
struct process *pp;
|
||||
{
|
||||
|
||||
if (pp == pcurrent)
|
||||
@@ -443,9 +443,9 @@ static Char *cmdp;
|
||||
void
|
||||
palloc(pid, t)
|
||||
int pid;
|
||||
register struct command *t;
|
||||
struct command *t;
|
||||
{
|
||||
register struct process *pp;
|
||||
struct process *pp;
|
||||
int i;
|
||||
|
||||
pp = (struct process *) xcalloc(1, (size_t) sizeof(struct process));
|
||||
@@ -509,7 +509,7 @@ palloc(pid, t)
|
||||
|
||||
static void
|
||||
padd(t)
|
||||
register struct command *t;
|
||||
struct command *t;
|
||||
{
|
||||
Char **argp;
|
||||
|
||||
@@ -570,7 +570,7 @@ static void
|
||||
pads(cp)
|
||||
Char *cp;
|
||||
{
|
||||
register int i;
|
||||
int i;
|
||||
|
||||
/*
|
||||
* Avoid the Quoted Space alias hack! Reported by:
|
||||
@@ -626,7 +626,7 @@ prestjob()
|
||||
void
|
||||
pendjob()
|
||||
{
|
||||
register struct process *pp, *tp;
|
||||
struct process *pp, *tp;
|
||||
|
||||
if (pcurrjob && (pcurrjob->p_flags & (PFOREGND | PSTOPPED)) == 0) {
|
||||
pp = pcurrjob;
|
||||
@@ -648,10 +648,10 @@ pendjob()
|
||||
*/
|
||||
static int
|
||||
pprint(pp, flag)
|
||||
register struct process *pp;
|
||||
struct process *pp;
|
||||
bool flag;
|
||||
{
|
||||
register status, reason;
|
||||
int status, reason;
|
||||
struct process *tp;
|
||||
int jobflags, pstatus;
|
||||
bool hadnl = 1; /* did we just have a newline */
|
||||
@@ -814,13 +814,13 @@ prcomd:
|
||||
|
||||
static void
|
||||
ptprint(tp)
|
||||
register struct process *tp;
|
||||
struct process *tp;
|
||||
{
|
||||
struct timeval tetime, diff;
|
||||
static struct timeval ztime;
|
||||
struct rusage ru;
|
||||
static struct rusage zru;
|
||||
register struct process *pp = tp;
|
||||
struct process *pp = tp;
|
||||
|
||||
ru = zru;
|
||||
tetime = ztime;
|
||||
@@ -842,8 +842,8 @@ dojobs(v, t)
|
||||
Char **v;
|
||||
struct command *t;
|
||||
{
|
||||
register struct process *pp;
|
||||
register int flag = NUMBER | NAME | REASON;
|
||||
struct process *pp;
|
||||
int flag = NUMBER | NAME | REASON;
|
||||
int i;
|
||||
|
||||
if (chkstop)
|
||||
@@ -872,7 +872,7 @@ dofg(v, t)
|
||||
Char **v;
|
||||
struct command *t;
|
||||
{
|
||||
register struct process *pp;
|
||||
struct process *pp;
|
||||
|
||||
okpcntl();
|
||||
++v;
|
||||
@@ -892,7 +892,7 @@ dofg1(v, t)
|
||||
Char **v;
|
||||
struct command *t;
|
||||
{
|
||||
register struct process *pp;
|
||||
struct process *pp;
|
||||
|
||||
okpcntl();
|
||||
pp = pfind(v[0]);
|
||||
@@ -909,7 +909,7 @@ dobg(v, t)
|
||||
Char **v;
|
||||
struct command *t;
|
||||
{
|
||||
register struct process *pp;
|
||||
struct process *pp;
|
||||
|
||||
okpcntl();
|
||||
++v;
|
||||
@@ -928,7 +928,7 @@ dobg1(v, t)
|
||||
Char **v;
|
||||
struct command *t;
|
||||
{
|
||||
register struct process *pp;
|
||||
struct process *pp;
|
||||
|
||||
pp = pfind(v[0]);
|
||||
pstart(pp, 0);
|
||||
@@ -955,8 +955,8 @@ dokill(v, t)
|
||||
Char **v;
|
||||
struct command *t;
|
||||
{
|
||||
register int signum = SIGTERM;
|
||||
register char *name;
|
||||
int signum = SIGTERM;
|
||||
char *name;
|
||||
|
||||
v++;
|
||||
if (v[0] && v[0][0] == '-') {
|
||||
@@ -998,8 +998,8 @@ pkill(v, signum)
|
||||
Char **v;
|
||||
int signum;
|
||||
{
|
||||
register struct process *pp, *np;
|
||||
register int jobflags = 0;
|
||||
struct process *pp, *np;
|
||||
int jobflags = 0;
|
||||
int pid, err1 = 0;
|
||||
sigset_t omask;
|
||||
Char *cp;
|
||||
@@ -1081,10 +1081,10 @@ cont:
|
||||
*/
|
||||
void
|
||||
pstart(pp, foregnd)
|
||||
register struct process *pp;
|
||||
struct process *pp;
|
||||
int foregnd;
|
||||
{
|
||||
register struct process *np;
|
||||
struct process *np;
|
||||
sigset_t omask;
|
||||
long jobflags = 0;
|
||||
|
||||
@@ -1115,7 +1115,7 @@ void
|
||||
panystop(neednl)
|
||||
bool neednl;
|
||||
{
|
||||
register struct process *pp;
|
||||
struct process *pp;
|
||||
|
||||
chkstop = 2;
|
||||
for (pp = proclist.p_next; pp; pp = pp->p_next)
|
||||
@@ -1127,7 +1127,7 @@ struct process *
|
||||
pfind(cp)
|
||||
Char *cp;
|
||||
{
|
||||
register struct process *pp, *np;
|
||||
struct process *pp, *np;
|
||||
|
||||
if (cp == 0 || cp[1] == 0 || eq(cp, STRcent2) || eq(cp, STRcentplus)) {
|
||||
if (pcurrent == NULL)
|
||||
@@ -1151,7 +1151,7 @@ pfind(cp)
|
||||
for (pp = proclist.p_next; pp; pp = pp->p_next)
|
||||
if (pp->p_pid == pp->p_jobid) {
|
||||
if (cp[1] == '?') {
|
||||
register Char *dp;
|
||||
Char *dp;
|
||||
|
||||
for (dp = pp->p_command; *dp; dp++) {
|
||||
if (*dp != cp[2])
|
||||
@@ -1169,7 +1169,7 @@ pfind(cp)
|
||||
}
|
||||
if (np)
|
||||
return (np);
|
||||
stderror(ERR_NAME | cp[1] == '?' ? ERR_JOBPAT : ERR_NOSUCHJOB);
|
||||
stderror(ERR_NAME | (cp[1] == '?' ? ERR_JOBPAT : ERR_NOSUCHJOB));
|
||||
/* NOTREACHED */
|
||||
return (0);
|
||||
}
|
||||
@@ -1180,10 +1180,10 @@ pfind(cp)
|
||||
*/
|
||||
static struct process *
|
||||
pgetcurr(pp)
|
||||
register struct process *pp;
|
||||
struct process *pp;
|
||||
{
|
||||
register struct process *np;
|
||||
register struct process *xp = NULL;
|
||||
struct process *np;
|
||||
struct process *xp = NULL;
|
||||
|
||||
for (np = proclist.p_next; np; np = np->p_next)
|
||||
if (np != pcurrent && np != pp && np->p_pid &&
|
||||
@@ -1205,7 +1205,7 @@ donotify(v, t)
|
||||
Char **v;
|
||||
struct command *t;
|
||||
{
|
||||
register struct process *pp;
|
||||
struct process *pp;
|
||||
|
||||
pp = pfind(*++v);
|
||||
pp->p_flags |= PNOTIFY;
|
||||
@@ -1228,7 +1228,7 @@ pfork(t, wanttty)
|
||||
struct command *t; /* command we are forking for */
|
||||
int wanttty;
|
||||
{
|
||||
register int pid;
|
||||
int pid;
|
||||
bool ignint = 0;
|
||||
int pgrp;
|
||||
sigset_t omask;
|
||||
|
||||
+10
-10
@@ -30,7 +30,7 @@
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: sem.c,v 1.2 1994/09/24 02:54:15 davidg Exp $
|
||||
* $Id: sem.c,v 1.3 1995/05/30 00:06:37 rgrimes Exp $
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
@@ -62,7 +62,7 @@ static void chkclob __P((char *));
|
||||
|
||||
void
|
||||
execute(t, wanttty, pipein, pipeout)
|
||||
register struct command *t;
|
||||
struct command *t;
|
||||
int wanttty, *pipein, *pipeout;
|
||||
{
|
||||
bool forked = 0;
|
||||
@@ -451,7 +451,7 @@ static void
|
||||
vffree(i)
|
||||
int i;
|
||||
{
|
||||
register Char **v;
|
||||
Char **v;
|
||||
|
||||
if ((v = gargv) != NULL) {
|
||||
gargv = 0;
|
||||
@@ -481,7 +481,7 @@ int i;
|
||||
*/
|
||||
static Char *
|
||||
splicepipe(t, cp)
|
||||
register struct command *t;
|
||||
struct command *t;
|
||||
Char *cp; /* word after < or > */
|
||||
{
|
||||
Char *blk[2];
|
||||
@@ -524,12 +524,12 @@ splicepipe(t, cp)
|
||||
*/
|
||||
static void
|
||||
doio(t, pipein, pipeout)
|
||||
register struct command *t;
|
||||
struct command *t;
|
||||
int *pipein, *pipeout;
|
||||
{
|
||||
register int fd;
|
||||
register Char *cp;
|
||||
register int flags = t->t_dflg;
|
||||
int fd;
|
||||
Char *cp;
|
||||
int flags = t->t_dflg;
|
||||
|
||||
if (didfds || (flags & F_REPEAT))
|
||||
return;
|
||||
@@ -620,7 +620,7 @@ doio(t, pipein, pipeout)
|
||||
|
||||
void
|
||||
mypipe(pv)
|
||||
register int *pv;
|
||||
int *pv;
|
||||
{
|
||||
|
||||
if (pipe(pv) < 0)
|
||||
@@ -635,7 +635,7 @@ oops:
|
||||
|
||||
static void
|
||||
chkclob(cp)
|
||||
register char *cp;
|
||||
char *cp;
|
||||
{
|
||||
struct stat stb;
|
||||
|
||||
|
||||
+47
-46
@@ -30,7 +30,7 @@
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: set.c,v 1.3 1995/05/30 00:06:38 rgrimes Exp $
|
||||
* $Id: set.c,v 1.4 1995/07/07 23:13:11 ache Exp $
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
@@ -47,6 +47,7 @@ static char sccsid[] = "@(#)set.c 8.1 (Berkeley) 5/31/93";
|
||||
#else
|
||||
# include <varargs.h>
|
||||
#endif
|
||||
#include <unistd.h>
|
||||
|
||||
#include "csh.h"
|
||||
#include "extern.h"
|
||||
@@ -75,7 +76,7 @@ doset(v, t)
|
||||
Char **v;
|
||||
struct command *t;
|
||||
{
|
||||
register Char *p;
|
||||
Char *p;
|
||||
Char *vp, op;
|
||||
Char **vecp;
|
||||
bool hadsub;
|
||||
@@ -116,7 +117,7 @@ doset(v, t)
|
||||
if (op && op != '=')
|
||||
stderror(ERR_NAME | ERR_SYNTAX);
|
||||
if (eq(p, STRLparen)) {
|
||||
register Char **e = v;
|
||||
Char **e = v;
|
||||
|
||||
if (hadsub)
|
||||
stderror(ERR_NAME | ERR_SYNTAX);
|
||||
@@ -143,7 +144,7 @@ doset(v, t)
|
||||
dohash(NULL, NULL);
|
||||
}
|
||||
else if (eq(vp, STRhistchars)) {
|
||||
register Char *pn = value(STRhistchars);
|
||||
Char *pn = value(STRhistchars);
|
||||
|
||||
HIST = *pn++;
|
||||
HISTSUB = *pn;
|
||||
@@ -158,7 +159,7 @@ doset(v, t)
|
||||
else if (eq(vp, STRterm))
|
||||
Setenv(STRTERM, value(vp));
|
||||
else if (eq(vp, STRhome)) {
|
||||
register Char *cp;
|
||||
Char *cp;
|
||||
|
||||
cp = Strsave(value(vp)); /* get the old value back */
|
||||
|
||||
@@ -184,8 +185,8 @@ doset(v, t)
|
||||
|
||||
static Char *
|
||||
getinx(cp, ip)
|
||||
register Char *cp;
|
||||
register int *ip;
|
||||
Char *cp;
|
||||
int *ip;
|
||||
{
|
||||
|
||||
*ip = 0;
|
||||
@@ -203,7 +204,7 @@ asx(vp, subscr, p)
|
||||
int subscr;
|
||||
Char *p;
|
||||
{
|
||||
register struct varent *v = getvx(vp, subscr);
|
||||
struct varent *v = getvx(vp, subscr);
|
||||
|
||||
xfree((ptr_t) v->vec[subscr - 1]);
|
||||
v->vec[subscr - 1] = globone(p, G_APPEND);
|
||||
@@ -214,7 +215,7 @@ getvx(vp, subscr)
|
||||
Char *vp;
|
||||
int subscr;
|
||||
{
|
||||
register struct varent *v = adrof(vp);
|
||||
struct varent *v = adrof(vp);
|
||||
|
||||
if (v == 0)
|
||||
udvar(vp);
|
||||
@@ -229,7 +230,7 @@ dolet(v, t)
|
||||
Char **v;
|
||||
struct command *t;
|
||||
{
|
||||
register Char *p;
|
||||
Char *p;
|
||||
Char *vp, c, op;
|
||||
bool hadsub;
|
||||
int subscr;
|
||||
@@ -314,7 +315,7 @@ static Char *
|
||||
xset(cp, vp)
|
||||
Char *cp, ***vp;
|
||||
{
|
||||
register Char *dp;
|
||||
Char *dp;
|
||||
|
||||
if (*cp) {
|
||||
dp = Strsave(cp);
|
||||
@@ -332,9 +333,9 @@ operate(op, vp, p)
|
||||
{
|
||||
Char opr[2];
|
||||
Char *vec[5];
|
||||
register Char **v = vec;
|
||||
Char **v = vec;
|
||||
Char **vecp = v;
|
||||
register int i;
|
||||
int i;
|
||||
|
||||
if (op != '=') {
|
||||
if (*vp)
|
||||
@@ -357,7 +358,7 @@ static Char *putp;
|
||||
|
||||
Char *
|
||||
putn(n)
|
||||
register int n;
|
||||
int n;
|
||||
{
|
||||
int num;
|
||||
static Char number[15];
|
||||
@@ -390,7 +391,7 @@ putn(n)
|
||||
|
||||
static void
|
||||
putn1(n)
|
||||
register int n;
|
||||
int n;
|
||||
{
|
||||
if (n > 9)
|
||||
putn1(n / 10);
|
||||
@@ -399,9 +400,9 @@ putn1(n)
|
||||
|
||||
int
|
||||
getn(cp)
|
||||
register Char *cp;
|
||||
Char *cp;
|
||||
{
|
||||
register int n;
|
||||
int n;
|
||||
int sign;
|
||||
|
||||
sign = 0;
|
||||
@@ -426,7 +427,7 @@ value1(var, head)
|
||||
Char *var;
|
||||
struct varent *head;
|
||||
{
|
||||
register struct varent *vp;
|
||||
struct varent *vp;
|
||||
|
||||
vp = adrof1(var, head);
|
||||
return (vp == 0 || vp->vec[0] == 0 ? STRNULL : vp->vec[0]);
|
||||
@@ -435,9 +436,9 @@ value1(var, head)
|
||||
static struct varent *
|
||||
madrof(pat, vp)
|
||||
Char *pat;
|
||||
register struct varent *vp;
|
||||
struct varent *vp;
|
||||
{
|
||||
register struct varent *vp1;
|
||||
struct varent *vp1;
|
||||
|
||||
for (; vp; vp = vp->v_right) {
|
||||
if (vp->v_left && (vp1 = madrof(pat, vp->v_left)))
|
||||
@@ -450,10 +451,10 @@ madrof(pat, vp)
|
||||
|
||||
struct varent *
|
||||
adrof1(name, v)
|
||||
register Char *name;
|
||||
register struct varent *v;
|
||||
Char *name;
|
||||
struct varent *v;
|
||||
{
|
||||
register cmp;
|
||||
int cmp;
|
||||
|
||||
v = v->v_left;
|
||||
while (v && ((cmp = *name - *v->v_name) ||
|
||||
@@ -472,7 +473,7 @@ void
|
||||
set(var, val)
|
||||
Char *var, *val;
|
||||
{
|
||||
register Char **vec = (Char **) xmalloc((size_t) (2 * sizeof(Char **)));
|
||||
Char **vec = (Char **) xmalloc((size_t) (2 * sizeof(Char **)));
|
||||
|
||||
vec[0] = val;
|
||||
vec[1] = 0;
|
||||
@@ -484,7 +485,7 @@ set1(var, vec, head)
|
||||
Char *var, **vec;
|
||||
struct varent *head;
|
||||
{
|
||||
register Char **oldv = vec;
|
||||
Char **oldv = vec;
|
||||
|
||||
gflag = 0;
|
||||
tglob(oldv);
|
||||
@@ -505,10 +506,10 @@ set1(var, vec, head)
|
||||
void
|
||||
setq(name, vec, p)
|
||||
Char *name, **vec;
|
||||
register struct varent *p;
|
||||
struct varent *p;
|
||||
{
|
||||
register struct varent *c;
|
||||
register f;
|
||||
struct varent *c;
|
||||
int f;
|
||||
|
||||
f = 0; /* tree hangs off the header's left link */
|
||||
while ((c = p->v_link[f]) != NULL) {
|
||||
@@ -551,11 +552,11 @@ unset(v, t)
|
||||
|
||||
void
|
||||
unset1(v, head)
|
||||
register Char *v[];
|
||||
Char *v[];
|
||||
struct varent *head;
|
||||
{
|
||||
register struct varent *vp;
|
||||
register int cnt;
|
||||
struct varent *vp;
|
||||
int cnt;
|
||||
|
||||
while (*++v) {
|
||||
cnt = 0;
|
||||
@@ -570,7 +571,7 @@ void
|
||||
unsetv(var)
|
||||
Char *var;
|
||||
{
|
||||
register struct varent *vp;
|
||||
struct varent *vp;
|
||||
|
||||
if ((vp = adrof1(var, &shvhed)) == 0)
|
||||
udvar(var);
|
||||
@@ -579,10 +580,10 @@ unsetv(var)
|
||||
|
||||
static void
|
||||
unsetv1(p)
|
||||
register struct varent *p;
|
||||
struct varent *p;
|
||||
{
|
||||
register struct varent *c, *pp;
|
||||
register f;
|
||||
struct varent *c, *pp;
|
||||
int f;
|
||||
|
||||
/*
|
||||
* Free associated memory first to avoid complications.
|
||||
@@ -633,8 +634,8 @@ shift(v, t)
|
||||
Char **v;
|
||||
struct command *t;
|
||||
{
|
||||
register struct varent *argv;
|
||||
register Char *name;
|
||||
struct varent *argv;
|
||||
Char *name;
|
||||
|
||||
v++;
|
||||
name = *v;
|
||||
@@ -665,7 +666,7 @@ exportpath(val)
|
||||
break;
|
||||
}
|
||||
if (**val != '/' && (euid == 0 || uid == 0) &&
|
||||
(intact || intty && isatty(SHOUT)))
|
||||
(intact || (intty && isatty(SHOUT))))
|
||||
(void) fprintf(csherr,
|
||||
"Warning: exported path contains relative components.\n");
|
||||
(void) Strcat(exppath, *val++);
|
||||
@@ -717,16 +718,16 @@ rright(p)
|
||||
*/
|
||||
static void
|
||||
balance(p, f, d)
|
||||
register struct varent *p;
|
||||
register int f, d;
|
||||
struct varent *p;
|
||||
int f, d;
|
||||
{
|
||||
register struct varent *pp;
|
||||
struct varent *pp;
|
||||
|
||||
#ifndef lint
|
||||
register struct varent *t; /* used by the rotate macros */
|
||||
struct varent *t; /* used by the rotate macros */
|
||||
|
||||
#endif
|
||||
register ff;
|
||||
int ff;
|
||||
|
||||
/*
|
||||
* Ok, from here on, p is the node we're operating on; pp is it's parent; f
|
||||
@@ -812,10 +813,10 @@ balance(p, f, d)
|
||||
|
||||
void
|
||||
plist(p)
|
||||
register struct varent *p;
|
||||
struct varent *p;
|
||||
{
|
||||
register struct varent *c;
|
||||
register len;
|
||||
struct varent *c;
|
||||
int len;
|
||||
|
||||
if (setintr)
|
||||
(void) sigsetmask(sigblock((sigset_t) 0) & ~sigmask(SIGINT));
|
||||
|
||||
+36
-36
@@ -30,7 +30,7 @@
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: str.c,v 1.2 1994/09/24 02:54:18 davidg Exp $
|
||||
* $Id: str.c,v 1.3 1995/05/30 00:06:39 rgrimes Exp $
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
@@ -59,10 +59,10 @@ static char sccsid[] = "@(#)str.c 8.1 (Berkeley) 5/31/93";
|
||||
|
||||
Char **
|
||||
blk2short(src)
|
||||
register char **src;
|
||||
char **src;
|
||||
{
|
||||
size_t n;
|
||||
register Char **sdst, **dst;
|
||||
Char **sdst, **dst;
|
||||
|
||||
/*
|
||||
* Count
|
||||
@@ -79,10 +79,10 @@ blk2short(src)
|
||||
|
||||
char **
|
||||
short2blk(src)
|
||||
register Char **src;
|
||||
Char **src;
|
||||
{
|
||||
size_t n;
|
||||
register char **sdst, **dst;
|
||||
char **sdst, **dst;
|
||||
|
||||
/*
|
||||
* Count
|
||||
@@ -99,11 +99,11 @@ short2blk(src)
|
||||
|
||||
Char *
|
||||
str2short(src)
|
||||
register char *src;
|
||||
char *src;
|
||||
{
|
||||
static Char *sdst;
|
||||
static size_t dstsize = 0;
|
||||
register Char *dst, *edst;
|
||||
Char *dst, *edst;
|
||||
|
||||
if (src == NULL)
|
||||
return (NULL);
|
||||
@@ -131,11 +131,11 @@ str2short(src)
|
||||
|
||||
char *
|
||||
short2str(src)
|
||||
register Char *src;
|
||||
Char *src;
|
||||
{
|
||||
static char *sdst = NULL;
|
||||
static size_t dstsize = 0;
|
||||
register char *dst, *edst;
|
||||
char *dst, *edst;
|
||||
|
||||
if (src == NULL)
|
||||
return (NULL);
|
||||
@@ -162,9 +162,9 @@ short2str(src)
|
||||
|
||||
Char *
|
||||
s_strcpy(dst, src)
|
||||
register Char *dst, *src;
|
||||
Char *dst, *src;
|
||||
{
|
||||
register Char *sdst;
|
||||
Char *sdst;
|
||||
|
||||
sdst = dst;
|
||||
while ((*dst++ = *src++) != '\0')
|
||||
@@ -174,10 +174,10 @@ s_strcpy(dst, src)
|
||||
|
||||
Char *
|
||||
s_strncpy(dst, src, n)
|
||||
register Char *dst, *src;
|
||||
register size_t n;
|
||||
Char *dst, *src;
|
||||
size_t n;
|
||||
{
|
||||
register Char *sdst;
|
||||
Char *sdst;
|
||||
|
||||
if (n == 0)
|
||||
return(dst);
|
||||
@@ -195,9 +195,9 @@ s_strncpy(dst, src, n)
|
||||
|
||||
Char *
|
||||
s_strcat(dst, src)
|
||||
register Char *dst, *src;
|
||||
Char *dst, *src;
|
||||
{
|
||||
register short *sdst;
|
||||
short *sdst;
|
||||
|
||||
sdst = dst;
|
||||
while (*dst++)
|
||||
@@ -211,10 +211,10 @@ s_strcat(dst, src)
|
||||
#ifdef NOTUSED
|
||||
Char *
|
||||
s_strncat(dst, src, n)
|
||||
register Char *dst, *src;
|
||||
register size_t n;
|
||||
Char *dst, *src;
|
||||
size_t n;
|
||||
{
|
||||
register Char *sdst;
|
||||
Char *sdst;
|
||||
|
||||
if (n == 0)
|
||||
return (dst);
|
||||
@@ -239,7 +239,7 @@ s_strncat(dst, src, n)
|
||||
|
||||
Char *
|
||||
s_strchr(str, ch)
|
||||
register Char *str;
|
||||
Char *str;
|
||||
int ch;
|
||||
{
|
||||
do
|
||||
@@ -251,10 +251,10 @@ s_strchr(str, ch)
|
||||
|
||||
Char *
|
||||
s_strrchr(str, ch)
|
||||
register Char *str;
|
||||
Char *str;
|
||||
int ch;
|
||||
{
|
||||
register Char *rstr;
|
||||
Char *rstr;
|
||||
|
||||
rstr = NULL;
|
||||
do
|
||||
@@ -266,9 +266,9 @@ s_strrchr(str, ch)
|
||||
|
||||
size_t
|
||||
s_strlen(str)
|
||||
register Char *str;
|
||||
Char *str;
|
||||
{
|
||||
register size_t n;
|
||||
size_t n;
|
||||
|
||||
for (n = 0; *str++; n++)
|
||||
continue;
|
||||
@@ -277,7 +277,7 @@ s_strlen(str)
|
||||
|
||||
int
|
||||
s_strcmp(str1, str2)
|
||||
register Char *str1, *str2;
|
||||
Char *str1, *str2;
|
||||
{
|
||||
for (; *str1 && *str1 == *str2; str1++, str2++)
|
||||
continue;
|
||||
@@ -298,8 +298,8 @@ s_strcmp(str1, str2)
|
||||
|
||||
int
|
||||
s_strncmp(str1, str2, n)
|
||||
register Char *str1, *str2;
|
||||
register size_t n;
|
||||
Char *str1, *str2;
|
||||
size_t n;
|
||||
{
|
||||
if (n == 0)
|
||||
return (0);
|
||||
@@ -327,10 +327,10 @@ s_strncmp(str1, str2, n)
|
||||
|
||||
Char *
|
||||
s_strsave(s)
|
||||
register Char *s;
|
||||
Char *s;
|
||||
{
|
||||
Char *n;
|
||||
register Char *p;
|
||||
Char *p;
|
||||
|
||||
if (s == 0)
|
||||
s = STRNULL;
|
||||
@@ -347,7 +347,7 @@ s_strspl(cp, dp)
|
||||
Char *cp, *dp;
|
||||
{
|
||||
Char *ep;
|
||||
register Char *p, *q;
|
||||
Char *p, *q;
|
||||
|
||||
if (!cp)
|
||||
cp = STRNULL;
|
||||
@@ -368,7 +368,7 @@ s_strspl(cp, dp)
|
||||
|
||||
Char *
|
||||
s_strend(cp)
|
||||
register Char *cp;
|
||||
Char *cp;
|
||||
{
|
||||
if (!cp)
|
||||
return (cp);
|
||||
@@ -379,11 +379,11 @@ s_strend(cp)
|
||||
|
||||
Char *
|
||||
s_strstr(s, t)
|
||||
register Char *s, *t;
|
||||
Char *s, *t;
|
||||
{
|
||||
do {
|
||||
register Char *ss = s;
|
||||
register Char *tt = t;
|
||||
Char *ss = s;
|
||||
Char *tt = t;
|
||||
|
||||
do
|
||||
if (*tt == '\0')
|
||||
@@ -396,11 +396,11 @@ s_strstr(s, t)
|
||||
|
||||
char *
|
||||
short2qstr(src)
|
||||
register Char *src;
|
||||
Char *src;
|
||||
{
|
||||
static char *sdst = NULL;
|
||||
static size_t dstsize = 0;
|
||||
register char *dst, *edst;
|
||||
char *dst, *edst;
|
||||
|
||||
if (src == NULL)
|
||||
return (NULL);
|
||||
|
||||
+10
-10
@@ -30,7 +30,7 @@
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: time.c,v 1.4 1995/03/19 13:28:12 joerg Exp $
|
||||
* $Id: time.c,v 1.5 1995/05/30 00:06:40 rgrimes Exp $
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
@@ -92,7 +92,7 @@ donice(v, t)
|
||||
Char **v;
|
||||
struct command *t;
|
||||
{
|
||||
register Char *cp;
|
||||
Char *cp;
|
||||
int nval = 0;
|
||||
|
||||
v++, cp = *v++;
|
||||
@@ -105,7 +105,7 @@ donice(v, t)
|
||||
|
||||
void
|
||||
ruadd(ru, ru2)
|
||||
register struct rusage *ru, *ru2;
|
||||
struct rusage *ru, *ru2;
|
||||
{
|
||||
tvadd(&ru->ru_utime, &ru2->ru_utime);
|
||||
tvadd(&ru->ru_stime, &ru2->ru_stime);
|
||||
@@ -129,17 +129,17 @@ ruadd(ru, ru2)
|
||||
|
||||
void
|
||||
prusage(r0, r1, e, b)
|
||||
register struct rusage *r0, *r1;
|
||||
struct rusage *r0, *r1;
|
||||
struct timeval *e, *b;
|
||||
{
|
||||
register time_t t =
|
||||
time_t t =
|
||||
(r1->ru_utime.tv_sec - r0->ru_utime.tv_sec) * 100 +
|
||||
(r1->ru_utime.tv_usec - r0->ru_utime.tv_usec) / 10000 +
|
||||
(r1->ru_stime.tv_sec - r0->ru_stime.tv_sec) * 100 +
|
||||
(r1->ru_stime.tv_usec - r0->ru_stime.tv_usec) / 10000;
|
||||
register char *cp;
|
||||
register long i;
|
||||
register struct varent *vp = adrof(STRtime);
|
||||
char *cp;
|
||||
long i;
|
||||
struct varent *vp = adrof(STRtime);
|
||||
|
||||
int ms =
|
||||
(e->tv_sec - b->tv_sec) * 100 + (e->tv_usec - b->tv_usec) / 10000;
|
||||
@@ -277,7 +277,7 @@ void
|
||||
psecs(l)
|
||||
long l;
|
||||
{
|
||||
register int i;
|
||||
int i;
|
||||
|
||||
i = l / 3600;
|
||||
if (i) {
|
||||
@@ -298,7 +298,7 @@ void
|
||||
pcsecs(l) /* PWP: print mm:ss.dd, l is in sec*100 */
|
||||
long l;
|
||||
{
|
||||
register int i;
|
||||
int i;
|
||||
|
||||
i = l / 360000;
|
||||
if (i) {
|
||||
|
||||
+3
-2
@@ -1,8 +1,9 @@
|
||||
# @(#)Makefile 8.1 (Berkeley) 5/31/93
|
||||
# $Id$
|
||||
# $Id: Makefile,v 1.2 1994/09/24 02:54:33 davidg Exp $
|
||||
|
||||
PROG= date
|
||||
SRCS= date.c netdate.c
|
||||
SRCS= date.c netdate.c vary.c
|
||||
CFLAGS+=-Wall
|
||||
DPADD= ${LIBUTIL}
|
||||
LDADD= -lutil
|
||||
|
||||
|
||||
+90
-6
@@ -33,7 +33,7 @@
|
||||
.\" SUCH DAMAGE.
|
||||
.\"
|
||||
.\" @(#)date.1 8.3 (Berkeley) 4/28/95
|
||||
.\" $Id: date.1,v 1.11 1997/02/22 14:02:31 peter Exp $
|
||||
.\" $Id: date.1,v 1.8.2.4 1997/09/14 13:07:03 jkh Exp $
|
||||
.\"
|
||||
.Dd November 17, 1993
|
||||
.Dt DATE 1
|
||||
@@ -48,7 +48,9 @@
|
||||
.Op Fl t Ar minutes_west
|
||||
.Op Fl nu
|
||||
.Op Cm + Ns Ar format
|
||||
.Op [yy[mm[dd[hh]]]]mm[\&.ss]
|
||||
.Op Fl v Ar [+|-]val[ymwdHM]
|
||||
.Ar ...
|
||||
.Op Fl f Ar fmt Ar date | [[[[yy]mm]dd]HH]MM[\&.ss]
|
||||
.Sh DESCRIPTION
|
||||
.Nm
|
||||
displays the current date and time when invoked without arguments.
|
||||
@@ -67,6 +69,14 @@ to
|
||||
.Xr gettimeofday 2
|
||||
will return a non-zero
|
||||
.Ql tz_dsttime .
|
||||
.It Fl f
|
||||
Use
|
||||
.Ar fmt
|
||||
as the format string to parse the date provided rather than using
|
||||
the default
|
||||
.Ar [[[[yy]mm]dd]HH]MM[.ss]
|
||||
format. Parsing is done using
|
||||
.Xr strptime 3 .
|
||||
.It Fl n
|
||||
The utility
|
||||
.Xr timed 8
|
||||
@@ -97,6 +107,40 @@ by future calls to
|
||||
Display or set the date in
|
||||
.Tn UCT
|
||||
(universal) time.
|
||||
.It Fl v
|
||||
Adjust the minute, hour, month day, week day, month or year according to
|
||||
.Ar val .
|
||||
If
|
||||
.Ar val
|
||||
is preceeded with a plus or minus sign, the date is adjusted forwards
|
||||
or backwards according to the remaining string, otherwise the relevant
|
||||
part of the date is set. The date can be adjusted as many times as
|
||||
required using these flags. Flags are processed in the order given.
|
||||
.Pp
|
||||
Minutes are in the range 0-59, hours are in the range 1-12, month days
|
||||
are in the range 1-31, week days are in the range 0-6 (sun-sat), months
|
||||
are in the range 1-12 (jan-dec) and years are in the range 80-38 or
|
||||
1980-2038.
|
||||
.Pp
|
||||
If
|
||||
.Ar val
|
||||
is numeric, one of either
|
||||
.Ar y ,
|
||||
.Ar m ,
|
||||
.Ar w ,
|
||||
.Ar d ,
|
||||
.Ar H
|
||||
or
|
||||
.Ar M
|
||||
must be used to specify which part of the date is to be adjusted.
|
||||
.Pp
|
||||
The week day or month may be specified using a name rather than a
|
||||
number. If a name is used with the plus (or minus) sign, the date
|
||||
will be put forwards (or backwards) to the next (previous) date that
|
||||
matches the given week day or month. This will not adjust the date
|
||||
if the given week day or month is the same as the current one.
|
||||
.Pp
|
||||
Refer to the examples below for further details.
|
||||
.El
|
||||
.Pp
|
||||
An operand with a leading plus (``+'') sign signals a user-defined format
|
||||
@@ -118,15 +162,15 @@ The canonical representation for setting the date and time is:
|
||||
.Pp
|
||||
.Bl -tag -width Ds -compact -offset indent
|
||||
.It Ar yy
|
||||
Year in abbreviated form (.e.g 89 for 1989).
|
||||
Year in abbreviated form (e.g. 89 for 1989, 06 for 2006).
|
||||
.It Ar mm
|
||||
Numeric month.
|
||||
A number from 1 to 12.
|
||||
.It Ar dd
|
||||
Day, a number from 1 to 31.
|
||||
.It Ar hh
|
||||
.It Ar HH
|
||||
Hour, a number from 0 to 23.
|
||||
.It Ar mm
|
||||
.It Ar MM
|
||||
Minutes, a number from 0 to 59.
|
||||
.It Ar .ss
|
||||
Seconds, a number from 0 to 61 (59 plus a maximum of two leap seconds).
|
||||
@@ -150,6 +194,40 @@ TIME: 13:36:16
|
||||
.Pp
|
||||
The command:
|
||||
.Bd -literal -offset indent
|
||||
date -v1m -v+1y
|
||||
.Ed
|
||||
.Pp
|
||||
will display:
|
||||
.Bd -literal -offset indent
|
||||
Sun Jan 4 03:15:24 GMT 1998
|
||||
.Ed
|
||||
.Pp
|
||||
(where it is currently Mon Aug 4 04:15:24 BST 1997).
|
||||
.Pp
|
||||
The command:
|
||||
.Bd -literal -offset indent
|
||||
date -v1d -v3m -v0y -v-1d
|
||||
.Ed
|
||||
.Pp
|
||||
will display the last day of February in the year 2000:
|
||||
.Bd -literal -offset indent
|
||||
Tue Feb 29 03:18:00 GMT 2000
|
||||
.Ed
|
||||
.Pp
|
||||
The command:
|
||||
.Bd -literal -offset indent
|
||||
date -v1d -v+1m -v-1d -v-fri
|
||||
.Ed
|
||||
.Pp
|
||||
will display the last friday of the month:
|
||||
.Bd -literal -offset indent
|
||||
Fri Aug 29 04:31:11 BST 1997
|
||||
.Ed
|
||||
.Pp
|
||||
(where it is currently Mon Aug 4 04:31:11 BST 1997).
|
||||
.Pp
|
||||
The command:
|
||||
.Bd -literal -offset indent
|
||||
date 8506131627
|
||||
.Ed
|
||||
.Pp
|
||||
@@ -167,10 +245,15 @@ without modifying the date.
|
||||
.Sh ENVIRONMENT VARIABLES
|
||||
The execution of
|
||||
.Nm
|
||||
is affected by the following evironment variables:
|
||||
is affected by the following environment variables:
|
||||
.Bl -tag -width Ds
|
||||
.It Ev TZ
|
||||
The timezone to use when displaying dates.
|
||||
The normal format is a pathname relative to
|
||||
.Dq Pa /usr/share/zoneinfo .
|
||||
For example, the command
|
||||
.Dq TZ=America/Los_Angeles date
|
||||
displays the current time in California.
|
||||
See
|
||||
.Xr environ 7
|
||||
for more information.
|
||||
@@ -185,6 +268,7 @@ A record of the user setting the time.
|
||||
.Sh SEE ALSO
|
||||
.Xr gettimeofday 2 ,
|
||||
.Xr strftime 3 ,
|
||||
.Xr strptime 3 ,
|
||||
.Xr utmp 5 ,
|
||||
.Xr timed 8
|
||||
.Rs
|
||||
|
||||
+103
-65
@@ -30,17 +30,17 @@
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: date.c,v 1.6 1995/10/23 20:26:53 ache Exp $
|
||||
* $Id: date.c,v 1.7.2.5 1997/10/01 06:12:58 danny Exp $
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
static char copyright[] =
|
||||
static char const copyright[] =
|
||||
"@(#) Copyright (c) 1985, 1987, 1988, 1993\n\
|
||||
The Regents of the University of California. All rights reserved.\n";
|
||||
#endif /* not lint */
|
||||
|
||||
#ifndef lint
|
||||
static char sccsid[] = "@(#)date.c 8.1 (Berkeley) 5/31/93";
|
||||
static char const sccsid[] = "@(#)date.c 8.2 (Berkeley) 4/28/95";
|
||||
#endif /* not lint */
|
||||
|
||||
#include <sys/param.h>
|
||||
@@ -57,11 +57,12 @@ static char sccsid[] = "@(#)date.c 8.1 (Berkeley) 5/31/93";
|
||||
#include <locale.h>
|
||||
|
||||
#include "extern.h"
|
||||
#include "vary.h"
|
||||
|
||||
time_t tval;
|
||||
int retval, nflag;
|
||||
|
||||
static void setthetime __P((char *));
|
||||
static void setthetime __P((const char *, const char *));
|
||||
static void badformat __P((void));
|
||||
static void usage __P((void));
|
||||
|
||||
@@ -77,14 +78,19 @@ main(argc, argv)
|
||||
struct timezone tz;
|
||||
int ch, rflag;
|
||||
char *format, buf[1024];
|
||||
char *endptr;
|
||||
char *endptr, *fmt;
|
||||
int set_timezone;
|
||||
struct vary *v;
|
||||
const struct vary *badv;
|
||||
struct tm lt;
|
||||
|
||||
v = NULL;
|
||||
fmt = NULL;
|
||||
(void) setlocale(LC_TIME, "");
|
||||
tz.tz_dsttime = tz.tz_minuteswest = 0;
|
||||
rflag = 0;
|
||||
set_timezone = 0;
|
||||
while ((ch = getopt(argc, argv, "d:nr:ut:")) != EOF)
|
||||
while ((ch = getopt(argc, argv, "d:f:nr:t:uv:")) != -1)
|
||||
switch((char)ch) {
|
||||
case 'd': /* daylight savings time */
|
||||
tz.tz_dsttime = strtol(optarg, &endptr, 10) ? 1 : 0;
|
||||
@@ -92,6 +98,9 @@ main(argc, argv)
|
||||
usage();
|
||||
set_timezone = 1;
|
||||
break;
|
||||
case 'f':
|
||||
fmt = optarg;
|
||||
break;
|
||||
case 'n': /* don't set network */
|
||||
nflag = 1;
|
||||
break;
|
||||
@@ -99,9 +108,6 @@ main(argc, argv)
|
||||
rflag = 1;
|
||||
tval = atol(optarg);
|
||||
break;
|
||||
case 'u': /* do everything in GMT */
|
||||
(void)setenv("TZ", "GMT0", 1);
|
||||
break;
|
||||
case 't': /* minutes west of GMT */
|
||||
/* error check; don't allow "PST" */
|
||||
tz.tz_minuteswest = strtol(optarg, &endptr, 10);
|
||||
@@ -109,6 +115,12 @@ main(argc, argv)
|
||||
usage();
|
||||
set_timezone = 1;
|
||||
break;
|
||||
case 'u': /* do everything in GMT */
|
||||
(void)setenv("TZ", "GMT0", 1);
|
||||
break;
|
||||
case 'v':
|
||||
v = vary_append(v, optarg);
|
||||
break;
|
||||
default:
|
||||
usage();
|
||||
}
|
||||
@@ -117,7 +129,7 @@ main(argc, argv)
|
||||
|
||||
/*
|
||||
* If -d or -t, set the timezone or daylight savings time; this
|
||||
* doesn't belong here, there kernel should not know about either.
|
||||
* doesn't belong here; the kernel should not know about either.
|
||||
*/
|
||||
if (set_timezone && settimeofday((struct timeval *)NULL, &tz))
|
||||
err(1, "settimeofday (timezone)");
|
||||
@@ -134,78 +146,104 @@ main(argc, argv)
|
||||
}
|
||||
|
||||
if (*argv) {
|
||||
setthetime(*argv);
|
||||
setthetime(fmt, *argv);
|
||||
++argv;
|
||||
}
|
||||
} else if (fmt != NULL)
|
||||
usage();
|
||||
|
||||
if (*argv && **argv == '+')
|
||||
format = *argv + 1;
|
||||
|
||||
(void)strftime(buf, sizeof(buf), format, localtime(&tval));
|
||||
lt = *localtime(&tval);
|
||||
badv = vary_apply(v, <);
|
||||
if (badv) {
|
||||
fprintf(stderr, "%s: Cannot apply date adjustment\n",
|
||||
badv->arg);
|
||||
vary_destroy(v);
|
||||
usage();
|
||||
}
|
||||
vary_destroy(v);
|
||||
(void)strftime(buf, sizeof(buf), format, <);
|
||||
(void)printf("%s\n", buf);
|
||||
exit(retval);
|
||||
}
|
||||
|
||||
#define ATOI2(ar) ((ar)[0] - '0') * 10 + ((ar)[1] - '0'); (ar) += 2;
|
||||
void
|
||||
setthetime(p)
|
||||
register char *p;
|
||||
setthetime(fmt, p)
|
||||
const char *fmt;
|
||||
register const char *p;
|
||||
{
|
||||
register struct tm *lt;
|
||||
struct timeval tv;
|
||||
char *dot, *t;
|
||||
const char *dot, *t;
|
||||
|
||||
for (t = p, dot = NULL; *t; ++t) {
|
||||
if (isdigit(*t))
|
||||
continue;
|
||||
if (*t == '.' && dot == NULL) {
|
||||
dot = t;
|
||||
continue;
|
||||
if (fmt != NULL) {
|
||||
lt = localtime(&tval);
|
||||
t = strptime(p, fmt, lt);
|
||||
if (t == NULL) {
|
||||
fprintf(stderr, "Failed conversion of ``%s''"
|
||||
" using format ``%s''\n", p, fmt);
|
||||
lt = localtime(&tval);
|
||||
return;
|
||||
} else if (*t != '\0')
|
||||
fprintf(stderr, "Warning: Ignoring %d extraneous"
|
||||
" characters in date string (%s)\n",
|
||||
strlen(t), t);
|
||||
} else {
|
||||
for (t = p, dot = NULL; *t; ++t) {
|
||||
if (isdigit(*t))
|
||||
continue;
|
||||
if (*t == '.' && dot == NULL) {
|
||||
dot = t;
|
||||
continue;
|
||||
}
|
||||
badformat();
|
||||
}
|
||||
badformat();
|
||||
}
|
||||
|
||||
lt = localtime(&tval);
|
||||
lt = localtime(&tval);
|
||||
|
||||
if (dot != NULL) { /* .ss */
|
||||
*dot++ = '\0';
|
||||
if (strlen(dot) != 2)
|
||||
badformat();
|
||||
lt->tm_sec = ATOI2(dot);
|
||||
if (lt->tm_sec > 61)
|
||||
badformat();
|
||||
} else
|
||||
lt->tm_sec = 0;
|
||||
if (dot != NULL) { /* .ss */
|
||||
dot++; /* *dot++ = '\0'; */
|
||||
if (strlen(dot) != 2)
|
||||
badformat();
|
||||
lt->tm_sec = ATOI2(dot);
|
||||
if (lt->tm_sec > 61)
|
||||
badformat();
|
||||
} else
|
||||
lt->tm_sec = 0;
|
||||
|
||||
switch (strlen(p)) {
|
||||
case 10: /* yy */
|
||||
lt->tm_year = ATOI2(p);
|
||||
if (lt->tm_year < 69) /* hack for 2000 ;-} */
|
||||
lt->tm_year += 100;
|
||||
/* FALLTHROUGH */
|
||||
case 8: /* mm */
|
||||
lt->tm_mon = ATOI2(p);
|
||||
if (lt->tm_mon > 12)
|
||||
/* if p has a ".ss" field then let's pretend it's not there */
|
||||
switch (strlen(p) - ((dot != NULL) ? 3 : 0)) {
|
||||
case 10: /* yy */
|
||||
lt->tm_year = ATOI2(p);
|
||||
if (lt->tm_year < 69) /* hack for 2000 ;-} */
|
||||
lt->tm_year += 100;
|
||||
/* FALLTHROUGH */
|
||||
case 8: /* mm */
|
||||
lt->tm_mon = ATOI2(p);
|
||||
if (lt->tm_mon > 12)
|
||||
badformat();
|
||||
--lt->tm_mon; /* time struct is 0 - 11 */
|
||||
/* FALLTHROUGH */
|
||||
case 6: /* dd */
|
||||
lt->tm_mday = ATOI2(p);
|
||||
if (lt->tm_mday > 31)
|
||||
badformat();
|
||||
/* FALLTHROUGH */
|
||||
case 4: /* HH */
|
||||
lt->tm_hour = ATOI2(p);
|
||||
if (lt->tm_hour > 23)
|
||||
badformat();
|
||||
/* FALLTHROUGH */
|
||||
case 2: /* MM */
|
||||
lt->tm_min = ATOI2(p);
|
||||
if (lt->tm_min > 59)
|
||||
badformat();
|
||||
break;
|
||||
default:
|
||||
badformat();
|
||||
--lt->tm_mon; /* time struct is 0 - 11 */
|
||||
/* FALLTHROUGH */
|
||||
case 6: /* dd */
|
||||
lt->tm_mday = ATOI2(p);
|
||||
if (lt->tm_mday > 31)
|
||||
badformat();
|
||||
/* FALLTHROUGH */
|
||||
case 4: /* hh */
|
||||
lt->tm_hour = ATOI2(p);
|
||||
if (lt->tm_hour > 23)
|
||||
badformat();
|
||||
/* FALLTHROUGH */
|
||||
case 2: /* mm */
|
||||
lt->tm_min = ATOI2(p);
|
||||
if (lt->tm_min > 59)
|
||||
badformat();
|
||||
break;
|
||||
default:
|
||||
badformat();
|
||||
}
|
||||
}
|
||||
|
||||
/* convert broken-down time to GMT clock time */
|
||||
@@ -237,8 +275,8 @@ badformat()
|
||||
static void
|
||||
usage()
|
||||
{
|
||||
(void)fprintf(stderr,
|
||||
"usage: date [-nu] [-d dst] [-r seconds] [-t west] [+format]\n");
|
||||
(void)fprintf(stderr, " [yy[mm[dd[hh]]]]mm[.ss]]\n");
|
||||
(void)fprintf(stderr, "%s\n%s\n",
|
||||
"usage: date [-nu] [-d dst] [-r seconds] [-t west] [+format]",
|
||||
" [-v [+|-]val[ymwdHM]] ... [-f fmt date | [[[[yy]mm]dd]HH]MM[.ss]]");
|
||||
exit(1);
|
||||
}
|
||||
+3
-3
@@ -30,11 +30,11 @@
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: netdate.c,v 1.3 1995/05/30 00:06:41 rgrimes Exp $
|
||||
* $Id: netdate.c,v 1.3.6.1 1997/03/10 19:51:16 guido Exp $
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
static char sccsid[] = "@(#)netdate.c 8.1 (Berkeley) 5/31/93";
|
||||
static char const sccsid[] = "@(#)netdate.c 8.1 (Berkeley) 5/31/93";
|
||||
#endif /* not lint */
|
||||
|
||||
#include <sys/param.h>
|
||||
@@ -116,7 +116,7 @@ netsettime(tval)
|
||||
warn("gethostname");
|
||||
goto bad;
|
||||
}
|
||||
(void)strncpy(msg.tsp_name, hostname, sizeof(msg.tsp_name));
|
||||
(void)strncpy(msg.tsp_name, hostname, sizeof(msg.tsp_name) - 1);
|
||||
msg.tsp_name[sizeof(msg.tsp_name) - 1] = '\0';
|
||||
msg.tsp_seq = htons((u_short)0);
|
||||
msg.tsp_time.tv_sec = htonl((u_long)tval);
|
||||
|
||||
+384
@@ -0,0 +1,384 @@
|
||||
#include <time.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include "vary.h"
|
||||
|
||||
struct trans {
|
||||
int val;
|
||||
char *str;
|
||||
};
|
||||
|
||||
static struct trans trans_mon[] = {
|
||||
{ 1, "january" }, { 2, "february" }, { 3, "march" }, { 4, "april" },
|
||||
{ 6, "june" }, { 7, "july" }, { 8, "august" }, { 9, "september" },
|
||||
{ 10, "october" }, { 11, "november" }, { 12, "december" },
|
||||
{ -1, NULL }
|
||||
};
|
||||
|
||||
static struct trans trans_wday[] = {
|
||||
{ 0, "sunday" }, { 1, "monday" }, { 2, "tuesday" }, { 3, "wednesday" },
|
||||
{ 4, "thursday" }, { 5, "friday" }, { 6, "saturday" },
|
||||
{ -1, NULL }
|
||||
};
|
||||
|
||||
static char digits[] = "0123456789";
|
||||
|
||||
static int
|
||||
trans(const struct trans t[], const char *arg)
|
||||
{
|
||||
int f;
|
||||
|
||||
for (f = 0; t[f].val != -1; f++)
|
||||
if (!strncasecmp(t[f].str, arg, 3) ||
|
||||
!strncasecmp(t[f].str, arg, strlen(t[f].str)))
|
||||
return t[f].val;
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
struct vary *
|
||||
vary_append(struct vary *v, char *arg)
|
||||
{
|
||||
struct vary *result, **nextp;
|
||||
|
||||
if (v) {
|
||||
result = v;
|
||||
while (v->next)
|
||||
v = v->next;
|
||||
nextp = &v->next;
|
||||
} else
|
||||
nextp = &result;
|
||||
|
||||
*nextp = (struct vary *)malloc(sizeof(struct vary));
|
||||
(*nextp)->arg = arg;
|
||||
(*nextp)->next = NULL;
|
||||
return result;
|
||||
}
|
||||
|
||||
static int mdays[12] = { 31, 0, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };
|
||||
|
||||
static int
|
||||
daysinmonth(const struct tm *t)
|
||||
{
|
||||
int year;
|
||||
|
||||
year = t->tm_year + 1900;
|
||||
|
||||
if (t->tm_mon == 1)
|
||||
if (!(year % 400))
|
||||
return 29;
|
||||
else if (!(year % 100))
|
||||
return 28;
|
||||
else if (!(year % 4))
|
||||
return 29;
|
||||
else
|
||||
return 28;
|
||||
else if (t->tm_mon >= 0 && t->tm_mon < 12)
|
||||
return mdays[t->tm_mon];
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
static int
|
||||
adjyear(struct tm *t, char type, int val)
|
||||
{
|
||||
switch (type) {
|
||||
case '+':
|
||||
t->tm_year += val;
|
||||
break;
|
||||
case '-':
|
||||
t->tm_year -= val;
|
||||
break;
|
||||
default:
|
||||
t->tm_year = val;
|
||||
if (t->tm_year < 69)
|
||||
t->tm_year += 100; /* as per date.c */
|
||||
else if (t->tm_year > 1900)
|
||||
t->tm_year -= 1900; /* struct tm holds years since 1900 */
|
||||
break;
|
||||
}
|
||||
return mktime(t) != -1;
|
||||
}
|
||||
|
||||
static int
|
||||
adjmon(struct tm *t, char type, int val, int istext)
|
||||
{
|
||||
if (val < 0)
|
||||
return 0;
|
||||
|
||||
switch (type) {
|
||||
case '+':
|
||||
if (istext)
|
||||
if (val <= t->tm_mon)
|
||||
val += 11 - t->tm_mon; /* early next year */
|
||||
else
|
||||
val -= t->tm_mon + 1; /* later this year */
|
||||
if (!adjyear(t, '+', (t->tm_mon + val) / 12))
|
||||
return 0;
|
||||
val %= 12;
|
||||
t->tm_mon += val;
|
||||
if (t->tm_mon > 11)
|
||||
t->tm_mon -= 12;
|
||||
break;
|
||||
|
||||
case '-':
|
||||
if (istext)
|
||||
if (val-1 > t->tm_mon)
|
||||
val = 13 - val + t->tm_mon; /* later last year */
|
||||
else
|
||||
val = t->tm_mon - val + 1; /* early this year */
|
||||
if (!adjyear(t, '-', val / 12))
|
||||
return 0;
|
||||
val %= 12;
|
||||
if (val > t->tm_mon) {
|
||||
if (!adjyear(t, '-', 1))
|
||||
return 0;
|
||||
val -= 12;
|
||||
}
|
||||
t->tm_mon -= val;
|
||||
break;
|
||||
|
||||
default:
|
||||
if (val > 12 || val < 1)
|
||||
return 0;
|
||||
t->tm_mon = --val;
|
||||
}
|
||||
|
||||
return mktime(t) != -1;
|
||||
}
|
||||
|
||||
static int
|
||||
adjday(struct tm *t, char type, int val)
|
||||
{
|
||||
int mdays;
|
||||
switch (type) {
|
||||
case '+':
|
||||
while (val) {
|
||||
mdays = daysinmonth(t);
|
||||
if (val > mdays - t->tm_mday) {
|
||||
val -= mdays - t->tm_mday + 1;
|
||||
t->tm_mday = 1;
|
||||
if (!adjmon(t, '+', 1, 0))
|
||||
return 0;
|
||||
} else {
|
||||
t->tm_mday += val;
|
||||
val = 0;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case '-':
|
||||
while (val)
|
||||
if (val >= t->tm_mday) {
|
||||
val -= t->tm_mday;
|
||||
t->tm_mday = 1;
|
||||
if (!adjmon(t, '-', 1, 0))
|
||||
return 0;
|
||||
t->tm_mday = daysinmonth(t);
|
||||
} else {
|
||||
t->tm_mday -= val;
|
||||
val = 0;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
if (val > 0 && val <= daysinmonth(t))
|
||||
t->tm_mday = val;
|
||||
else
|
||||
return 0;
|
||||
break;
|
||||
}
|
||||
|
||||
return mktime(t) != -1;
|
||||
}
|
||||
|
||||
static int
|
||||
adjwday(struct tm *t, char type, int val, int istext)
|
||||
{
|
||||
if (val < 0)
|
||||
return 0;
|
||||
|
||||
switch (type) {
|
||||
case '+':
|
||||
if (istext)
|
||||
if (val < t->tm_wday)
|
||||
val = 7 - t->tm_wday + val; /* early next week */
|
||||
else
|
||||
val -= t->tm_wday; /* later this week */
|
||||
else
|
||||
val *= 7; /* "-W +5" == "5 weeks in the future" */
|
||||
return adjday(t, '+', val);
|
||||
case '-':
|
||||
if (istext)
|
||||
if (val > t->tm_wday)
|
||||
val = 7 - val + t->tm_wday; /* later last week */
|
||||
else
|
||||
val = t->tm_wday - val; /* early this week */
|
||||
else
|
||||
val *= 7; /* "-W -5" == "5 weeks ago" */
|
||||
return adjday(t, '-', val);
|
||||
default:
|
||||
if (val < t->tm_wday)
|
||||
return adjday(t, '-', t->tm_wday - val);
|
||||
else if (val > 6)
|
||||
return 0;
|
||||
else if (val > t->tm_wday)
|
||||
return adjday(t, '+', val - t->tm_wday);
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
static int
|
||||
adjhour(struct tm *t, char type, int val)
|
||||
{
|
||||
if (val < 0)
|
||||
return 0;
|
||||
|
||||
switch (type) {
|
||||
case '+':
|
||||
if (!adjday(t, '+', (t->tm_hour + val) / 24))
|
||||
return 0;
|
||||
val %= 24;
|
||||
t->tm_hour += val;
|
||||
if (t->tm_hour > 23)
|
||||
t->tm_hour -= 24;
|
||||
break;
|
||||
|
||||
case '-':
|
||||
if (!adjday(t, '-', val / 24))
|
||||
return 0;
|
||||
val %= 24;
|
||||
if (val > t->tm_hour) {
|
||||
if (!adjday(t, '-', 1))
|
||||
return 0;
|
||||
val -= 24;
|
||||
}
|
||||
t->tm_hour -= val;
|
||||
break;
|
||||
|
||||
default:
|
||||
if (val > 23)
|
||||
return 0;
|
||||
t->tm_hour = val;
|
||||
}
|
||||
|
||||
return mktime(t) != -1;
|
||||
}
|
||||
|
||||
static int
|
||||
adjmin(struct tm *t, char type, int val)
|
||||
{
|
||||
if (val < 0)
|
||||
return 0;
|
||||
|
||||
switch (type) {
|
||||
case '+':
|
||||
if (!adjhour(t, '+', (t->tm_min + val) / 60))
|
||||
return 0;
|
||||
val %= 60;
|
||||
t->tm_min += val;
|
||||
if (t->tm_min > 59)
|
||||
t->tm_min -= 60;
|
||||
break;
|
||||
|
||||
case '-':
|
||||
if (!adjhour(t, '-', val / 60))
|
||||
return 0;
|
||||
val %= 60;
|
||||
if (val > t->tm_min) {
|
||||
if (!adjhour(t, '-', 1))
|
||||
return 0;
|
||||
val -= 60;
|
||||
}
|
||||
t->tm_min -= val;
|
||||
break;
|
||||
|
||||
default:
|
||||
if (val > 59)
|
||||
return 0;
|
||||
t->tm_min = val;
|
||||
}
|
||||
|
||||
return mktime(t) != -1;
|
||||
}
|
||||
|
||||
const struct vary *
|
||||
vary_apply(const struct vary *v, struct tm *t)
|
||||
{
|
||||
char type;
|
||||
char which;
|
||||
char *arg;
|
||||
int len;
|
||||
int val;
|
||||
|
||||
for (; v; v = v->next) {
|
||||
type = *v->arg;
|
||||
arg = v->arg;
|
||||
if (type == '+' || type == '-')
|
||||
arg++;
|
||||
else
|
||||
type = '\0';
|
||||
len = strlen(arg);
|
||||
if (len < 2)
|
||||
return v;
|
||||
|
||||
if (strspn(arg, digits) != len-1) {
|
||||
val = trans(trans_wday, arg);
|
||||
if (val != -1) {
|
||||
if (!adjwday(t, type, val, 1))
|
||||
return v;
|
||||
} else {
|
||||
val = trans(trans_mon, arg);
|
||||
if (val != -1) {
|
||||
if (!adjmon(t, type, val, 1))
|
||||
return v;
|
||||
} else
|
||||
return v;
|
||||
}
|
||||
} else {
|
||||
val = atoi(arg);
|
||||
which = arg[len-1];
|
||||
|
||||
switch (which) {
|
||||
case 'M':
|
||||
if (!adjmin(t, type, val))
|
||||
return v;
|
||||
break;
|
||||
case 'H':
|
||||
if (!adjhour(t, type, val))
|
||||
return v;
|
||||
break;
|
||||
case 'd':
|
||||
if (!adjday(t, type, val))
|
||||
return v;
|
||||
break;
|
||||
case 'w':
|
||||
if (!adjwday(t, type, val, 0))
|
||||
return v;
|
||||
break;
|
||||
case 'm':
|
||||
if (!adjmon(t, type, val, 0))
|
||||
return v;
|
||||
break;
|
||||
case 'y':
|
||||
if (!adjyear(t, type, val))
|
||||
return v;
|
||||
break;
|
||||
default:
|
||||
return v;
|
||||
}
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
void
|
||||
vary_destroy(struct vary *v)
|
||||
{
|
||||
struct vary *n;
|
||||
|
||||
while (v) {
|
||||
n = v->next;
|
||||
free(v);
|
||||
v = n;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
struct vary {
|
||||
char *arg;
|
||||
struct vary *next;
|
||||
};
|
||||
|
||||
extern struct vary *vary_append(struct vary *v, char *arg);
|
||||
extern const struct vary *vary_apply(const struct vary *v, struct tm *t);
|
||||
extern void vary_destroy(struct vary *v);
|
||||
+2
-2
@@ -34,11 +34,11 @@
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: args.c,v 1.3 1994/09/24 02:54:42 davidg Exp $
|
||||
* $Id: args.c,v 1.3.8.1 1996/11/21 16:30:28 phk Exp $
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
static char sccsid[] = "@(#)args.c 8.3 (Berkeley) 4/2/94";
|
||||
static char const sccsid[] = "@(#)args.c 8.3 (Berkeley) 4/2/94";
|
||||
#endif /* not lint */
|
||||
|
||||
#include <sys/types.h>
|
||||
|
||||
+3
-3
@@ -34,11 +34,11 @@
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: conv.c,v 1.3 1994/09/24 02:54:44 davidg Exp $
|
||||
* $Id: conv.c,v 1.3.8.1 1996/11/21 16:30:30 phk Exp $
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
static char sccsid[] = "@(#)conv.c 8.3 (Berkeley) 4/2/94";
|
||||
static char const sccsid[] = "@(#)conv.c 8.3 (Berkeley) 4/2/94";
|
||||
#endif /* not lint */
|
||||
|
||||
#include <sys/param.h>
|
||||
@@ -129,7 +129,7 @@ block()
|
||||
* Copy records (max cbsz size chunks) into the output buffer. The
|
||||
* translation is done as we copy into the output buffer.
|
||||
*/
|
||||
ch = 0; /* Help the compiler. */
|
||||
ch = 0;
|
||||
for (inp = in.dbp - in.dbcnt, outp = out.dbp; in.dbcnt;) {
|
||||
maxlen = MIN(cbsz, in.dbcnt);
|
||||
if ((t = ctab) != NULL)
|
||||
|
||||
+2
-2
@@ -34,11 +34,11 @@
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: conv_tab.c,v 1.2 1994/09/24 02:54:47 davidg Exp $
|
||||
* $Id: conv_tab.c,v 1.3 1995/01/17 23:04:28 ache Exp $
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
static char sccsid[] = "@(#)conv_tab.c 8.1 (Berkeley) 5/31/93";
|
||||
static char const sccsid[] = "@(#)conv_tab.c 8.1 (Berkeley) 5/31/93";
|
||||
#endif /* not lint */
|
||||
|
||||
#include <sys/types.h>
|
||||
|
||||
+2
-2
@@ -33,7 +33,7 @@
|
||||
.\" SUCH DAMAGE.
|
||||
.\"
|
||||
.\" @(#)dd.1 8.2 (Berkeley) 1/13/94
|
||||
.\" $Id: dd.1,v 1.4 1997/02/22 14:02:43 peter Exp $
|
||||
.\" $Id: dd.1,v 1.2.8.1 1997/02/28 07:54:33 mpp Exp $
|
||||
.\"
|
||||
.Dd January 13, 1994
|
||||
.Dt DD 1
|
||||
@@ -148,7 +148,7 @@ is one of the symbols from the following list.
|
||||
The same as the
|
||||
.Cm unblock
|
||||
value except that characters are translated from
|
||||
.Tn ECBDIC
|
||||
.Tn EBCDIC
|
||||
to
|
||||
.Tn ASCII
|
||||
before the
|
||||
|
||||
+15
-13
@@ -34,17 +34,17 @@
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: dd.c,v 1.5 1995/10/23 21:31:48 ache Exp $
|
||||
* $Id: dd.c,v 1.5.2.2 1997/08/21 02:52:39 jlemon Exp $
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
static char copyright[] =
|
||||
static char const copyright[] =
|
||||
"@(#) Copyright (c) 1991, 1993, 1994\n\
|
||||
The Regents of the University of California. All rights reserved.\n";
|
||||
#endif /* not lint */
|
||||
|
||||
#ifndef lint
|
||||
static char sccsid[] = "@(#)dd.c 8.5 (Berkeley) 4/2/94";
|
||||
static char const sccsid[] = "@(#)dd.c 8.5 (Berkeley) 4/2/94";
|
||||
#endif /* not lint */
|
||||
|
||||
#include <sys/param.h>
|
||||
@@ -169,7 +169,7 @@ setup()
|
||||
* Truncate the output file; ignore errors because it fails on some
|
||||
* kinds of output files, tapes, for example.
|
||||
*/
|
||||
if (ddflags & (C_OF | C_SEEK | C_NOTRUNC) == (C_OF | C_SEEK))
|
||||
if ((ddflags & (C_OF | C_SEEK | C_NOTRUNC)) == (C_OF | C_SEEK))
|
||||
(void)ftruncate(out.fd, (off_t)out.offset * out.dbsz);
|
||||
|
||||
/*
|
||||
@@ -236,19 +236,18 @@ getfdtype(io)
|
||||
static void
|
||||
dd_in()
|
||||
{
|
||||
int flags, n;
|
||||
int n;
|
||||
|
||||
for (flags = ddflags;;) {
|
||||
for (;;) {
|
||||
if (cpy_cnt && (st.in_full + st.in_part) >= cpy_cnt)
|
||||
return;
|
||||
|
||||
/*
|
||||
* Zero the buffer first if trying to recover from errors so
|
||||
* lose the minimum amount of data. If doing block operations
|
||||
* Zero the buffer first if sync; If doing block operations
|
||||
* use spaces.
|
||||
*/
|
||||
if ((flags & (C_NOERROR|C_SYNC)) == (C_NOERROR|C_SYNC))
|
||||
if (flags & (C_BLOCK|C_UNBLOCK))
|
||||
if (ddflags & C_SYNC)
|
||||
if (ddflags & (C_BLOCK|C_UNBLOCK))
|
||||
memset(in.dbp, ' ', in.dbsz);
|
||||
else
|
||||
memset(in.dbp, 0, in.dbsz);
|
||||
@@ -265,7 +264,7 @@ dd_in()
|
||||
* If noerror not specified, die. POSIX requires that
|
||||
* the warning message be followed by an I/O display.
|
||||
*/
|
||||
if (!(flags & C_NOERROR))
|
||||
if (!(ddflags & C_NOERROR))
|
||||
err(1, "%s", in.name);
|
||||
warn("%s", in.name);
|
||||
summary();
|
||||
@@ -341,8 +340,11 @@ dd_close()
|
||||
block_close();
|
||||
else if (cfunc == unblock)
|
||||
unblock_close();
|
||||
if (ddflags & C_OSYNC && out.dbcnt < out.dbsz) {
|
||||
memset(out.dbp, 0, out.dbsz - out.dbcnt);
|
||||
if (ddflags & C_OSYNC && out.dbcnt && out.dbcnt < out.dbsz) {
|
||||
if (ddflags & (C_BLOCK|C_UNBLOCK))
|
||||
memset(out.dbp, ' ', out.dbsz - out.dbcnt);
|
||||
else
|
||||
memset(out.dbp, 0, out.dbsz - out.dbcnt);
|
||||
out.dbcnt = out.dbsz;
|
||||
}
|
||||
if (out.dbcnt)
|
||||
|
||||
+2
-2
@@ -34,11 +34,11 @@
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: misc.c,v 1.2 1994/09/24 02:55:01 davidg Exp $
|
||||
* $Id: misc.c,v 1.2.8.1 1996/11/21 16:30:35 phk Exp $
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
static char sccsid[] = "@(#)misc.c 8.3 (Berkeley) 4/2/94";
|
||||
static char const sccsid[] = "@(#)misc.c 8.3 (Berkeley) 4/2/94";
|
||||
#endif /* not lint */
|
||||
|
||||
#include <sys/types.h>
|
||||
|
||||
+3
-3
@@ -34,11 +34,11 @@
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id$
|
||||
* $Id: position.c,v 1.2 1994/09/24 02:55:03 davidg Exp $
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
static char sccsid[] = "@(#)position.c 8.3 (Berkeley) 4/2/94";
|
||||
static char const sccsid[] = "@(#)position.c 8.3 (Berkeley) 4/2/94";
|
||||
#endif /* not lint */
|
||||
|
||||
#include <sys/types.h>
|
||||
@@ -67,7 +67,7 @@ pos_in()
|
||||
|
||||
/* If not a character, pipe or tape device, try to seek on it. */
|
||||
if (!(in.flags & (ISCHR|ISPIPE|ISTAPE))) {
|
||||
if (lseek(in.fd, (off_t)(in.offset * in.dbsz), SEEK_CUR) == -1)
|
||||
if (lseek(in.fd, (off_t)in.offset * in.dbsz, SEEK_CUR) == -1)
|
||||
err(1, "%s", in.name);
|
||||
return;
|
||||
}
|
||||
|
||||
+2
-2
@@ -30,7 +30,7 @@
|
||||
.\" SUCH DAMAGE.
|
||||
.\"
|
||||
.\" @(#)df.1 8.2 (Berkeley) 1/13/94
|
||||
.\" $Id: df.1,v 1.4 1996/08/29 18:05:48 wosch Exp $
|
||||
.\" $Id: df.1,v 1.4.2.1 1996/12/13 17:15:10 joerg Exp $
|
||||
.\"
|
||||
.Dd January 13, 1994
|
||||
.Dt DF 1
|
||||
@@ -99,7 +99,7 @@ will display statistics for UFS and LFS filesystems.
|
||||
.Sh ENVIRONMENTAL VARIABLES
|
||||
.Bl -tag -width BLOCKSIZE
|
||||
.It Ev BLOCKSIZE
|
||||
If the environmental variable
|
||||
If the environment variable
|
||||
.Ev BLOCKSIZE
|
||||
is set, the block counts will be displayed in units of that size block.
|
||||
.El
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
.\" SUCH DAMAGE.
|
||||
.\"
|
||||
.\" From: @(#)hostname.1 8.1 (Berkeley) 5/31/93
|
||||
.\" $Id: domainname.1,v 1.1 1994/09/18 21:23:36 wollman Exp $
|
||||
.\" $Id: domainname.1,v 1.2 1995/01/14 17:02:33 ats Exp $
|
||||
.\"
|
||||
.Dd September 18, 1994
|
||||
.Dt DOMAINNAME 1
|
||||
@@ -46,7 +46,7 @@
|
||||
prints the name of the current YP/NIS domain. The super-user can
|
||||
set the domain name by supplying an argument; this is usually done in the
|
||||
network initialization script
|
||||
.Pa /etc/netstart ,
|
||||
.Pa /etc/rc.network ,
|
||||
normally run at boot
|
||||
time.
|
||||
.Sh NOTA BENE
|
||||
|
||||
@@ -40,7 +40,7 @@ static char copyright[] =
|
||||
#ifndef lint
|
||||
/*static char sccsid[] = "From: @(#)hostname.c 8.1 (Berkeley) 5/31/93"; */
|
||||
static const char rcsid[] =
|
||||
"$Id: domainname.c,v 1.4 1994/09/26 02:14:27 wollman Exp $";
|
||||
"$Id: domainname.c,v 1.5 1995/03/19 13:28:17 joerg Exp $";
|
||||
#endif /* not lint */
|
||||
|
||||
#include <sys/param.h>
|
||||
@@ -51,14 +51,26 @@ static const char rcsid[] =
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
|
||||
void usage __P((void));
|
||||
|
||||
int
|
||||
main(argc,argv)
|
||||
int argc;
|
||||
char *argv[];
|
||||
{
|
||||
int ch;
|
||||
char domainname[MAXHOSTNAMELEN];
|
||||
|
||||
argc--, argv++;
|
||||
while ((ch = getopt(argc, argv, "")) != -1)
|
||||
switch (ch) {
|
||||
default:
|
||||
usage();
|
||||
}
|
||||
argc -= optind;
|
||||
argv += optind;
|
||||
|
||||
if (argc > 1)
|
||||
usage();
|
||||
|
||||
if (*argv) {
|
||||
if (setdomainname(*argv, strlen(*argv)))
|
||||
@@ -70,3 +82,10 @@ main(argc,argv)
|
||||
}
|
||||
exit(0);
|
||||
}
|
||||
|
||||
void
|
||||
usage()
|
||||
{
|
||||
(void)fprintf(stderr, "usage: domainname [ypdomain]\n");
|
||||
exit(1);
|
||||
}
|
||||
+2
-2
@@ -1,4 +1,4 @@
|
||||
.\" $Id: ed.1,v 1.7 1996/08/29 18:05:50 wosch Exp $
|
||||
.\" $Id: ed.1,v 1.8 1996/10/05 22:26:02 wosch Exp $
|
||||
.TH ED 1 "21 May 1993"
|
||||
.SH NAME
|
||||
.\" ed, red \- text editor
|
||||
@@ -454,7 +454,7 @@ implementation.
|
||||
.SS COMMANDS
|
||||
All
|
||||
.B ed
|
||||
commands are single characters, though some require additonal parameters.
|
||||
commands are single characters, though some require additional parameters.
|
||||
If a command's parameters extend over several lines, then
|
||||
each line except for the last
|
||||
must be terminated with a backslash (\\).
|
||||
|
||||
+9
-8
@@ -25,7 +25,7 @@
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: main.c,v 1.5 1995/05/30 00:06:47 rgrimes Exp $
|
||||
* $Id: main.c,v 1.6 1996/08/11 16:48:11 ache Exp $
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
@@ -57,9 +57,9 @@ static char *rcsid = "@(#)main.c,v 1.1 1994/02/01 00:34:42 alm Exp";
|
||||
#include <sys/ioctl.h>
|
||||
#include <sys/wait.h>
|
||||
#include <ctype.h>
|
||||
#include <setjmp.h>
|
||||
#include <pwd.h>
|
||||
#include <locale.h>
|
||||
#include <pwd.h>
|
||||
#include <setjmp.h>
|
||||
|
||||
#include "ed.h"
|
||||
|
||||
@@ -100,10 +100,6 @@ char *dps = "*"; /* default command-line prompt */
|
||||
|
||||
char *usage = "usage: %s [-] [-sx] [-p string] [name]\n";
|
||||
|
||||
extern char errmsg[];
|
||||
extern int optind;
|
||||
extern char *optarg;
|
||||
|
||||
/* ed: line editor */
|
||||
int
|
||||
main(argc, argv)
|
||||
@@ -112,12 +108,17 @@ main(argc, argv)
|
||||
{
|
||||
int c, n;
|
||||
long status = 0;
|
||||
#if __GNUC__
|
||||
/* Avoid longjmp clobbering */
|
||||
(void) &argc;
|
||||
(void) &argv;
|
||||
#endif
|
||||
|
||||
(void)setlocale(LC_ALL, "");
|
||||
|
||||
red = (n = strlen(argv[0])) > 2 && argv[0][n - 3] == 'r';
|
||||
top:
|
||||
while ((c = getopt(argc, argv, "p:sx")) != EOF)
|
||||
while ((c = getopt(argc, argv, "p:sx")) != -1)
|
||||
switch(c) {
|
||||
case 'p': /* set prompt */
|
||||
prompt = optarg;
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
.\" SUCH DAMAGE.
|
||||
.\"
|
||||
.\" @(#)hostname.1 8.2 (Berkeley) 4/28/95
|
||||
.\" $Id: hostname.1,v 1.6 1997/02/22 14:03:41 peter Exp $
|
||||
.\" $Id: hostname.1,v 1.3.2.1 1997/02/28 07:54:36 mpp Exp $
|
||||
.\"
|
||||
.Dd April 28, 1995
|
||||
.Dt HOSTNAME 1
|
||||
@@ -47,7 +47,7 @@
|
||||
prints the name of the current host. The super-user can
|
||||
set the hostname by supplying an argument; this is usually done in the
|
||||
network initialization script
|
||||
.Pa /etc/netstart ,
|
||||
.Pa /etc/rc.network ,
|
||||
normally run at boot
|
||||
time.
|
||||
.Pp
|
||||
|
||||
+18
-8
@@ -30,17 +30,17 @@
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id$
|
||||
* $Id: hostname.c,v 1.2 1994/09/24 02:55:40 davidg Exp $
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
static char copyright[] =
|
||||
static char const copyright[] =
|
||||
"@(#) Copyright (c) 1988, 1993\n\
|
||||
The Regents of the University of California. All rights reserved.\n";
|
||||
#endif /* not lint */
|
||||
|
||||
#ifndef lint
|
||||
static char sccsid[] = "@(#)hostname.c 8.1 (Berkeley) 5/31/93";
|
||||
static char const sccsid[] = "@(#)hostname.c 8.1 (Berkeley) 5/31/93";
|
||||
#endif /* not lint */
|
||||
|
||||
#include <sys/param.h>
|
||||
@@ -51,30 +51,32 @@ static char sccsid[] = "@(#)hostname.c 8.1 (Berkeley) 5/31/93";
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
|
||||
void usage __P((void));
|
||||
|
||||
int
|
||||
main(argc,argv)
|
||||
int argc;
|
||||
char *argv[];
|
||||
{
|
||||
extern int optind;
|
||||
int ch, sflag;
|
||||
char *p, hostname[MAXHOSTNAMELEN];
|
||||
|
||||
sflag = 0;
|
||||
while ((ch = getopt(argc, argv, "s")) != EOF)
|
||||
while ((ch = getopt(argc, argv, "s")) != -1)
|
||||
switch (ch) {
|
||||
case 's':
|
||||
sflag = 1;
|
||||
break;
|
||||
case '?':
|
||||
default:
|
||||
(void)fprintf(stderr,
|
||||
"usage: hostname [-s] [hostname]\n");
|
||||
exit(1);
|
||||
usage();
|
||||
}
|
||||
argc -= optind;
|
||||
argv += optind;
|
||||
|
||||
if (argc > 1)
|
||||
usage();
|
||||
|
||||
if (*argv) {
|
||||
if (sethostname(*argv, strlen(*argv)))
|
||||
err(1, "sethostname");
|
||||
@@ -87,3 +89,11 @@ main(argc,argv)
|
||||
}
|
||||
exit(0);
|
||||
}
|
||||
|
||||
void
|
||||
usage()
|
||||
{
|
||||
|
||||
(void)fprintf(stderr, "usage: hostname [-s] [name-of-host]\n");
|
||||
exit(1);
|
||||
}
|
||||
+52
-29
@@ -32,10 +32,10 @@
|
||||
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
.\" SUCH DAMAGE.
|
||||
.\"
|
||||
.\" @(#)kill.1 8.1 (Berkeley) 5/31/93
|
||||
.\" $Id: kill.1,v 1.2 1994/09/24 02:55:43 davidg Exp $
|
||||
.\" @(#)kill.1 8.2 (Berkeley) 4/28/95
|
||||
.\" $Id$
|
||||
.\"
|
||||
.Dd May 31, 1993
|
||||
.Dd April 28, 1995
|
||||
.Dt KILL 1
|
||||
.Os
|
||||
.Sh NAME
|
||||
@@ -43,57 +43,74 @@
|
||||
.Nd terminate or signal a process
|
||||
.Sh SYNOPSIS
|
||||
.Nm kill
|
||||
.Op Fl signal_name
|
||||
.Op Fl s Ar signal_name
|
||||
.Ar pid
|
||||
\&...
|
||||
.Nm kill
|
||||
.Op Fl signal_number
|
||||
.Fl l
|
||||
.Op Ar exit_status
|
||||
.Nm kill
|
||||
.Fl signal_name
|
||||
.Ar pid
|
||||
\&...
|
||||
.Nm kill
|
||||
.Op Fl l
|
||||
.Fl signal_number
|
||||
.Ar pid
|
||||
\&...
|
||||
.Sh DESCRIPTION
|
||||
The kill utility sends the
|
||||
.Dv TERM
|
||||
signal to the processes specified
|
||||
by the pid operand(s).
|
||||
The
|
||||
.Nm
|
||||
utility sends a signal to the processes specified by the pid operand(s).
|
||||
.Pp
|
||||
Only the super-user may send signals to other users' processes.
|
||||
.Pp
|
||||
The options are as follows:
|
||||
.Pp
|
||||
.Bl -tag -width Ds
|
||||
.It Fl l
|
||||
List the signal names.
|
||||
.It Fl s Ar signal_name
|
||||
A symbolic signal name specifying the signal to be sent instead of the
|
||||
default
|
||||
.Dv TERM .
|
||||
.It Fl l Op Ar exit_status
|
||||
If no operand is given, list the signal names; otherwise, write
|
||||
the signal name corresponding to
|
||||
.Ar exit_status .
|
||||
.It Fl signal_name
|
||||
A symbolic signal name specifying the signal to be sent instead of the
|
||||
default
|
||||
.Dv TERM .
|
||||
The
|
||||
.Fl l
|
||||
option displays the signal names.
|
||||
.It Fl signal_number
|
||||
A non-negative decimal integer, specifying the signal to be sent instead
|
||||
of the default
|
||||
.Dv TERM .
|
||||
.El
|
||||
.Pp
|
||||
Some of the more commonly used signals:
|
||||
.Bd -ragged -offset indent -compact
|
||||
.Bl -column XXX TERM
|
||||
.It -1 -1 (super-user broadcast to all processes, or user broadcast
|
||||
to user's processes)
|
||||
.It 0 0 (sh(1) only, signals all members of process group)
|
||||
.It 2 INT (interrupt)
|
||||
.It 3 QUIT (quit)
|
||||
.It 6 ABRT (abort)
|
||||
.It 9 KILL (non-catchable, non-ignorable kill)
|
||||
.It 14 ALRM (alarm clock)
|
||||
.It 15 TERM (software termination signal)
|
||||
The following pids have special meanings:
|
||||
.Bl -tag -width Ds -compact
|
||||
.It -1
|
||||
If superuser, broadcast the signal to all processes; otherwise broadcast
|
||||
to all processes belonging to the user.
|
||||
.El
|
||||
.Ed
|
||||
.Pp
|
||||
.Nm Kill
|
||||
Some of the more commonly used signals:
|
||||
.Bl -tag -width Ds -compact
|
||||
.It 1
|
||||
HUP (hang up)
|
||||
.It 2
|
||||
INT (interrupt)
|
||||
.It 3
|
||||
QUIT (quit)
|
||||
.It 6
|
||||
ABRT (abort)
|
||||
.It 9
|
||||
KILL (non-catchable, non-ignorable kill)
|
||||
.It 14
|
||||
ALRM (alarm clock)
|
||||
.It 15
|
||||
TERM (software termination signal)
|
||||
.El
|
||||
.Pp
|
||||
.Nm
|
||||
is a built-in to
|
||||
.Xr csh 1 ;
|
||||
it allows job specifiers of the form ``%...'' as arguments
|
||||
@@ -109,6 +126,12 @@ for details.
|
||||
.Xr ps 1 ,
|
||||
.Xr kill 2 ,
|
||||
.Xr sigvec 2
|
||||
.Sh STANDARDS
|
||||
The
|
||||
.Nm
|
||||
function is expected to be
|
||||
.St -p1003.2
|
||||
compatible.
|
||||
.Sh HISTORY
|
||||
A
|
||||
.Nm kill
|
||||
|
||||
+75
-32
@@ -30,17 +30,17 @@
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: kill.c,v 1.2 1994/09/24 02:55:44 davidg Exp $
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
static char copyright[] =
|
||||
static char const copyright[] =
|
||||
"@(#) Copyright (c) 1988, 1993, 1994\n\
|
||||
The Regents of the University of California. All rights reserved.\n";
|
||||
#endif /* not lint */
|
||||
|
||||
#ifndef lint
|
||||
static char sccsid[] = "@(#)kill.c 8.3 (Berkeley) 4/2/94";
|
||||
static char const sccsid[] = "@(#)kill.c 8.4 (Berkeley) 4/28/95";
|
||||
#endif /* not lint */
|
||||
|
||||
#include <ctype.h>
|
||||
@@ -52,7 +52,8 @@ static char sccsid[] = "@(#)kill.c 8.3 (Berkeley) 4/2/94";
|
||||
#include <string.h>
|
||||
|
||||
void nosig __P((char *));
|
||||
void printsig __P((FILE *));
|
||||
void printsignals __P((FILE *));
|
||||
int signame_to_signum __P((char *));
|
||||
void usage __P((void));
|
||||
|
||||
int
|
||||
@@ -60,48 +61,70 @@ main(argc, argv)
|
||||
int argc;
|
||||
char *argv[];
|
||||
{
|
||||
const char *const *p;
|
||||
int errors, numsig, pid;
|
||||
char *ep;
|
||||
|
||||
if (argc < 2)
|
||||
usage();
|
||||
|
||||
if (!strcmp(*++argv, "-l")) {
|
||||
printsig(stdout);
|
||||
numsig = SIGTERM;
|
||||
|
||||
argc--, argv++;
|
||||
if (!strcmp(*argv, "-l")) {
|
||||
argc--, argv++;
|
||||
if (argc > 1)
|
||||
usage();
|
||||
if (argc == 1) {
|
||||
if (!isdigit(**argv))
|
||||
usage();
|
||||
numsig = strtol(*argv, &ep, 10);
|
||||
if (!**argv || *ep)
|
||||
errx(1, "illegal signal number: %s", *argv);
|
||||
if (numsig >= 128)
|
||||
numsig -= 128;
|
||||
if (numsig <= 0 || numsig >= NSIG)
|
||||
nosig(*argv);
|
||||
printf("%s\n", sys_signame[numsig]);
|
||||
exit(0);
|
||||
}
|
||||
printsignals(stdout);
|
||||
exit(0);
|
||||
}
|
||||
|
||||
numsig = SIGTERM;
|
||||
if (**argv == '-') {
|
||||
if (!strcmp(*argv, "-s")) {
|
||||
argc--, argv++;
|
||||
if (argc < 1) {
|
||||
warnx("option requires an argument -- s");
|
||||
usage();
|
||||
}
|
||||
if (strcmp(*argv, "0")) {
|
||||
if ((numsig = signame_to_signum(*argv)) < 0)
|
||||
nosig(*argv);
|
||||
} else
|
||||
numsig = 0;
|
||||
argc--, argv++;
|
||||
} else if (**argv == '-') {
|
||||
++*argv;
|
||||
if (isalpha(**argv)) {
|
||||
if (!strncasecmp(*argv, "sig", 3))
|
||||
*argv += 3;
|
||||
for (numsig = NSIG, p = sys_signame + 1; --numsig; ++p)
|
||||
if (!strcasecmp(*p, *argv)) {
|
||||
numsig = p - sys_signame;
|
||||
break;
|
||||
}
|
||||
if (!numsig)
|
||||
if ((numsig = signame_to_signum(*argv)) < 0)
|
||||
nosig(*argv);
|
||||
} else if (isdigit(**argv)) {
|
||||
numsig = strtol(*argv, &ep, 10);
|
||||
if (!*argv || *ep)
|
||||
if (!**argv || *ep)
|
||||
errx(1, "illegal signal number: %s", *argv);
|
||||
if (numsig < 0 || numsig > NSIG)
|
||||
if (numsig < 0 || numsig >= NSIG)
|
||||
nosig(*argv);
|
||||
} else
|
||||
nosig(*argv);
|
||||
++argv;
|
||||
argc--, argv++;
|
||||
}
|
||||
|
||||
if (!*argv)
|
||||
if (argc == 0)
|
||||
usage();
|
||||
|
||||
for (errors = 0; *argv; ++argv) {
|
||||
for (errors = 0; argc; argc--, argv++) {
|
||||
pid = strtol(*argv, &ep, 10);
|
||||
if (!*argv || *ep) {
|
||||
if (!**argv || *ep) {
|
||||
warnx("illegal process id: %s", *argv);
|
||||
errors = 1;
|
||||
} else if (kill(pid, numsig) == -1) {
|
||||
@@ -109,38 +132,58 @@ main(argc, argv)
|
||||
errors = 1;
|
||||
}
|
||||
}
|
||||
|
||||
exit(errors);
|
||||
}
|
||||
|
||||
int
|
||||
signame_to_signum(sig)
|
||||
char *sig;
|
||||
{
|
||||
int n;
|
||||
|
||||
if (!strncasecmp(sig, "sig", 3))
|
||||
sig += 3;
|
||||
for (n = 1; n < NSIG; n++) {
|
||||
if (!strcasecmp(sys_signame[n], sig))
|
||||
return (n);
|
||||
}
|
||||
return (-1);
|
||||
}
|
||||
|
||||
void
|
||||
nosig(name)
|
||||
char *name;
|
||||
{
|
||||
|
||||
warnx("unknown signal %s; valid signals:", name);
|
||||
printsig(stderr);
|
||||
printsignals(stderr);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
void
|
||||
printsig(fp)
|
||||
printsignals(fp)
|
||||
FILE *fp;
|
||||
{
|
||||
const char *const *p;
|
||||
int cnt;
|
||||
int n;
|
||||
|
||||
for (cnt = NSIG, p = sys_signame + 1; --cnt; ++p) {
|
||||
(void)fprintf(fp, "%s ", *p);
|
||||
if (cnt == NSIG / 2)
|
||||
for (n = 1; n < NSIG; n++) {
|
||||
(void)fprintf(fp, "%s", sys_signame[n]);
|
||||
if (n == (NSIG / 2) || n == (NSIG - 1))
|
||||
(void)fprintf(fp, "\n");
|
||||
else
|
||||
(void)fprintf(fp, " ");
|
||||
}
|
||||
(void)fprintf(fp, "\n");
|
||||
}
|
||||
|
||||
void
|
||||
usage()
|
||||
{
|
||||
|
||||
(void)fprintf(stderr, "usage: kill [-l] [-sig] pid ...\n");
|
||||
(void)fprintf(stderr, "%s\n%s\n%s\n%s\n",
|
||||
"usage: kill [-s signal_name] pid ...",
|
||||
" kill -l [exit_status]",
|
||||
" kill -signal_name pid ...",
|
||||
" kill -signal_number pid ...");
|
||||
exit(1);
|
||||
}
|
||||
+7
-6
@@ -30,17 +30,17 @@
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: ln.c,v 1.5 1994/12/06 18:50:44 bde Exp $
|
||||
* $Id: ln.c,v 1.6.2.1 1997/06/06 16:07:40 charnier Exp $
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
static char copyright[] =
|
||||
static char const copyright[] =
|
||||
"@(#) Copyright (c) 1987, 1993, 1994\n\
|
||||
The Regents of the University of California. All rights reserved.\n";
|
||||
#endif /* not lint */
|
||||
|
||||
#ifndef lint
|
||||
static char sccsid[] = "@(#)ln.c 8.2 (Berkeley) 3/31/94";
|
||||
static char const sccsid[] = "@(#)ln.c 8.2 (Berkeley) 3/31/94";
|
||||
#endif /* not lint */
|
||||
|
||||
#include <sys/param.h>
|
||||
@@ -71,7 +71,7 @@ main(argc, argv)
|
||||
int ch, exitval;
|
||||
char *sourcedir;
|
||||
|
||||
while ((ch = getopt(argc, argv, "fs")) != EOF)
|
||||
while ((ch = getopt(argc, argv, "fs")) != -1)
|
||||
switch (ch) {
|
||||
case 'f':
|
||||
fflag = 1;
|
||||
@@ -157,7 +157,8 @@ linkit(target, source, isdir)
|
||||
void
|
||||
usage()
|
||||
{
|
||||
(void)fprintf(stderr,
|
||||
"usage:\tln [-fs] file1 file2\n\tln [-fs] file ... directory\n");
|
||||
(void)fprintf(stderr, "%s\n%s\n",
|
||||
"usage: ln [-fs] file1 file2",
|
||||
" ln [-fs] file ... directory");
|
||||
exit(1);
|
||||
}
|
||||
+16
-14
@@ -30,7 +30,7 @@
|
||||
.\" SUCH DAMAGE.
|
||||
.\"
|
||||
.\" @(#)symlink.7 8.3 (Berkeley) 3/31/94
|
||||
.\" $Id$
|
||||
.\" $Id: symlink.7,v 1.2.8.1 1997/06/14 18:47:31 jdp Exp $
|
||||
.\"
|
||||
.Dd March 31, 1994
|
||||
.Dt SYMLINK 7
|
||||
@@ -106,9 +106,10 @@ the system call
|
||||
would return a file descriptor to the file
|
||||
.Dq afile .
|
||||
.Pp
|
||||
There are four system calls that do not follow links, and which operate
|
||||
There are five system calls that do not follow links, and which operate
|
||||
on the symbolic link itself.
|
||||
They are:
|
||||
.Xr lchown 2 ,
|
||||
.Xr lstat 2 ,
|
||||
.Xr readlink 2 ,
|
||||
.Xr rename 2 ,
|
||||
@@ -120,23 +121,22 @@ is an alias for
|
||||
.Xr unlink 2 ,
|
||||
it also does not follow symbolic links.
|
||||
.Pp
|
||||
Unlike other filesystem objects, symbolic links do not have an owner,
|
||||
group, permissions, access and modification times, etc.
|
||||
The only attributes returned from an
|
||||
.Xr lstat 2
|
||||
that refer to the symbolic link itself are the file type (S_IFLNK),
|
||||
size, blocks, and link count (always 1).
|
||||
The other attributes are filled in from the directory that contains
|
||||
the link.
|
||||
For portability reasons, you should be aware that other implementations
|
||||
(including historic implementations of 4BSD), implement symbolic links
|
||||
such that they have the same attributes as any other file.
|
||||
The owner and group of an existing symbolic link can be changed by
|
||||
means of the
|
||||
.Xr lchown 2
|
||||
system call.
|
||||
The other file attributes, such as the modification time and access
|
||||
permissions, are not used by the system and cannot be changed.
|
||||
.Pp
|
||||
The
|
||||
.Bx 4.4
|
||||
system differs from historical 4BSD systems in that the system call
|
||||
.Xr chown 2
|
||||
has been changed to follow symbolic links.
|
||||
has been changed to follow symbolic links. The
|
||||
.Xr lchown 2
|
||||
system call was added later when the limitations of the new
|
||||
.Xr chown 2
|
||||
became apparent.
|
||||
.Ss Commands not traversing a file tree.
|
||||
The second area is symbolic links, specified as command line file
|
||||
name arguments, to commands which are not traversing a file tree.
|
||||
@@ -424,9 +424,11 @@ options.
|
||||
.Xr pax 1 ,
|
||||
.Xr rm 1 ,
|
||||
.Xr tar 1 ,
|
||||
.Xr lchown 2 ,
|
||||
.Xr lstat 2 ,
|
||||
.Xr readlink 2 ,
|
||||
.Xr rename 2 ,
|
||||
.Xr symlink 2 ,
|
||||
.Xr unlink 2 ,
|
||||
.Xr fts 3 ,
|
||||
.Xr remove 3 ,
|
||||
|
||||
+3
-3
@@ -33,7 +33,7 @@
|
||||
.\" SUCH DAMAGE.
|
||||
.\"
|
||||
.\" @(#)ls.1 8.6 (Berkeley) 4/18/94
|
||||
.\" $Id: ls.1,v 1.5.2.2 1997/03/07 02:00:30 mpp Exp $
|
||||
.\" $Id: ls.1,v 1.5.2.3 1997/03/26 17:55:17 obrien Exp $
|
||||
.\"
|
||||
.Dd April 18, 1994
|
||||
.Dt LS 1
|
||||
@@ -294,12 +294,12 @@ or
|
||||
The
|
||||
.Nm ls
|
||||
utility exits 0 on success, and >0 if an error occurs.
|
||||
.Sh ENVIRONMENTAL VARIABLES
|
||||
.Sh ENVIRONMENT VARIABLES
|
||||
The following environment variables affect the execution of
|
||||
.Nm ls :
|
||||
.Bl -tag -width BLOCKSIZE
|
||||
.It Ev BLOCKSIZE
|
||||
If the environmental variable
|
||||
If the environment variable
|
||||
.Ev BLOCKSIZE
|
||||
is set, the block counts
|
||||
(see
|
||||
|
||||
+9
-1
@@ -30,7 +30,7 @@
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id$
|
||||
* $Id: stat_flags.c,v 1.2 1994/09/24 02:55:57 davidg Exp $
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
@@ -69,6 +69,8 @@ flags_to_string(flags, def)
|
||||
SAPPEND("uappnd");
|
||||
if (flags & UF_IMMUTABLE)
|
||||
SAPPEND("uchg");
|
||||
if (flags & UF_NOUNLINK)
|
||||
SAPPEND("uunlnk");
|
||||
if (flags & UF_NODUMP)
|
||||
SAPPEND("nodump");
|
||||
if (flags & SF_APPEND)
|
||||
@@ -77,6 +79,8 @@ flags_to_string(flags, def)
|
||||
SAPPEND("arch");
|
||||
if (flags & SF_IMMUTABLE)
|
||||
SAPPEND("schg");
|
||||
if (flags & SF_NOUNLINK)
|
||||
SAPPEND("sunlnk");
|
||||
return (prefix == NULL && def != NULL ? def : string);
|
||||
}
|
||||
|
||||
@@ -134,6 +138,8 @@ string_to_flags(stringp, setp, clrp)
|
||||
TEST(p, "schg", SF_IMMUTABLE);
|
||||
TEST(p, "schange", SF_IMMUTABLE);
|
||||
TEST(p, "simmutable", SF_IMMUTABLE);
|
||||
TEST(p, "sunlnk", SF_NOUNLINK);
|
||||
TEST(p, "sunlink", SF_NOUNLINK);
|
||||
return (1);
|
||||
case 'u':
|
||||
TEST(p, "uappnd", UF_APPEND);
|
||||
@@ -141,6 +147,8 @@ string_to_flags(stringp, setp, clrp)
|
||||
TEST(p, "uchg", UF_IMMUTABLE);
|
||||
TEST(p, "uchange", UF_IMMUTABLE);
|
||||
TEST(p, "uimmutable", UF_IMMUTABLE);
|
||||
TEST(p, "uunlnk", UF_NOUNLINK);
|
||||
TEST(p, "uunlink", UF_NOUNLINK);
|
||||
/* FALLTHROUGH */
|
||||
default:
|
||||
return (1);
|
||||
|
||||
+41
-32
@@ -30,17 +30,17 @@
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id$
|
||||
* $Id: mkdir.c,v 1.5.8.1 1997/08/17 13:36:49 joerg Exp $
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
static char copyright[] =
|
||||
static char const copyright[] =
|
||||
"@(#) Copyright (c) 1983, 1992, 1993\n\
|
||||
The Regents of the University of California. All rights reserved.\n";
|
||||
#endif /* not lint */
|
||||
|
||||
#ifndef lint
|
||||
static char sccsid[] = "@(#)mkdir.c 8.2 (Berkeley) 1/25/94";
|
||||
static char const sccsid[] = "@(#)mkdir.c 8.2 (Berkeley) 1/25/94";
|
||||
#endif /* not lint */
|
||||
|
||||
#include <sys/types.h>
|
||||
@@ -53,7 +53,7 @@ static char sccsid[] = "@(#)mkdir.c 8.2 (Berkeley) 1/25/94";
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
|
||||
int build __P((char *));
|
||||
int build __P((char *, mode_t));
|
||||
void usage __P((void));
|
||||
|
||||
int
|
||||
@@ -61,13 +61,13 @@ main(argc, argv)
|
||||
int argc;
|
||||
char *argv[];
|
||||
{
|
||||
int ch, exitval, oct, omode, pflag;
|
||||
int ch, exitval, omode, pflag;
|
||||
mode_t *set = (mode_t *)NULL;
|
||||
char *ep, *mode;
|
||||
char *mode;
|
||||
|
||||
omode = pflag = 0;
|
||||
mode = NULL;
|
||||
while ((ch = getopt(argc, argv, "m:p")) != EOF)
|
||||
while ((ch = getopt(argc, argv, "m:p")) != -1)
|
||||
switch(ch) {
|
||||
case 'p':
|
||||
pflag = 1;
|
||||
@@ -87,53 +87,49 @@ main(argc, argv)
|
||||
|
||||
if (mode == NULL) {
|
||||
omode = S_IRWXU | S_IRWXG | S_IRWXO;
|
||||
oct = 1;
|
||||
} else if (*mode >= '0' && *mode <= '7') {
|
||||
omode = (int)strtol(mode, &ep, 8);
|
||||
if (omode < 0 || *ep)
|
||||
errx(1, "invalid file mode: %s", mode);
|
||||
oct = 1;
|
||||
} else {
|
||||
if ((set = setmode(mode)) == NULL)
|
||||
errx(1, "invalid file mode: %s", mode);
|
||||
oct = 0;
|
||||
omode = getmode(set, S_IRWXU | S_IRWXG | S_IRWXO);
|
||||
}
|
||||
|
||||
for (exitval = 0; *argv != NULL; ++argv) {
|
||||
if (pflag && build(*argv)) {
|
||||
exitval = 1;
|
||||
if (pflag) {
|
||||
if (build(*argv, omode))
|
||||
exitval = 1;
|
||||
continue;
|
||||
}
|
||||
if (mkdir(*argv, oct ?
|
||||
omode : getmode(set, S_IRWXU | S_IRWXG | S_IRWXO)) < 0) {
|
||||
if (!pflag) {
|
||||
warn("%s", *argv);
|
||||
exitval = 1;
|
||||
}
|
||||
if (mkdir(*argv, omode) < 0) {
|
||||
warn("%s", *argv);
|
||||
exitval = 1;
|
||||
}
|
||||
}
|
||||
exit(exitval);
|
||||
}
|
||||
|
||||
int
|
||||
build(path)
|
||||
build(path, omode)
|
||||
char *path;
|
||||
mode_t omode;
|
||||
{
|
||||
struct stat sb;
|
||||
mode_t numask, oumask;
|
||||
int first;
|
||||
int first, last, retval;
|
||||
char *p;
|
||||
|
||||
p = path;
|
||||
oumask = 0;
|
||||
retval = 0;
|
||||
if (p[0] == '/') /* Skip leading '/'. */
|
||||
++p;
|
||||
for (first = 1;; ++p) {
|
||||
if (p[0] == '\0' || (p[0] == '/' && p[1] == '\0'))
|
||||
break;
|
||||
if (p[0] != '/')
|
||||
for (first = 1, last = 0; !last ; ++p) {
|
||||
if (p[0] == '\0')
|
||||
last = 1;
|
||||
else if (p[0] != '/')
|
||||
continue;
|
||||
*p = '\0';
|
||||
if (p[1] == '\0')
|
||||
last = 1;
|
||||
if (first) {
|
||||
/*
|
||||
* POSIX 1003.2:
|
||||
@@ -152,18 +148,31 @@ build(path)
|
||||
(void)umask(numask);
|
||||
first = 0;
|
||||
}
|
||||
if (last)
|
||||
(void)umask(oumask);
|
||||
if (stat(path, &sb)) {
|
||||
if (errno != ENOENT ||
|
||||
mkdir(path, S_IRWXU | S_IRWXG | S_IRWXO) < 0) {
|
||||
mkdir(path, last ? omode :
|
||||
S_IRWXU | S_IRWXG | S_IRWXO) < 0) {
|
||||
warn("%s", path);
|
||||
return (1);
|
||||
retval = 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
else if ((sb.st_mode & S_IFMT) != S_IFDIR) {
|
||||
if (last)
|
||||
errno = EEXIST;
|
||||
else
|
||||
errno = ENOTDIR;
|
||||
warn("%s", path);
|
||||
retval = 1;
|
||||
break;
|
||||
}
|
||||
*p = '/';
|
||||
}
|
||||
if (!first)
|
||||
if (!first && !last)
|
||||
(void)umask(oumask);
|
||||
return (0);
|
||||
return (retval);
|
||||
}
|
||||
|
||||
void
|
||||
|
||||
+31
-13
@@ -33,17 +33,17 @@
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: mv.c,v 1.7 1996/02/20 23:27:57 wosch Exp $
|
||||
* $Id: mv.c,v 1.8 1996/03/01 06:14:13 wosch Exp $
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
static char copyright[] =
|
||||
static char const copyright[] =
|
||||
"@(#) Copyright (c) 1989, 1993, 1994\n\
|
||||
The Regents of the University of California. All rights reserved.\n";
|
||||
#endif /* not lint */
|
||||
|
||||
#ifndef lint
|
||||
static char sccsid[] = "@(#)mv.c 8.2 (Berkeley) 4/2/94";
|
||||
static char const sccsid[] = "@(#)mv.c 8.2 (Berkeley) 4/2/94";
|
||||
#endif /* not lint */
|
||||
|
||||
#include <sys/param.h>
|
||||
@@ -79,7 +79,7 @@ main(argc, argv)
|
||||
int ch;
|
||||
char path[MAXPATHLEN + 1];
|
||||
|
||||
while ((ch = getopt(argc, argv, "fi")) != EOF)
|
||||
while ((ch = getopt(argc, argv, "fi")) != -1)
|
||||
switch (ch) {
|
||||
case 'i':
|
||||
iflg = 1;
|
||||
@@ -206,22 +206,31 @@ fastcopy(from, to, sbp)
|
||||
struct timeval tval[2];
|
||||
static u_int blen;
|
||||
static char *bp;
|
||||
mode_t oldmode;
|
||||
register int nread, from_fd, to_fd;
|
||||
|
||||
if ((from_fd = open(from, O_RDONLY, 0)) < 0) {
|
||||
warn("%s", from);
|
||||
return (1);
|
||||
}
|
||||
if ((to_fd =
|
||||
open(to, O_CREAT | O_TRUNC | O_WRONLY, sbp->st_mode)) < 0) {
|
||||
if (blen < sbp->st_blksize) {
|
||||
if (bp != NULL)
|
||||
free(bp);
|
||||
if ((bp = malloc(sbp->st_blksize)) == NULL) {
|
||||
blen = 0;
|
||||
warnx("malloc failed");
|
||||
return (1);
|
||||
}
|
||||
blen = sbp->st_blksize;
|
||||
}
|
||||
while ((to_fd =
|
||||
open(to, O_CREAT | O_EXCL | O_TRUNC | O_WRONLY, 0)) < 0) {
|
||||
if (errno == EEXIST && unlink(to) == 0)
|
||||
continue;
|
||||
warn("%s", to);
|
||||
(void)close(from_fd);
|
||||
return (1);
|
||||
}
|
||||
if (!blen && !(bp = malloc(blen = sbp->st_blksize))) {
|
||||
warn(NULL);
|
||||
return (1);
|
||||
}
|
||||
while ((nread = read(from_fd, bp, blen)) > 0)
|
||||
if (write(to_fd, bp, nread) != nread) {
|
||||
warn("%s", to);
|
||||
@@ -237,10 +246,19 @@ err: if (unlink(to))
|
||||
}
|
||||
(void)close(from_fd);
|
||||
|
||||
if (fchown(to_fd, sbp->st_uid, sbp->st_gid))
|
||||
warn("%s: set owner/group", to);
|
||||
oldmode = sbp->st_mode & ALLPERMS;
|
||||
if (fchown(to_fd, sbp->st_uid, sbp->st_gid)) {
|
||||
warn("%s: set owner/group (was: %u/%u)", to, sbp->st_uid,
|
||||
sbp->st_gid);
|
||||
if (oldmode & (S_ISUID | S_ISGID)) {
|
||||
warnx(
|
||||
"%s: owner/group changed; clearing suid/sgid (mode was 0%03o)",
|
||||
to, oldmode);
|
||||
sbp->st_mode &= ~(S_ISUID | S_ISGID);
|
||||
}
|
||||
}
|
||||
if (fchmod(to_fd, sbp->st_mode))
|
||||
warn("%s: set mode", to);
|
||||
warn("%s: set mode (was: 0%03o)", to, oldmode);
|
||||
|
||||
tval[0].tv_sec = sbp->st_atime;
|
||||
tval[1].tv_sec = sbp->st_mtime;
|
||||
|
||||
+39
-39
@@ -34,11 +34,11 @@
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: ar_io.c,v 1.3 1995/05/30 00:06:52 rgrimes Exp $
|
||||
* $Id: ar_io.c,v 1.4.2.1 1997/08/25 08:36:50 jkh Exp $
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
static char sccsid[] = "@(#)ar_io.c 8.2 (Berkeley) 4/18/94";
|
||||
static char const sccsid[] = "@(#)ar_io.c 8.2 (Berkeley) 4/18/94";
|
||||
#endif /* not lint */
|
||||
|
||||
#include <sys/types.h>
|
||||
@@ -120,14 +120,14 @@ ar_open(name)
|
||||
arfd = STDIN_FILENO;
|
||||
arcname = STDN;
|
||||
} else if ((arfd = open(name, EXT_MODE, DMOD)) < 0)
|
||||
syswarn(0, errno, "Failed open to read on %s", name);
|
||||
sys_warn(0, errno, "Failed open to read on %s", name);
|
||||
break;
|
||||
case ARCHIVE:
|
||||
if (name == NULL) {
|
||||
arfd = STDOUT_FILENO;
|
||||
arcname = STDO;
|
||||
} else if ((arfd = open(name, AR_MODE, DMOD)) < 0)
|
||||
syswarn(0, errno, "Failed open to write on %s", name);
|
||||
sys_warn(0, errno, "Failed open to write on %s", name);
|
||||
else
|
||||
can_unlnk = 1;
|
||||
break;
|
||||
@@ -136,7 +136,7 @@ ar_open(name)
|
||||
arfd = STDOUT_FILENO;
|
||||
arcname = STDO;
|
||||
} else if ((arfd = open(name, APP_MODE, DMOD)) < 0)
|
||||
syswarn(0, errno, "Failed open to read/write on %s",
|
||||
sys_warn(0, errno, "Failed open to read/write on %s",
|
||||
name);
|
||||
break;
|
||||
case COPY:
|
||||
@@ -154,14 +154,14 @@ ar_open(name)
|
||||
* set up is based on device type
|
||||
*/
|
||||
if (fstat(arfd, &arsb) < 0) {
|
||||
syswarn(0, errno, "Failed stat on %s", arcname);
|
||||
sys_warn(0, errno, "Failed stat on %s", arcname);
|
||||
(void)close(arfd);
|
||||
arfd = -1;
|
||||
can_unlnk = 0;
|
||||
return(-1);
|
||||
}
|
||||
if (S_ISDIR(arsb.st_mode)) {
|
||||
warn(0, "Cannot write an archive on top of a directory %s",
|
||||
pax_warn(0, "Cannot write an archive on top of a directory %s",
|
||||
arcname);
|
||||
(void)close(arfd);
|
||||
arfd = -1;
|
||||
@@ -470,7 +470,7 @@ ar_set_wr()
|
||||
*/
|
||||
if (((cpos = lseek(arfd, (off_t)0L, SEEK_CUR)) < 0) ||
|
||||
(ftruncate(arfd, cpos) < 0)) {
|
||||
syswarn(1, errno, "Unable to truncate archive file");
|
||||
sys_warn(1, errno, "Unable to truncate archive file");
|
||||
return(-1);
|
||||
}
|
||||
return(0);
|
||||
@@ -494,13 +494,13 @@ ar_app_ok()
|
||||
#endif
|
||||
{
|
||||
if (artyp == ISPIPE) {
|
||||
warn(1, "Cannot append to an archive obtained from a pipe.");
|
||||
pax_warn(1, "Cannot append to an archive obtained from a pipe.");
|
||||
return(-1);
|
||||
}
|
||||
|
||||
if (!invld_rec)
|
||||
return(0);
|
||||
warn(1,"Cannot append, device record size %d does not support %s spec",
|
||||
pax_warn(1,"Cannot append, device record size %d does not support %s spec",
|
||||
rdblksz, argv0);
|
||||
return(-1);
|
||||
}
|
||||
@@ -587,9 +587,9 @@ ar_read(buf, cnt)
|
||||
*/
|
||||
lstrval = res;
|
||||
if (res < 0)
|
||||
syswarn(1, errno, "Failed read on archive volume %d", arvol);
|
||||
sys_warn(1, errno, "Failed read on archive volume %d", arvol);
|
||||
else
|
||||
warn(0, "End of archive volume %d reached", arvol);
|
||||
pax_warn(0, "End of archive volume %d reached", arvol);
|
||||
return(res);
|
||||
}
|
||||
|
||||
@@ -668,7 +668,7 @@ ar_write(buf, bsz)
|
||||
if (res >= 0)
|
||||
break;
|
||||
if (errno == EACCES) {
|
||||
warn(0, "Write failed, archive is write protected.");
|
||||
pax_warn(0, "Write failed, archive is write protected.");
|
||||
res = lstrval = 0;
|
||||
return(0);
|
||||
}
|
||||
@@ -706,18 +706,18 @@ ar_write(buf, bsz)
|
||||
* must quit right away.
|
||||
*/
|
||||
if (!wr_trail && (res <= 0)) {
|
||||
warn(1,"Unable to append, trailer re-write failed. Quitting.");
|
||||
pax_warn(1,"Unable to append, trailer re-write failed. Quitting.");
|
||||
return(res);
|
||||
}
|
||||
|
||||
if (res == 0)
|
||||
warn(0, "End of archive volume %d reached", arvol);
|
||||
pax_warn(0, "End of archive volume %d reached", arvol);
|
||||
else if (res < 0)
|
||||
syswarn(1, errno, "Failed write to archive volume: %d", arvol);
|
||||
sys_warn(1, errno, "Failed write to archive volume: %d", arvol);
|
||||
else if (!frmt->blkalgn || ((res % frmt->blkalgn) == 0))
|
||||
warn(0,"WARNING: partial archive write. Archive MAY BE FLAWED");
|
||||
pax_warn(0,"WARNING: partial archive write. Archive MAY BE FLAWED");
|
||||
else
|
||||
warn(1,"WARNING: partial archive write. Archive IS FLAWED");
|
||||
pax_warn(1,"WARNING: partial archive write. Archive IS FLAWED");
|
||||
return(res);
|
||||
}
|
||||
|
||||
@@ -751,7 +751,7 @@ ar_rdsync()
|
||||
return(-1);
|
||||
|
||||
if ((act == APPND) || (act == ARCHIVE)) {
|
||||
warn(1, "Cannot allow updates to an archive with flaws.");
|
||||
pax_warn(1, "Cannot allow updates to an archive with flaws.");
|
||||
return(-1);
|
||||
}
|
||||
if (io_ok)
|
||||
@@ -803,10 +803,10 @@ ar_rdsync()
|
||||
break;
|
||||
}
|
||||
if (lstrval <= 0) {
|
||||
warn(1, "Unable to recover from an archive read failure.");
|
||||
pax_warn(1, "Unable to recover from an archive read failure.");
|
||||
return(-1);
|
||||
}
|
||||
warn(0, "Attempting to recover from an archive read failure.");
|
||||
pax_warn(0, "Attempting to recover from an archive read failure.");
|
||||
return(0);
|
||||
}
|
||||
|
||||
@@ -870,7 +870,7 @@ ar_fow(sksz, skipped)
|
||||
if (lseek(arfd, mpos, SEEK_SET) >= 0)
|
||||
return(0);
|
||||
}
|
||||
syswarn(1, errno, "Foward positioning operation on archive failed");
|
||||
sys_warn(1, errno, "Foward positioning operation on archive failed");
|
||||
lstrval = -1;
|
||||
return(-1);
|
||||
}
|
||||
@@ -912,7 +912,7 @@ ar_rev(sksz)
|
||||
/*
|
||||
* cannot go backwards on these critters
|
||||
*/
|
||||
warn(1, "Reverse positioning on pipes is not supported.");
|
||||
pax_warn(1, "Reverse positioning on pipes is not supported.");
|
||||
lstrval = -1;
|
||||
return(-1);
|
||||
case ISREG:
|
||||
@@ -930,7 +930,7 @@ ar_rev(sksz)
|
||||
* First we figure out where we are in the archive.
|
||||
*/
|
||||
if ((cpos = lseek(arfd, (off_t)0L, SEEK_CUR)) < 0) {
|
||||
syswarn(1, errno,
|
||||
sys_warn(1, errno,
|
||||
"Unable to obtain current archive byte offset");
|
||||
lstrval = -1;
|
||||
return(-1);
|
||||
@@ -948,14 +948,14 @@ ar_rev(sksz)
|
||||
/*
|
||||
* this should never happen
|
||||
*/
|
||||
warn(1,"Reverse position on previous volume.");
|
||||
pax_warn(1,"Reverse position on previous volume.");
|
||||
lstrval = -1;
|
||||
return(-1);
|
||||
}
|
||||
cpos = (off_t)0L;
|
||||
}
|
||||
if (lseek(arfd, cpos, SEEK_SET) < 0) {
|
||||
syswarn(1, errno, "Unable to seek archive backwards");
|
||||
sys_warn(1, errno, "Unable to seek archive backwards");
|
||||
lstrval = -1;
|
||||
return(-1);
|
||||
}
|
||||
@@ -990,7 +990,7 @@ ar_rev(sksz)
|
||||
* ok we have to move. Make sure the tape drive can do it.
|
||||
*/
|
||||
if (sksz % phyblk) {
|
||||
warn(1,
|
||||
pax_warn(1,
|
||||
"Tape drive unable to backspace requested amount");
|
||||
lstrval = -1;
|
||||
return(-1);
|
||||
@@ -1002,7 +1002,7 @@ ar_rev(sksz)
|
||||
mb.mt_op = MTBSR;
|
||||
mb.mt_count = sksz/phyblk;
|
||||
if (ioctl(arfd, MTIOCTOP, &mb) < 0) {
|
||||
syswarn(1,errno, "Unable to backspace tape %d blocks.",
|
||||
sys_warn(1,errno, "Unable to backspace tape %d blocks.",
|
||||
mb.mt_count);
|
||||
lstrval = -1;
|
||||
return(-1);
|
||||
@@ -1050,7 +1050,7 @@ get_phys()
|
||||
while ((res = read(arfd, scbuf, sizeof(scbuf))) > 0)
|
||||
padsz += res;
|
||||
if (res < 0) {
|
||||
syswarn(1, errno, "Unable to locate tape filemark.");
|
||||
sys_warn(1, errno, "Unable to locate tape filemark.");
|
||||
return(-1);
|
||||
}
|
||||
}
|
||||
@@ -1062,7 +1062,7 @@ get_phys()
|
||||
mb.mt_op = MTBSF;
|
||||
mb.mt_count = 1;
|
||||
if (ioctl(arfd, MTIOCTOP, &mb) < 0) {
|
||||
syswarn(1, errno, "Unable to backspace over tape filemark.");
|
||||
sys_warn(1, errno, "Unable to backspace over tape filemark.");
|
||||
return(-1);
|
||||
}
|
||||
|
||||
@@ -1073,11 +1073,11 @@ get_phys()
|
||||
mb.mt_op = MTBSR;
|
||||
mb.mt_count = 1;
|
||||
if (ioctl(arfd, MTIOCTOP, &mb) < 0) {
|
||||
syswarn(1, errno, "Unable to backspace over last tape block.");
|
||||
sys_warn(1, errno, "Unable to backspace over last tape block.");
|
||||
return(-1);
|
||||
}
|
||||
if ((phyblk = read(arfd, scbuf, sizeof(scbuf))) <= 0) {
|
||||
syswarn(1, errno, "Cannot determine archive tape blocksize.");
|
||||
sys_warn(1, errno, "Cannot determine archive tape blocksize.");
|
||||
return(-1);
|
||||
}
|
||||
|
||||
@@ -1088,13 +1088,13 @@ get_phys()
|
||||
while ((res = read(arfd, scbuf, sizeof(scbuf))) > 0)
|
||||
;
|
||||
if (res < 0) {
|
||||
syswarn(1, errno, "Unable to locate tape filemark.");
|
||||
sys_warn(1, errno, "Unable to locate tape filemark.");
|
||||
return(-1);
|
||||
}
|
||||
mb.mt_op = MTBSF;
|
||||
mb.mt_count = 1;
|
||||
if (ioctl(arfd, MTIOCTOP, &mb) < 0) {
|
||||
syswarn(1, errno, "Unable to backspace over tape filemark.");
|
||||
sys_warn(1, errno, "Unable to backspace over tape filemark.");
|
||||
return(-1);
|
||||
}
|
||||
|
||||
@@ -1114,7 +1114,7 @@ get_phys()
|
||||
* never fail).
|
||||
*/
|
||||
if (padsz % phyblk) {
|
||||
warn(1, "Tape drive unable to backspace requested amount");
|
||||
pax_warn(1, "Tape drive unable to backspace requested amount");
|
||||
return(-1);
|
||||
}
|
||||
|
||||
@@ -1125,7 +1125,7 @@ get_phys()
|
||||
mb.mt_op = MTBSR;
|
||||
mb.mt_count = padsz/phyblk;
|
||||
if (ioctl(arfd, MTIOCTOP, &mb) < 0) {
|
||||
syswarn(1,errno,"Unable to backspace tape over %d pad blocks",
|
||||
sys_warn(1,errno,"Unable to backspace tape over %d pad blocks",
|
||||
mb.mt_count);
|
||||
return(-1);
|
||||
}
|
||||
@@ -1160,10 +1160,10 @@ ar_next()
|
||||
* also be called via a signal handler, so we must prevent a race.
|
||||
*/
|
||||
if (sigprocmask(SIG_BLOCK, &s_mask, &o_mask) < 0)
|
||||
syswarn(0, errno, "Unable to set signal mask");
|
||||
sys_warn(0, errno, "Unable to set signal mask");
|
||||
ar_close();
|
||||
if (sigprocmask(SIG_SETMASK, &o_mask, (sigset_t *)NULL) < 0)
|
||||
syswarn(0, errno, "Unable to restore signal mask");
|
||||
sys_warn(0, errno, "Unable to restore signal mask");
|
||||
|
||||
if (done || !wr_trail)
|
||||
return(-1);
|
||||
@@ -1276,7 +1276,7 @@ ar_next()
|
||||
if ((arcname = strdup(buf)) == NULL) {
|
||||
done = 1;
|
||||
lstrval = -1;
|
||||
warn(0, "Cannot save archive name.");
|
||||
pax_warn(0, "Cannot save archive name.");
|
||||
return(-1);
|
||||
}
|
||||
freeit = 1;
|
||||
|
||||
+16
-16
@@ -34,11 +34,11 @@
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: ar_subs.c,v 1.3 1995/05/30 00:06:52 rgrimes Exp $
|
||||
* $Id: ar_subs.c,v 1.4.2.1 1997/08/25 08:36:51 jkh Exp $
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
static char sccsid[] = "@(#)ar_subs.c 8.2 (Berkeley) 4/18/94";
|
||||
static char const sccsid[] = "@(#)ar_subs.c 8.2 (Berkeley) 4/18/94";
|
||||
#endif /* not lint */
|
||||
|
||||
#include <sys/types.h>
|
||||
@@ -425,7 +425,7 @@ wr_archive(arcn, is_app)
|
||||
* the link table).
|
||||
*/
|
||||
if ((fd = open(arcn->org_name, O_RDONLY, 0)) < 0) {
|
||||
syswarn(1,errno, "Unable to open %s to read",
|
||||
sys_warn(1,errno, "Unable to open %s to read",
|
||||
arcn->org_name);
|
||||
purg_lnk(arcn);
|
||||
continue;
|
||||
@@ -572,7 +572,7 @@ append()
|
||||
if (get_arc() < 0)
|
||||
return;
|
||||
if ((orgfrmt != NULL) && (orgfrmt != frmt)) {
|
||||
warn(1, "Cannot mix current archive format %s with %s",
|
||||
pax_warn(1, "Cannot mix current archive format %s with %s",
|
||||
frmt->name, orgfrmt->name);
|
||||
return;
|
||||
}
|
||||
@@ -753,12 +753,12 @@ copy()
|
||||
drem = PAXPATHLEN - dlen;
|
||||
|
||||
if (stat(dirptr, &sb) < 0) {
|
||||
syswarn(1, errno, "Cannot access destination directory %s",
|
||||
sys_warn(1, errno, "Cannot access destination directory %s",
|
||||
dirptr);
|
||||
return;
|
||||
}
|
||||
if (!S_ISDIR(sb.st_mode)) {
|
||||
warn(1, "Destination is not a directory %s", dirptr);
|
||||
pax_warn(1, "Destination is not a directory %s", dirptr);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -812,7 +812,7 @@ copy()
|
||||
else
|
||||
res = 0;
|
||||
if ((arcn->nlen - res) > drem) {
|
||||
warn(1, "Destination pathname too long %s",
|
||||
pax_warn(1, "Destination pathname too long %s",
|
||||
arcn->name);
|
||||
continue;
|
||||
}
|
||||
@@ -917,7 +917,7 @@ copy()
|
||||
* first open source file and then create the destination file
|
||||
*/
|
||||
if ((fdsrc = open(arcn->org_name, O_RDONLY, 0)) < 0) {
|
||||
syswarn(1, errno, "Unable to open %s to read",
|
||||
sys_warn(1, errno, "Unable to open %s to read",
|
||||
arcn->org_name);
|
||||
purg_lnk(arcn);
|
||||
continue;
|
||||
@@ -1009,16 +1009,16 @@ next_head(arcn)
|
||||
* storage device, better give the user the bad news.
|
||||
*/
|
||||
if ((ret == 0) || (rd_sync() < 0)) {
|
||||
warn(1,"Premature end of file on archive read");
|
||||
pax_warn(1,"Premature end of file on archive read");
|
||||
return(-1);
|
||||
}
|
||||
if (!in_resync) {
|
||||
if (act == APPND) {
|
||||
warn(1,
|
||||
pax_warn(1,
|
||||
"Archive I/O error, cannot continue");
|
||||
return(-1);
|
||||
}
|
||||
warn(1,"Archive I/O error. Trying to recover.");
|
||||
pax_warn(1,"Archive I/O error. Trying to recover.");
|
||||
++in_resync;
|
||||
}
|
||||
|
||||
@@ -1079,10 +1079,10 @@ next_head(arcn)
|
||||
*/
|
||||
if (!in_resync) {
|
||||
if (act == APPND) {
|
||||
warn(1,"Unable to append, archive header flaw");
|
||||
pax_warn(1,"Unable to append, archive header flaw");
|
||||
return(-1);
|
||||
}
|
||||
warn(1,"Invalid header, starting valid header search.");
|
||||
pax_warn(1,"Invalid header, starting valid header search.");
|
||||
++in_resync;
|
||||
}
|
||||
bcopy(hdbuf+1, hdbuf, shftsz);
|
||||
@@ -1174,7 +1174,7 @@ get_arc()
|
||||
if (!notice) {
|
||||
if (act == APPND)
|
||||
return(-1);
|
||||
warn(1,"Cannot identify format. Searching...");
|
||||
pax_warn(1,"Cannot identify format. Searching...");
|
||||
++notice;
|
||||
}
|
||||
}
|
||||
@@ -1209,7 +1209,7 @@ get_arc()
|
||||
if (!notice) {
|
||||
if (act == APPND)
|
||||
return(-1);
|
||||
warn(1, "Cannot identify format. Searching...");
|
||||
pax_warn(1, "Cannot identify format. Searching...");
|
||||
++notice;
|
||||
}
|
||||
|
||||
@@ -1234,6 +1234,6 @@ get_arc()
|
||||
/*
|
||||
* we cannot find a header, bow, apologize and quit
|
||||
*/
|
||||
warn(1, "Sorry, unable to determine archive format.");
|
||||
pax_warn(1, "Sorry, unable to determine archive format.");
|
||||
return(-1);
|
||||
}
|
||||
+24
-24
@@ -34,11 +34,11 @@
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: buf_subs.c,v 1.3 1995/05/30 00:06:53 rgrimes Exp $
|
||||
* $Id: buf_subs.c,v 1.4.2.1 1997/08/25 08:36:52 jkh Exp $
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
static char sccsid[] = "@(#)buf_subs.c 8.2 (Berkeley) 4/18/94";
|
||||
static char const sccsid[] = "@(#)buf_subs.c 8.2 (Berkeley) 4/18/94";
|
||||
#endif /* not lint */
|
||||
|
||||
#include <sys/types.h>
|
||||
@@ -103,12 +103,12 @@ wr_start()
|
||||
if (!wrblksz)
|
||||
wrblksz = frmt->bsz;
|
||||
if (wrblksz > MAXBLK) {
|
||||
warn(1, "Write block size of %d too large, maximium is: %d",
|
||||
pax_warn(1, "Write block size of %d too large, maximium is: %d",
|
||||
wrblksz, MAXBLK);
|
||||
return(-1);
|
||||
}
|
||||
if (wrblksz % BLKMULT) {
|
||||
warn(1, "Write block size of %d is not a %d byte multiple",
|
||||
pax_warn(1, "Write block size of %d is not a %d byte multiple",
|
||||
wrblksz, BLKMULT);
|
||||
return(-1);
|
||||
}
|
||||
@@ -148,12 +148,12 @@ rd_start()
|
||||
buf = &(bufmem[BLKMULT]);
|
||||
if ((act == APPND) && wrblksz) {
|
||||
if (wrblksz > MAXBLK) {
|
||||
warn(1,"Write block size %d too large, maximium is: %d",
|
||||
pax_warn(1,"Write block size %d too large, maximium is: %d",
|
||||
wrblksz, MAXBLK);
|
||||
return(-1);
|
||||
}
|
||||
if (wrblksz % BLKMULT) {
|
||||
warn(1, "Write block size %d is not a %d byte multiple",
|
||||
pax_warn(1, "Write block size %d is not a %d byte multiple",
|
||||
wrblksz, BLKMULT);
|
||||
return(-1);
|
||||
}
|
||||
@@ -232,7 +232,7 @@ appnd_start(skcnt)
|
||||
off_t cnt;
|
||||
|
||||
if (exit_val != 0) {
|
||||
warn(0, "Cannot append to an archive that may have flaws.");
|
||||
pax_warn(0, "Cannot append to an archive that may have flaws.");
|
||||
return(-1);
|
||||
}
|
||||
/*
|
||||
@@ -309,7 +309,7 @@ appnd_start(skcnt)
|
||||
return(0);
|
||||
|
||||
out:
|
||||
warn(1, "Unable to rewrite archive trailer, cannot append.");
|
||||
pax_warn(1, "Unable to rewrite archive trailer, cannot append.");
|
||||
return(-1);
|
||||
}
|
||||
|
||||
@@ -341,7 +341,7 @@ rd_sync()
|
||||
if (maxflt == 0)
|
||||
return(-1);
|
||||
if (act == APPND) {
|
||||
warn(1, "Unable to append when there are archive read errors.");
|
||||
pax_warn(1, "Unable to append when there are archive read errors.");
|
||||
return(-1);
|
||||
}
|
||||
|
||||
@@ -375,7 +375,7 @@ rd_sync()
|
||||
* can extract out of the archive.
|
||||
*/
|
||||
if ((maxflt > 0) && (++errcnt > maxflt))
|
||||
warn(0,"Archive read error limit (%d) reached",maxflt);
|
||||
pax_warn(0,"Archive read error limit (%d) reached",maxflt);
|
||||
else if (ar_rdsync() == 0)
|
||||
continue;
|
||||
if (ar_next() < 0)
|
||||
@@ -654,7 +654,7 @@ wr_skip(skcnt)
|
||||
* it is important that we always write EXACTLY the number of bytes that
|
||||
* the format specific write routine told us to. The file can also get
|
||||
* bigger, so reading to the end of file would create an improper archive,
|
||||
* we just detect this case and warn the user. We never create a bad
|
||||
* we just detect this case and pax_warn the user. We never create a bad
|
||||
* archive if we can avoid it. Of course trying to archive files that are
|
||||
* active is asking for trouble. It we fail, we pass back how much we
|
||||
* could NOT copy and let the caller deal with it.
|
||||
@@ -700,13 +700,13 @@ wr_rdfile(arcn, ifd, left)
|
||||
* or the file read failed.
|
||||
*/
|
||||
if (res < 0)
|
||||
syswarn(1, errno, "Read fault on %s", arcn->org_name);
|
||||
sys_warn(1, errno, "Read fault on %s", arcn->org_name);
|
||||
else if (size != 0L)
|
||||
warn(1, "File changed size during read %s", arcn->org_name);
|
||||
pax_warn(1, "File changed size during read %s", arcn->org_name);
|
||||
else if (fstat(ifd, &sb) < 0)
|
||||
syswarn(1, errno, "Failed stat on %s", arcn->org_name);
|
||||
sys_warn(1, errno, "Failed stat on %s", arcn->org_name);
|
||||
else if (arcn->sb.st_mtime != sb.st_mtime)
|
||||
warn(1, "File %s was modified during copy to archive",
|
||||
pax_warn(1, "File %s was modified during copy to archive",
|
||||
arcn->org_name);
|
||||
*left = size;
|
||||
return(0);
|
||||
@@ -761,7 +761,7 @@ rd_wrfile(arcn, ofd, left)
|
||||
if (sb.st_blksize > 0)
|
||||
sz = (int)sb.st_blksize;
|
||||
} else
|
||||
syswarn(0,errno,"Unable to obtain block size for file %s",fnm);
|
||||
sys_warn(0,errno,"Unable to obtain block size for file %s",fnm);
|
||||
rem = sz;
|
||||
*left = 0L;
|
||||
|
||||
@@ -817,7 +817,7 @@ rd_wrfile(arcn, ofd, left)
|
||||
* calculated crc to the crc stored in the archive
|
||||
*/
|
||||
if (docrc && (size == 0L) && (arcn->crc != crc))
|
||||
warn(1,"Actual crc does not match expected crc %s",arcn->name);
|
||||
pax_warn(1,"Actual crc does not match expected crc %s",arcn->name);
|
||||
return(0);
|
||||
}
|
||||
|
||||
@@ -864,7 +864,7 @@ cp_file(arcn, fd1, fd2)
|
||||
if (sb.st_blksize > 0)
|
||||
sz = sb.st_blksize;
|
||||
} else
|
||||
syswarn(0,errno,"Unable to obtain block size for file %s",fnm);
|
||||
sys_warn(0,errno,"Unable to obtain block size for file %s",fnm);
|
||||
rem = sz;
|
||||
|
||||
/*
|
||||
@@ -886,15 +886,15 @@ cp_file(arcn, fd1, fd2)
|
||||
* check to make sure the copy is valid.
|
||||
*/
|
||||
if (res < 0)
|
||||
syswarn(1, errno, "Failed write during copy of %s to %s",
|
||||
sys_warn(1, errno, "Failed write during copy of %s to %s",
|
||||
arcn->org_name, arcn->name);
|
||||
else if (cpcnt != arcn->sb.st_size)
|
||||
warn(1, "File %s changed size during copy to %s",
|
||||
pax_warn(1, "File %s changed size during copy to %s",
|
||||
arcn->org_name, arcn->name);
|
||||
else if (fstat(fd1, &sb) < 0)
|
||||
syswarn(1, errno, "Failed stat of %s", arcn->org_name);
|
||||
sys_warn(1, errno, "Failed stat of %s", arcn->org_name);
|
||||
else if (arcn->sb.st_mtime != sb.st_mtime)
|
||||
warn(1, "File %s was modified during copy to %s",
|
||||
pax_warn(1, "File %s was modified during copy to %s",
|
||||
arcn->org_name, arcn->name);
|
||||
|
||||
/*
|
||||
@@ -987,7 +987,7 @@ buf_flush(bufcnt)
|
||||
* at least one record. We always round limit UP to next blocksize.
|
||||
*/
|
||||
if ((wrlimit > 0) && (wrcnt > wrlimit)) {
|
||||
warn(0, "User specified archive volume byte limit reached.");
|
||||
pax_warn(0, "User specified archive volume byte limit reached.");
|
||||
if (ar_next() < 0) {
|
||||
wrcnt = 0;
|
||||
exit_val = 1;
|
||||
@@ -1043,7 +1043,7 @@ buf_flush(bufcnt)
|
||||
/*
|
||||
* Oh drat we got a partial write!
|
||||
* if format doesnt care about alignment let it go,
|
||||
* we warned the user in ar_write().... but this means
|
||||
* we pax_warned the user in ar_write().... but this means
|
||||
* the last record on this volume violates pax spec....
|
||||
*/
|
||||
totcnt += cnt;
|
||||
|
||||
+12
-12
@@ -34,11 +34,11 @@
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: cache.c,v 1.2 1994/09/24 02:56:14 davidg Exp $
|
||||
* $Id: cache.c,v 1.3.2.2 1997/08/25 08:36:54 jkh Exp $
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
static char sccsid[] = "@(#)cache.c 8.1 (Berkeley) 5/31/93";
|
||||
static char const sccsid[] = "@(#)cache.c 8.1 (Berkeley) 5/31/93";
|
||||
#endif /* not lint */
|
||||
|
||||
#include <sys/types.h>
|
||||
@@ -92,7 +92,7 @@ uidtb_start()
|
||||
return(-1);
|
||||
if ((uidtb = (UIDC **)calloc(UID_SZ, sizeof(UIDC *))) == NULL) {
|
||||
++fail;
|
||||
warn(1, "Unable to allocate memory for user id cache table");
|
||||
pax_warn(1, "Unable to allocate memory for user id cache table");
|
||||
return(-1);
|
||||
}
|
||||
return(0);
|
||||
@@ -121,7 +121,7 @@ gidtb_start()
|
||||
return(-1);
|
||||
if ((gidtb = (GIDC **)calloc(GID_SZ, sizeof(GIDC *))) == NULL) {
|
||||
++fail;
|
||||
warn(1, "Unable to allocate memory for group id cache table");
|
||||
pax_warn(1, "Unable to allocate memory for group id cache table");
|
||||
return(-1);
|
||||
}
|
||||
return(0);
|
||||
@@ -150,7 +150,7 @@ usrtb_start()
|
||||
return(-1);
|
||||
if ((usrtb = (UIDC **)calloc(UNM_SZ, sizeof(UIDC *))) == NULL) {
|
||||
++fail;
|
||||
warn(1, "Unable to allocate memory for user name cache table");
|
||||
pax_warn(1, "Unable to allocate memory for user name cache table");
|
||||
return(-1);
|
||||
}
|
||||
return(0);
|
||||
@@ -179,7 +179,7 @@ grptb_start()
|
||||
return(-1);
|
||||
if ((grptb = (GIDC **)calloc(GNM_SZ, sizeof(GIDC *))) == NULL) {
|
||||
++fail;
|
||||
warn(1,"Unable to allocate memory for group name cache table");
|
||||
pax_warn(1,"Unable to allocate memory for group name cache table");
|
||||
return(-1);
|
||||
}
|
||||
return(0);
|
||||
@@ -244,7 +244,7 @@ name_uid(uid, frc)
|
||||
# ifdef NET2_STAT
|
||||
(void)sprintf(ptr->name, "%u", uid);
|
||||
# else
|
||||
(void)sprintf(ptr->name, "%lu", uid);
|
||||
(void)sprintf(ptr->name, "%lu", (u_long)uid);
|
||||
# endif
|
||||
if (frc == 0)
|
||||
return("");
|
||||
@@ -255,7 +255,7 @@ name_uid(uid, frc)
|
||||
if (ptr == NULL)
|
||||
return(pw->pw_name);
|
||||
ptr->uid = uid;
|
||||
(void)strncpy(ptr->name, pw->pw_name, UNMLEN);
|
||||
(void)strncpy(ptr->name, pw->pw_name, UNMLEN - 1);
|
||||
ptr->name[UNMLEN-1] = '\0';
|
||||
ptr->valid = VALID;
|
||||
}
|
||||
@@ -321,7 +321,7 @@ name_gid(gid, frc)
|
||||
# ifdef NET2_STAT
|
||||
(void)sprintf(ptr->name, "%u", gid);
|
||||
# else
|
||||
(void)sprintf(ptr->name, "%lu", gid);
|
||||
(void)sprintf(ptr->name, "%lu", (u_long)gid);
|
||||
# endif
|
||||
if (frc == 0)
|
||||
return("");
|
||||
@@ -332,7 +332,7 @@ name_gid(gid, frc)
|
||||
if (ptr == NULL)
|
||||
return(gr->gr_name);
|
||||
ptr->gid = gid;
|
||||
(void)strncpy(ptr->name, gr->gr_name, GNMLEN);
|
||||
(void)strncpy(ptr->name, gr->gr_name, GNMLEN - 1);
|
||||
ptr->name[GNMLEN-1] = '\0';
|
||||
ptr->valid = VALID;
|
||||
}
|
||||
@@ -398,7 +398,7 @@ uid_name(name, uid)
|
||||
*uid = pw->pw_uid;
|
||||
return(0);
|
||||
}
|
||||
(void)strncpy(ptr->name, name, UNMLEN);
|
||||
(void)strncpy(ptr->name, name, UNMLEN - 1);
|
||||
ptr->name[UNMLEN-1] = '\0';
|
||||
if ((pw = getpwnam(name)) == NULL) {
|
||||
ptr->valid = INVALID;
|
||||
@@ -468,7 +468,7 @@ gid_name(name, gid)
|
||||
return(0);
|
||||
}
|
||||
|
||||
(void)strncpy(ptr->name, name, GNMLEN);
|
||||
(void)strncpy(ptr->name, name, GNMLEN - 1);
|
||||
ptr->name[GNMLEN-1] = '\0';
|
||||
if ((gr = getgrnam(name)) == NULL) {
|
||||
ptr->valid = INVALID;
|
||||
|
||||
+20
-20
@@ -34,11 +34,11 @@
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: cpio.c,v 1.3 1995/05/30 00:06:54 rgrimes Exp $
|
||||
* $Id: cpio.c,v 1.4.2.1 1997/08/25 08:36:55 jkh Exp $
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
static char sccsid[] = "@(#)cpio.c 8.1 (Berkeley) 5/31/93";
|
||||
static char const sccsid[] = "@(#)cpio.c 8.1 (Berkeley) 5/31/93";
|
||||
#endif /* not lint */
|
||||
|
||||
#include <sys/types.h>
|
||||
@@ -216,7 +216,7 @@ rd_nm(arcn, nsz)
|
||||
* do not even try bogus values
|
||||
*/
|
||||
if ((nsz == 0) || (nsz > sizeof(arcn->name))) {
|
||||
warn(1, "Cpio file name length %d is out of range", nsz);
|
||||
pax_warn(1, "Cpio file name length %d is out of range", nsz);
|
||||
return(-1);
|
||||
}
|
||||
|
||||
@@ -225,7 +225,7 @@ rd_nm(arcn, nsz)
|
||||
*/
|
||||
if ((rd_wrbuf(arcn->name,nsz) != nsz) || (arcn->name[nsz-1] != '\0') ||
|
||||
(arcn->name[0] == '\0')) {
|
||||
warn(1, "Cpio file name in header is corrupted");
|
||||
pax_warn(1, "Cpio file name in header is corrupted");
|
||||
return(-1);
|
||||
}
|
||||
return(0);
|
||||
@@ -254,10 +254,10 @@ rd_ln_nm(arcn)
|
||||
if ((arcn->sb.st_size == 0) ||
|
||||
(arcn->sb.st_size >= sizeof(arcn->ln_name))) {
|
||||
# ifdef NET2_STAT
|
||||
warn(1, "Cpio link name length is invalid: %lu",
|
||||
pax_warn(1, "Cpio link name length is invalid: %lu",
|
||||
arcn->sb.st_size);
|
||||
# else
|
||||
warn(1, "Cpio link name length is invalid: %qu",
|
||||
pax_warn(1, "Cpio link name length is invalid: %qu",
|
||||
arcn->sb.st_size);
|
||||
# endif
|
||||
return(-1);
|
||||
@@ -268,7 +268,7 @@ rd_ln_nm(arcn)
|
||||
*/
|
||||
if (rd_wrbuf(arcn->ln_name, (int)arcn->sb.st_size) !=
|
||||
(int)arcn->sb.st_size) {
|
||||
warn(1, "Cpio link name read error");
|
||||
pax_warn(1, "Cpio link name read error");
|
||||
return(-1);
|
||||
}
|
||||
arcn->ln_nlen = arcn->sb.st_size;
|
||||
@@ -278,7 +278,7 @@ rd_ln_nm(arcn)
|
||||
* watch out for those empty link names
|
||||
*/
|
||||
if (arcn->ln_name[0] == '\0') {
|
||||
warn(1, "Cpio link name is corrupt");
|
||||
pax_warn(1, "Cpio link name is corrupt");
|
||||
return(-1);
|
||||
}
|
||||
return(0);
|
||||
@@ -480,7 +480,7 @@ cpio_wr(arcn)
|
||||
if (uqd_asc((u_quad_t)arcn->sb.st_size, hd->c_filesize,
|
||||
sizeof(hd->c_filesize), OCT)) {
|
||||
# endif
|
||||
warn(1,"File is too large for cpio format %s",
|
||||
pax_warn(1,"File is too large for cpio format %s",
|
||||
arcn->org_name);
|
||||
return(1);
|
||||
}
|
||||
@@ -531,7 +531,7 @@ cpio_wr(arcn)
|
||||
*/
|
||||
if ((wr_rdbuf(hdblk, (int)sizeof(HD_CPIO)) < 0) ||
|
||||
(wr_rdbuf(arcn->name, nsz) < 0)) {
|
||||
warn(1, "Unable to write cpio header for %s", arcn->org_name);
|
||||
pax_warn(1, "Unable to write cpio header for %s", arcn->org_name);
|
||||
return(-1);
|
||||
}
|
||||
|
||||
@@ -550,7 +550,7 @@ cpio_wr(arcn)
|
||||
* next file as we are done.
|
||||
*/
|
||||
if (wr_rdbuf(arcn->ln_name, arcn->ln_nlen) < 0) {
|
||||
warn(1,"Unable to write cpio link name for %s",arcn->org_name);
|
||||
pax_warn(1,"Unable to write cpio link name for %s",arcn->org_name);
|
||||
return(-1);
|
||||
}
|
||||
return(1);
|
||||
@@ -559,7 +559,7 @@ cpio_wr(arcn)
|
||||
/*
|
||||
* header field is out of range
|
||||
*/
|
||||
warn(1, "Cpio header field is too small to store file %s",
|
||||
pax_warn(1, "Cpio header field is too small to store file %s",
|
||||
arcn->org_name);
|
||||
return(1);
|
||||
}
|
||||
@@ -847,7 +847,7 @@ vcpio_wr(arcn)
|
||||
if (uqd_asc((u_quad_t)arcn->sb.st_size, hd->c_filesize,
|
||||
sizeof(hd->c_filesize), HEX)) {
|
||||
# endif
|
||||
warn(1,"File is too large for sv4cpio format %s",
|
||||
pax_warn(1,"File is too large for sv4cpio format %s",
|
||||
arcn->org_name);
|
||||
return(1);
|
||||
}
|
||||
@@ -905,7 +905,7 @@ vcpio_wr(arcn)
|
||||
if ((wr_rdbuf(hdblk, (int)sizeof(HD_VCPIO)) < 0) ||
|
||||
(wr_rdbuf(arcn->name, (int)nsz) < 0) ||
|
||||
(wr_skip((off_t)(VCPIO_PAD(sizeof(HD_VCPIO) + nsz))) < 0)) {
|
||||
warn(1,"Could not write sv4cpio header for %s",arcn->org_name);
|
||||
pax_warn(1,"Could not write sv4cpio header for %s",arcn->org_name);
|
||||
return(-1);
|
||||
}
|
||||
|
||||
@@ -927,7 +927,7 @@ vcpio_wr(arcn)
|
||||
*/
|
||||
if ((wr_rdbuf(arcn->ln_name, arcn->ln_nlen) < 0) ||
|
||||
(wr_skip((off_t)(VCPIO_PAD(arcn->ln_nlen))) < 0)) {
|
||||
warn(1,"Could not write sv4cpio link name for %s",
|
||||
pax_warn(1,"Could not write sv4cpio link name for %s",
|
||||
arcn->org_name);
|
||||
return(-1);
|
||||
}
|
||||
@@ -937,7 +937,7 @@ vcpio_wr(arcn)
|
||||
/*
|
||||
* header field is out of range
|
||||
*/
|
||||
warn(1,"Sv4cpio header field is too small for file %s",arcn->org_name);
|
||||
pax_warn(1,"Sv4cpio header field is too small for file %s",arcn->org_name);
|
||||
return(1);
|
||||
}
|
||||
|
||||
@@ -1158,7 +1158,7 @@ bcpio_wr(arcn)
|
||||
t_offt = (off_t)(SHRT_EXT(hd->h_filesize_1));
|
||||
t_offt = (t_offt<<16) | ((off_t)(SHRT_EXT(hd->h_filesize_2)));
|
||||
if (arcn->sb.st_size != t_offt) {
|
||||
warn(1,"File is too large for bcpio format %s",
|
||||
pax_warn(1,"File is too large for bcpio format %s",
|
||||
arcn->org_name);
|
||||
return(1);
|
||||
}
|
||||
@@ -1243,7 +1243,7 @@ bcpio_wr(arcn)
|
||||
if ((wr_rdbuf(hdblk, (int)sizeof(HD_BCPIO)) < 0) ||
|
||||
(wr_rdbuf(arcn->name, nsz) < 0) ||
|
||||
(wr_skip((off_t)(BCPIO_PAD(sizeof(HD_BCPIO) + nsz))) < 0)) {
|
||||
warn(1, "Could not write bcpio header for %s", arcn->org_name);
|
||||
pax_warn(1, "Could not write bcpio header for %s", arcn->org_name);
|
||||
return(-1);
|
||||
}
|
||||
|
||||
@@ -1265,7 +1265,7 @@ bcpio_wr(arcn)
|
||||
*/
|
||||
if ((wr_rdbuf(arcn->ln_name, arcn->ln_nlen) < 0) ||
|
||||
(wr_skip((off_t)(BCPIO_PAD(arcn->ln_nlen))) < 0)) {
|
||||
warn(1,"Could not write bcpio link name for %s",arcn->org_name);
|
||||
pax_warn(1,"Could not write bcpio link name for %s",arcn->org_name);
|
||||
return(-1);
|
||||
}
|
||||
return(1);
|
||||
@@ -1274,6 +1274,6 @@ bcpio_wr(arcn)
|
||||
/*
|
||||
* header field is out of range
|
||||
*/
|
||||
warn(1,"Bcpio header field is too small for file %s", arcn->org_name);
|
||||
pax_warn(1,"Bcpio header field is too small for file %s", arcn->org_name);
|
||||
return(1);
|
||||
}
|
||||
+3
-3
@@ -35,7 +35,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)extern.h 8.2 (Berkeley) 4/18/94
|
||||
* $Id$
|
||||
* $Id: extern.h,v 1.2 1994/09/24 02:56:18 davidg Exp $
|
||||
*/
|
||||
|
||||
/*
|
||||
@@ -282,5 +282,5 @@ int ustar_wr __P((register ARCHD *));
|
||||
int tty_init __P((void));
|
||||
void tty_prnt __P((char *, ...));
|
||||
int tty_read __P((char *, int));
|
||||
void warn __P((int, char *, ...));
|
||||
void syswarn __P((int, int, char *, ...));
|
||||
void pax_warn __P((int, char *, ...));
|
||||
void sys_warn __P((int, int, char *, ...));
|
||||
+30
-30
@@ -34,11 +34,11 @@
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: file_subs.c,v 1.3 1995/05/30 00:06:56 rgrimes Exp $
|
||||
* $Id: file_subs.c,v 1.4.2.1 1997/08/25 08:36:56 jkh Exp $
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
static char sccsid[] = "@(#)file_subs.c 8.1 (Berkeley) 5/31/93";
|
||||
static char const sccsid[] = "@(#)file_subs.c 8.1 (Berkeley) 5/31/93";
|
||||
#endif /* not lint */
|
||||
|
||||
#include <sys/types.h>
|
||||
@@ -122,7 +122,7 @@ file_creat(arcn)
|
||||
break;
|
||||
oerrno = errno;
|
||||
if (chk_path(arcn->name,arcn->sb.st_uid,arcn->sb.st_gid) < 0) {
|
||||
syswarn(1, oerrno, "Unable to create %s", arcn->name);
|
||||
sys_warn(1, oerrno, "Unable to create %s", arcn->name);
|
||||
return(-1);
|
||||
}
|
||||
}
|
||||
@@ -152,7 +152,7 @@ file_close(arcn, fd)
|
||||
if (fd < 0)
|
||||
return;
|
||||
if (close(fd) < 0)
|
||||
syswarn(0, errno, "Unable to close file descriptor on %s",
|
||||
sys_warn(0, errno, "Unable to close file descriptor on %s",
|
||||
arcn->name);
|
||||
|
||||
/*
|
||||
@@ -200,13 +200,13 @@ lnk_creat(arcn)
|
||||
* is not a directory, so we lstat and check
|
||||
*/
|
||||
if (lstat(arcn->ln_name, &sb) < 0) {
|
||||
syswarn(1,errno,"Unable to link to %s from %s", arcn->ln_name,
|
||||
sys_warn(1,errno,"Unable to link to %s from %s", arcn->ln_name,
|
||||
arcn->name);
|
||||
return(-1);
|
||||
}
|
||||
|
||||
if (S_ISDIR(sb.st_mode)) {
|
||||
warn(1, "A hard link to the directory %s is not allowed",
|
||||
pax_warn(1, "A hard link to the directory %s is not allowed",
|
||||
arcn->ln_name);
|
||||
return(-1);
|
||||
}
|
||||
@@ -217,7 +217,7 @@ lnk_creat(arcn)
|
||||
/*
|
||||
* cross_lnk()
|
||||
* Create a hard link to arcn->org_name from arcn->name. Only used in copy
|
||||
* with the -l flag. No warning or error if this does not succeed (we will
|
||||
* with the -l flag. No pax_warning or error if this does not succeed (we will
|
||||
* then just create the file)
|
||||
* Return:
|
||||
* 1 if copy() should try to create this file node
|
||||
@@ -278,7 +278,7 @@ chk_same(arcn)
|
||||
* better make sure the user does not have src == dest by mistake
|
||||
*/
|
||||
if ((arcn->sb.st_dev == sb.st_dev) && (arcn->sb.st_ino == sb.st_ino)) {
|
||||
warn(1, "Unable to copy %s, file would overwrite itself",
|
||||
pax_warn(1, "Unable to copy %s, file would overwrite itself",
|
||||
arcn->name);
|
||||
return(0);
|
||||
}
|
||||
@@ -325,7 +325,7 @@ mk_link(to, to_sb, from, ign)
|
||||
* make sure it is not the same file, protect the user
|
||||
*/
|
||||
if ((to_sb->st_dev==sb.st_dev)&&(to_sb->st_ino == sb.st_ino)) {
|
||||
warn(1, "Unable to link file %s to itself", to);
|
||||
pax_warn(1, "Unable to link file %s to itself", to);
|
||||
return(-1);;
|
||||
}
|
||||
|
||||
@@ -334,12 +334,12 @@ mk_link(to, to_sb, from, ign)
|
||||
*/
|
||||
if (S_ISDIR(sb.st_mode)) {
|
||||
if (rmdir(from) < 0) {
|
||||
syswarn(1, errno, "Unable to remove %s", from);
|
||||
sys_warn(1, errno, "Unable to remove %s", from);
|
||||
return(-1);
|
||||
}
|
||||
} else if (unlink(from) < 0) {
|
||||
if (!ign) {
|
||||
syswarn(1, errno, "Unable to remove %s", from);
|
||||
sys_warn(1, errno, "Unable to remove %s", from);
|
||||
return(-1);
|
||||
}
|
||||
return(1);
|
||||
@@ -358,7 +358,7 @@ mk_link(to, to_sb, from, ign)
|
||||
if (chk_path(from, to_sb->st_uid, to_sb->st_gid) == 0)
|
||||
continue;
|
||||
if (!ign) {
|
||||
syswarn(1, oerrno, "Could not link to %s from %s", to,
|
||||
sys_warn(1, oerrno, "Could not link to %s from %s", to,
|
||||
from);
|
||||
return(-1);
|
||||
}
|
||||
@@ -425,7 +425,7 @@ node_creat(arcn)
|
||||
/*
|
||||
* Skip sockets, operation has no meaning under BSD
|
||||
*/
|
||||
warn(0,
|
||||
pax_warn(0,
|
||||
"%s skipped. Sockets cannot be copied or extracted",
|
||||
arcn->name);
|
||||
return(-1);
|
||||
@@ -441,7 +441,7 @@ node_creat(arcn)
|
||||
/*
|
||||
* we should never get here
|
||||
*/
|
||||
warn(0, "%s has an unknown file type, skipping",
|
||||
pax_warn(0, "%s has an unknown file type, skipping",
|
||||
arcn->name);
|
||||
return(-1);
|
||||
}
|
||||
@@ -465,7 +465,7 @@ node_creat(arcn)
|
||||
continue;
|
||||
|
||||
if (chk_path(arcn->name,arcn->sb.st_uid,arcn->sb.st_gid) < 0) {
|
||||
syswarn(1, oerrno, "Could not create: %s", arcn->name);
|
||||
sys_warn(1, oerrno, "Could not create: %s", arcn->name);
|
||||
return(-1);
|
||||
}
|
||||
}
|
||||
@@ -500,7 +500,7 @@ node_creat(arcn)
|
||||
*/
|
||||
if (access(arcn->name, R_OK | W_OK | X_OK) < 0) {
|
||||
if (lstat(arcn->name, &sb) < 0) {
|
||||
syswarn(0, errno,"Could not access %s (stat)",
|
||||
sys_warn(0, errno,"Could not access %s (stat)",
|
||||
arcn->name);
|
||||
set_pmode(arcn->name,file_mode | S_IRWXU);
|
||||
} else {
|
||||
@@ -570,7 +570,7 @@ unlnk_exist(name, type)
|
||||
if (rmdir(name) < 0) {
|
||||
if (type == PAX_DIR)
|
||||
return(1);
|
||||
syswarn(1,errno,"Unable to remove directory %s", name);
|
||||
sys_warn(1,errno,"Unable to remove directory %s", name);
|
||||
return(-1);
|
||||
}
|
||||
return(0);
|
||||
@@ -580,7 +580,7 @@ unlnk_exist(name, type)
|
||||
* try to get rid of all non-directory type nodes
|
||||
*/
|
||||
if (unlink(name) < 0) {
|
||||
syswarn(1, errno, "Could not unlink %s", name);
|
||||
sys_warn(1, errno, "Could not unlink %s", name);
|
||||
return(-1);
|
||||
}
|
||||
return(0);
|
||||
@@ -720,14 +720,14 @@ set_ftime(fnm, mtime, atime, frc)
|
||||
if (!pmtime)
|
||||
tv[1].tv_sec = (long)sb.st_mtime;
|
||||
} else
|
||||
syswarn(0,errno,"Unable to obtain file stats %s", fnm);
|
||||
sys_warn(0,errno,"Unable to obtain file stats %s", fnm);
|
||||
}
|
||||
|
||||
/*
|
||||
* set the times
|
||||
*/
|
||||
if (utimes(fnm, tv) < 0)
|
||||
syswarn(1, errno, "Access/modification time set failed on: %s",
|
||||
sys_warn(1, errno, "Access/modification time set failed on: %s",
|
||||
fnm);
|
||||
return;
|
||||
}
|
||||
@@ -751,7 +751,7 @@ set_ids(fnm, uid, gid)
|
||||
#endif
|
||||
{
|
||||
if (chown(fnm, uid, gid) < 0) {
|
||||
syswarn(1, errno, "Unable to set file uid/gid of %s", fnm);
|
||||
sys_warn(1, errno, "Unable to set file uid/gid of %s", fnm);
|
||||
return(-1);
|
||||
}
|
||||
return(0);
|
||||
@@ -774,7 +774,7 @@ set_pmode(fnm, mode)
|
||||
{
|
||||
mode &= ABITS;
|
||||
if (chmod(fnm, mode) < 0)
|
||||
syswarn(1, errno, "Could not set permissions on %s", fnm);
|
||||
sys_warn(1, errno, "Could not set permissions on %s", fnm);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -887,7 +887,7 @@ file_write(fd, str, cnt, rem, isempt, sz, name)
|
||||
* skip, buf is empty so far
|
||||
*/
|
||||
if (lseek(fd, (off_t)wcnt, SEEK_CUR) < 0) {
|
||||
syswarn(1,errno,"File seek on %s",
|
||||
sys_warn(1,errno,"File seek on %s",
|
||||
name);
|
||||
return(-1);
|
||||
}
|
||||
@@ -904,7 +904,7 @@ file_write(fd, str, cnt, rem, isempt, sz, name)
|
||||
* have non-zero data in this file system block, have to write
|
||||
*/
|
||||
if (write(fd, st, wcnt) != wcnt) {
|
||||
syswarn(1, errno, "Failed write to file %s", name);
|
||||
sys_warn(1, errno, "Failed write to file %s", name);
|
||||
return(-1);
|
||||
}
|
||||
st += wcnt;
|
||||
@@ -943,12 +943,12 @@ file_flush(fd, fname, isempt)
|
||||
* move back one byte and write a zero
|
||||
*/
|
||||
if (lseek(fd, (off_t)-1, SEEK_CUR) < 0) {
|
||||
syswarn(1, errno, "Failed seek on file %s", fname);
|
||||
sys_warn(1, errno, "Failed seek on file %s", fname);
|
||||
return;
|
||||
}
|
||||
|
||||
if (write(fd, blnk, 1) < 0)
|
||||
syswarn(1, errno, "Failed write to file %s", fname);
|
||||
sys_warn(1, errno, "Failed write to file %s", fname);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1041,13 +1041,13 @@ set_crc(arcn, fd)
|
||||
* they can create inconsistant archive copies.
|
||||
*/
|
||||
if (cpcnt != arcn->sb.st_size)
|
||||
warn(1, "File changed size %s", arcn->org_name);
|
||||
pax_warn(1, "File changed size %s", arcn->org_name);
|
||||
else if (fstat(fd, &sb) < 0)
|
||||
syswarn(1, errno, "Failed stat on %s", arcn->org_name);
|
||||
sys_warn(1, errno, "Failed stat on %s", arcn->org_name);
|
||||
else if (arcn->sb.st_mtime != sb.st_mtime)
|
||||
warn(1, "File %s was modified during read", arcn->org_name);
|
||||
pax_warn(1, "File %s was modified during read", arcn->org_name);
|
||||
else if (lseek(fd, (off_t)0L, SEEK_SET) < 0)
|
||||
syswarn(1, errno, "File rewind failed on: %s", arcn->org_name);
|
||||
sys_warn(1, errno, "File rewind failed on: %s", arcn->org_name);
|
||||
else {
|
||||
arcn->crc = crc;
|
||||
return(0);
|
||||
|
||||
+15
-15
@@ -34,11 +34,11 @@
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: ftree.c,v 1.3 1995/05/30 00:06:57 rgrimes Exp $
|
||||
* $Id: ftree.c,v 1.4.2.1 1997/08/25 08:36:57 jkh Exp $
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
static char sccsid[] = "@(#)ftree.c 8.2 (Berkeley) 4/18/94";
|
||||
static char const sccsid[] = "@(#)ftree.c 8.2 (Berkeley) 4/18/94";
|
||||
#endif /* not lint */
|
||||
|
||||
#include <sys/types.h>
|
||||
@@ -122,7 +122,7 @@ ftree_start()
|
||||
ftsopts |= FTS_PHYSICAL;
|
||||
if (Hflag)
|
||||
# ifdef NET2_FTS
|
||||
warn(0, "The -H flag is not supported on this version");
|
||||
pax_warn(0, "The -H flag is not supported on this version");
|
||||
# else
|
||||
ftsopts |= FTS_COMFOLLOW;
|
||||
# endif
|
||||
@@ -130,7 +130,7 @@ ftree_start()
|
||||
ftsopts |= FTS_XDEV;
|
||||
|
||||
if ((fthead == NULL) && ((farray[0] = malloc(PAXPATHLEN+2)) == NULL)) {
|
||||
warn(1, "Unable to allocate memory for file name buffer");
|
||||
pax_warn(1, "Unable to allocate memory for file name buffer");
|
||||
return(-1);
|
||||
}
|
||||
|
||||
@@ -165,7 +165,7 @@ ftree_add(str)
|
||||
* simple check for bad args
|
||||
*/
|
||||
if ((str == NULL) || (*str == '\0')) {
|
||||
warn(0, "Invalid file name arguement");
|
||||
pax_warn(0, "Invalid file name arguement");
|
||||
return(-1);
|
||||
}
|
||||
|
||||
@@ -175,7 +175,7 @@ ftree_add(str)
|
||||
* trailing / the user may pass us. (watch out for / by itself).
|
||||
*/
|
||||
if ((ft = (FTREE *)malloc(sizeof(FTREE))) == NULL) {
|
||||
warn(0, "Unable to allocate memory for filename");
|
||||
pax_warn(0, "Unable to allocate memory for filename");
|
||||
return(-1);
|
||||
}
|
||||
|
||||
@@ -263,7 +263,7 @@ ftree_chk()
|
||||
if (ft->refcnt > 0)
|
||||
continue;
|
||||
if (wban == 0) {
|
||||
warn(1,"WARNING! These file names were not selected:");
|
||||
pax_warn(1,"WARNING! These file names were not selected:");
|
||||
++wban;
|
||||
}
|
||||
(void)fprintf(stderr, "%s\n", ft->fname);
|
||||
@@ -423,30 +423,30 @@ next_file(arcn)
|
||||
/*
|
||||
* fts claims a file system cycle
|
||||
*/
|
||||
warn(1,"File system cycle found at %s",ftent->fts_path);
|
||||
pax_warn(1,"File system cycle found at %s",ftent->fts_path);
|
||||
continue;
|
||||
case FTS_DNR:
|
||||
# ifdef NET2_FTS
|
||||
syswarn(1, errno,
|
||||
sys_warn(1, errno,
|
||||
# else
|
||||
syswarn(1, ftent->fts_errno,
|
||||
sys_warn(1, ftent->fts_errno,
|
||||
# endif
|
||||
"Unable to read directory %s", ftent->fts_path);
|
||||
continue;
|
||||
case FTS_ERR:
|
||||
# ifdef NET2_FTS
|
||||
syswarn(1, errno,
|
||||
sys_warn(1, errno,
|
||||
# else
|
||||
syswarn(1, ftent->fts_errno,
|
||||
sys_warn(1, ftent->fts_errno,
|
||||
# endif
|
||||
"File system traversal error");
|
||||
continue;
|
||||
case FTS_NS:
|
||||
case FTS_NSOK:
|
||||
# ifdef NET2_FTS
|
||||
syswarn(1, errno,
|
||||
sys_warn(1, errno,
|
||||
# else
|
||||
syswarn(1, ftent->fts_errno,
|
||||
sys_warn(1, ftent->fts_errno,
|
||||
# endif
|
||||
"Unable to access %s", ftent->fts_path);
|
||||
continue;
|
||||
@@ -508,7 +508,7 @@ next_file(arcn)
|
||||
*/
|
||||
if ((cnt = readlink(ftent->fts_path, arcn->ln_name,
|
||||
PAXPATHLEN)) < 0) {
|
||||
syswarn(1, errno, "Unable to read symlink %s",
|
||||
sys_warn(1, errno, "Unable to read symlink %s",
|
||||
ftent->fts_path);
|
||||
continue;
|
||||
}
|
||||
|
||||
+4
-3
@@ -34,11 +34,11 @@
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: gen_subs.c,v 1.5 1995/08/07 19:17:36 wollman Exp $
|
||||
* $Id: gen_subs.c,v 1.6 1995/10/23 21:23:14 ache Exp $
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
static char sccsid[] = "@(#)gen_subs.c 8.1 (Berkeley) 5/31/93";
|
||||
static char const sccsid[] = "@(#)gen_subs.c 8.1 (Berkeley) 5/31/93";
|
||||
#endif /* not lint */
|
||||
|
||||
#include <sys/types.h>
|
||||
@@ -132,10 +132,11 @@ ls_list(arcn, now)
|
||||
if ((arcn->type == PAX_CHR) || (arcn->type == PAX_BLK))
|
||||
# ifdef NET2_STAT
|
||||
(void)printf("%4u,%4u ", MAJOR(sbp->st_rdev),
|
||||
MINOR(sbp->st_rdev));
|
||||
# else
|
||||
(void)printf("%4lu,%4lu ", (unsigned long)MAJOR(sbp->st_rdev),
|
||||
(unsigned long)MINOR(sbp->st_rdev));
|
||||
# endif
|
||||
MINOR(sbp->st_rdev));
|
||||
else {
|
||||
# ifdef NET2_STAT
|
||||
(void)printf("%9lu ", sbp->st_size);
|
||||
|
||||
+17
-17
@@ -34,11 +34,11 @@
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: options.c,v 1.3 1995/03/19 13:28:53 joerg Exp $
|
||||
* $Id: options.c,v 1.4.2.1 1997/08/25 08:37:01 jkh Exp $
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
static char sccsid[] = "@(#)options.c 8.2 (Berkeley) 4/18/94";
|
||||
static char const sccsid[] = "@(#)options.c 8.2 (Berkeley) 4/18/94";
|
||||
#endif /* not lint */
|
||||
|
||||
#include <sys/types.h>
|
||||
@@ -195,7 +195,7 @@ pax_options(argc, argv)
|
||||
* process option flags
|
||||
*/
|
||||
while ((c=getopt(argc,argv,"ab:cdf:iklno:p:rs:tuvwx:B:DE:G:HLPT:U:XYZ"))
|
||||
!= EOF) {
|
||||
!= -1) {
|
||||
switch (c) {
|
||||
case 'a':
|
||||
/*
|
||||
@@ -209,7 +209,7 @@ pax_options(argc, argv)
|
||||
*/
|
||||
flg |= BF;
|
||||
if ((wrblksz = (int)str_offt(optarg)) <= 0) {
|
||||
warn(1, "Invalid block size %s", optarg);
|
||||
pax_warn(1, "Invalid block size %s", optarg);
|
||||
pax_usage();
|
||||
}
|
||||
break;
|
||||
@@ -311,7 +311,7 @@ pax_options(argc, argv)
|
||||
pmode = 1;
|
||||
break;
|
||||
default:
|
||||
warn(1, "Invalid -p string: %c", *pt);
|
||||
pax_warn(1, "Invalid -p string: %c", *pt);
|
||||
pax_usage();
|
||||
break;
|
||||
}
|
||||
@@ -371,7 +371,7 @@ pax_options(argc, argv)
|
||||
flg |= XF;
|
||||
break;
|
||||
}
|
||||
warn(1, "Unknown -x format: %s", optarg);
|
||||
pax_warn(1, "Unknown -x format: %s", optarg);
|
||||
(void)fputs("pax: Known -x formats are:", stderr);
|
||||
for (i = 0; i < (sizeof(fsub)/sizeof(FSUB)); ++i)
|
||||
(void)fprintf(stderr, " %s", fsub[i].name);
|
||||
@@ -384,11 +384,11 @@ pax_options(argc, argv)
|
||||
* single archive volume.
|
||||
*/
|
||||
if ((wrlimit = str_offt(optarg)) <= 0) {
|
||||
warn(1, "Invalid write limit %s", optarg);
|
||||
pax_warn(1, "Invalid write limit %s", optarg);
|
||||
pax_usage();
|
||||
}
|
||||
if (wrlimit % BLKMULT) {
|
||||
warn(1, "Write limit is not a %d byte multiple",
|
||||
pax_warn(1, "Write limit is not a %d byte multiple",
|
||||
BLKMULT);
|
||||
pax_usage();
|
||||
}
|
||||
@@ -412,7 +412,7 @@ pax_options(argc, argv)
|
||||
if (strcmp(NONE, optarg) == 0)
|
||||
maxflt = -1;
|
||||
else if ((maxflt = atoi(optarg)) < 0) {
|
||||
warn(1, "Error count value must be positive");
|
||||
pax_warn(1, "Error count value must be positive");
|
||||
pax_usage();
|
||||
}
|
||||
break;
|
||||
@@ -547,7 +547,7 @@ pax_options(argc, argv)
|
||||
break;
|
||||
case COPY:
|
||||
if (optind >= argc) {
|
||||
warn(0, "Destination directory was not supplied");
|
||||
pax_warn(0, "Destination directory was not supplied");
|
||||
pax_usage();
|
||||
}
|
||||
--argc;
|
||||
@@ -604,11 +604,11 @@ tar_options(argc, argv)
|
||||
* specify blocksize
|
||||
*/
|
||||
if (*argv == (char *)NULL) {
|
||||
warn(1,"blocksize must be specified with 'b'");
|
||||
pax_warn(1,"blocksize must be specified with 'b'");
|
||||
tar_usage();
|
||||
}
|
||||
if ((wrblksz = (int)str_offt(*argv)) <= 0) {
|
||||
warn(1, "Invalid block size %s", *argv);
|
||||
pax_warn(1, "Invalid block size %s", *argv);
|
||||
tar_usage();
|
||||
}
|
||||
++argv;
|
||||
@@ -630,7 +630,7 @@ tar_options(argc, argv)
|
||||
* filename where the archive is stored
|
||||
*/
|
||||
if (*argv == (char *)NULL) {
|
||||
warn(1, "filename must be specified with 'f'");
|
||||
pax_warn(1, "filename must be specified with 'f'");
|
||||
tar_usage();
|
||||
}
|
||||
if ((argv[0][0] == '-') && (argv[0][1]== '\0')) {
|
||||
@@ -893,7 +893,7 @@ bad_opt()
|
||||
/*
|
||||
* print all we were given
|
||||
*/
|
||||
warn(1,"These format options are not supported");
|
||||
pax_warn(1,"These format options are not supported");
|
||||
while ((opt = opt_next()) != NULL)
|
||||
(void)fprintf(stderr, "\t%s = %s\n", opt->name, opt->value);
|
||||
pax_usage();
|
||||
@@ -924,7 +924,7 @@ opt_add(str)
|
||||
register char *endpt;
|
||||
|
||||
if ((str == NULL) || (*str == '\0')) {
|
||||
warn(0, "Invalid option name");
|
||||
pax_warn(0, "Invalid option name");
|
||||
return(-1);
|
||||
}
|
||||
frpt = endpt = str;
|
||||
@@ -938,11 +938,11 @@ opt_add(str)
|
||||
if ((endpt = strchr(frpt, ',')) != NULL)
|
||||
*endpt = '\0';
|
||||
if ((pt = strchr(frpt, '=')) == NULL) {
|
||||
warn(0, "Invalid options format");
|
||||
pax_warn(0, "Invalid options format");
|
||||
return(-1);
|
||||
}
|
||||
if ((opt = (OPLIST *)malloc(sizeof(OPLIST))) == NULL) {
|
||||
warn(0, "Unable to allocate space for option list");
|
||||
pax_warn(0, "Unable to allocate space for option list");
|
||||
return(-1);
|
||||
}
|
||||
*pt++ = '\0';
|
||||
|
||||
+18
-16
@@ -34,11 +34,11 @@
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: pat_rep.c,v 1.4 1995/05/30 00:06:59 rgrimes Exp $
|
||||
* $Id: pat_rep.c,v 1.5.2.2 1997/08/25 08:37:02 jkh Exp $
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
static char sccsid[] = "@(#)pat_rep.c 8.2 (Berkeley) 4/18/94";
|
||||
static char const sccsid[] = "@(#)pat_rep.c 8.2 (Berkeley) 4/18/94";
|
||||
#endif /* not lint */
|
||||
|
||||
#include <sys/types.h>
|
||||
@@ -119,7 +119,7 @@ rep_add(str)
|
||||
* throw out the bad parameters
|
||||
*/
|
||||
if ((str == NULL) || (*str == '\0')) {
|
||||
warn(1, "Empty replacement string");
|
||||
pax_warn(1, "Empty replacement string");
|
||||
return(-1);
|
||||
}
|
||||
|
||||
@@ -128,7 +128,7 @@ rep_add(str)
|
||||
* this expression
|
||||
*/
|
||||
if ((pt1 = strchr(str+1, *str)) == NULL) {
|
||||
warn(1, "Invalid replacement string %s", str);
|
||||
pax_warn(1, "Invalid replacement string %s", str);
|
||||
return(-1);
|
||||
}
|
||||
|
||||
@@ -137,7 +137,7 @@ rep_add(str)
|
||||
* and split out the regular expression and try to compile it
|
||||
*/
|
||||
if ((rep = (REPLACE *)malloc(sizeof(REPLACE))) == NULL) {
|
||||
warn(1, "Unable to allocate memory for replacement string");
|
||||
pax_warn(1, "Unable to allocate memory for replacement string");
|
||||
return(-1);
|
||||
}
|
||||
|
||||
@@ -147,7 +147,7 @@ rep_add(str)
|
||||
# else
|
||||
if ((res = regcomp(&(rep->rcmp), str+1, 0)) != 0) {
|
||||
regerror(res, &(rep->rcmp), rebuf, sizeof(rebuf));
|
||||
warn(1, "%s while compiling regular expression %s", rebuf, str);
|
||||
pax_warn(1, "%s while compiling regular expression %s", rebuf, str);
|
||||
# endif
|
||||
(void)free((char *)rep);
|
||||
return(-1);
|
||||
@@ -166,7 +166,7 @@ rep_add(str)
|
||||
regfree(&(rep->rcmp));
|
||||
# endif
|
||||
(void)free((char *)rep);
|
||||
warn(1, "Invalid replacement string %s", str);
|
||||
pax_warn(1, "Invalid replacement string %s", str);
|
||||
return(-1);
|
||||
}
|
||||
|
||||
@@ -196,7 +196,7 @@ rep_add(str)
|
||||
# endif
|
||||
(void)free((char *)rep);
|
||||
*pt1 = *str;
|
||||
warn(1, "Invalid replacement string option %s", str);
|
||||
pax_warn(1, "Invalid replacement string option %s", str);
|
||||
return(-1);
|
||||
}
|
||||
++pt2;
|
||||
@@ -241,7 +241,7 @@ pat_add(str)
|
||||
* throw out the junk
|
||||
*/
|
||||
if ((str == NULL) || (*str == '\0')) {
|
||||
warn(1, "Empty pattern string");
|
||||
pax_warn(1, "Empty pattern string");
|
||||
return(-1);
|
||||
}
|
||||
|
||||
@@ -251,7 +251,7 @@ pat_add(str)
|
||||
* node to the end of the pattern list
|
||||
*/
|
||||
if ((pt = (PATTERN *)malloc(sizeof(PATTERN))) == NULL) {
|
||||
warn(1, "Unable to allocate memory for pattern string");
|
||||
pax_warn(1, "Unable to allocate memory for pattern string");
|
||||
return(-1);
|
||||
}
|
||||
|
||||
@@ -294,7 +294,7 @@ pat_chk()
|
||||
if (pt->flgs & MTCH)
|
||||
continue;
|
||||
if (!wban) {
|
||||
warn(1, "WARNING! These patterns were not matched:");
|
||||
pax_warn(1, "WARNING! These patterns were not matched:");
|
||||
++wban;
|
||||
}
|
||||
(void)fprintf(stderr, "%s\n", pt->pstr);
|
||||
@@ -373,7 +373,7 @@ pat_sel(arcn)
|
||||
*pt->pend = '\0';
|
||||
|
||||
if ((pt->pstr = strdup(arcn->name)) == NULL) {
|
||||
warn(1, "Pattern select out of memory");
|
||||
pax_warn(1, "Pattern select out of memory");
|
||||
if (pt->pend != NULL)
|
||||
*pt->pend = '/';
|
||||
pt->pend = NULL;
|
||||
@@ -421,7 +421,7 @@ pat_sel(arcn)
|
||||
/*
|
||||
* should never happen....
|
||||
*/
|
||||
warn(1, "Pattern list inconsistant");
|
||||
pax_warn(1, "Pattern list inconsistant");
|
||||
return(-1);
|
||||
}
|
||||
*ppt = pt->fow;
|
||||
@@ -776,6 +776,7 @@ tty_rename(arcn)
|
||||
tty_prnt("Processing continues, name changed to: %s\n", tmpname);
|
||||
res = add_name(arcn->name, arcn->nlen, tmpname);
|
||||
arcn->nlen = l_strncpy(arcn->name, tmpname, PAXPATHLEN+1);
|
||||
arcn->name[PAXPATHLEN] = '\0';
|
||||
if (res < 0)
|
||||
return(-1);
|
||||
return(0);
|
||||
@@ -855,7 +856,7 @@ fix_path(or_name, or_len, dir_name, dir_len)
|
||||
--dest;
|
||||
}
|
||||
if ((len = dest - or_name) > PAXPATHLEN) {
|
||||
warn(1, "File name %s/%s, too long", dir_name, start);
|
||||
pax_warn(1, "File name %s/%s, too long", dir_name, start);
|
||||
return(-1);
|
||||
}
|
||||
*or_len = len;
|
||||
@@ -982,7 +983,7 @@ rep_name(name, nlen, prnt)
|
||||
< 0) {
|
||||
# endif
|
||||
if (prnt)
|
||||
warn(1, "Replacement name error %s",
|
||||
pax_warn(1, "Replacement name error %s",
|
||||
name);
|
||||
return(1);
|
||||
}
|
||||
@@ -1033,7 +1034,7 @@ rep_name(name, nlen, prnt)
|
||||
*outpt = '\0';
|
||||
if ((outpt == endpt) && (*inpt != '\0')) {
|
||||
if (prnt)
|
||||
warn(1,"Replacement name too long %s >> %s",
|
||||
pax_warn(1,"Replacement name too long %s >> %s",
|
||||
name, nname);
|
||||
return(1);
|
||||
}
|
||||
@@ -1056,6 +1057,7 @@ rep_name(name, nlen, prnt)
|
||||
if (*nname == '\0')
|
||||
return(1);
|
||||
*nlen = l_strncpy(name, nname, PAXPATHLEN + 1);
|
||||
name[PAXPATHLEN] = '\0';
|
||||
}
|
||||
return(0);
|
||||
}
|
||||
|
||||
+7
-7
@@ -34,17 +34,17 @@
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: pax.c,v 1.4 1995/10/23 21:23:19 ache Exp $
|
||||
* $Id: pax.c,v 1.5.2.1 1997/08/25 08:37:03 jkh Exp $
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
static char copyright[] =
|
||||
static char const copyright[] =
|
||||
"@(#) Copyright (c) 1992, 1993\n\
|
||||
The Regents of the University of California. All rights reserved.\n";
|
||||
#endif /* not lint */
|
||||
|
||||
#ifndef lint
|
||||
static char sccsid[] = "@(#)pax.c 8.2 (Berkeley) 4/18/94";
|
||||
static char const sccsid[] = "@(#)pax.c 8.2 (Berkeley) 4/18/94";
|
||||
#endif /* not lint */
|
||||
|
||||
#include <stdio.h>
|
||||
@@ -285,9 +285,9 @@ sig_cleanup(which_sig)
|
||||
*/
|
||||
vflag = vfpart = 1;
|
||||
if (which_sig == SIGXCPU)
|
||||
warn(0, "Cpu time limit reached, cleaning up.");
|
||||
pax_warn(0, "Cpu time limit reached, cleaning up.");
|
||||
else
|
||||
warn(0, "Signal caught, cleaning up.");
|
||||
pax_warn(0, "Signal caught, cleaning up.");
|
||||
|
||||
ar_close();
|
||||
proc_dir();
|
||||
@@ -365,7 +365,7 @@ gen_init()
|
||||
(sigaddset(&s_mask,SIGINT) < 0)||(sigaddset(&s_mask,SIGHUP) < 0) ||
|
||||
(sigaddset(&s_mask,SIGPIPE) < 0)||(sigaddset(&s_mask,SIGQUIT)<0) ||
|
||||
(sigaddset(&s_mask,SIGXCPU) < 0)||(sigaddset(&s_mask,SIGXFSZ)<0)) {
|
||||
warn(1, "Unable to set up signal mask");
|
||||
pax_warn(1, "Unable to set up signal mask");
|
||||
return(-1);
|
||||
}
|
||||
n_hand.sa_mask = s_mask;
|
||||
@@ -404,6 +404,6 @@ gen_init()
|
||||
return(0);
|
||||
|
||||
out:
|
||||
syswarn(1, errno, "Unable to set up signal handler");
|
||||
sys_warn(1, errno, "Unable to set up signal handler");
|
||||
return(-1);
|
||||
}
|
||||
+16
-16
@@ -34,11 +34,11 @@
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: sel_subs.c,v 1.2 1994/09/24 02:56:29 davidg Exp $
|
||||
* $Id: sel_subs.c,v 1.3.2.1 1997/08/25 08:37:04 jkh Exp $
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
static char sccsid[] = "@(#)sel_subs.c 8.1 (Berkeley) 5/31/93";
|
||||
static char const sccsid[] = "@(#)sel_subs.c 8.1 (Berkeley) 5/31/93";
|
||||
#endif /* not lint */
|
||||
|
||||
#include <sys/types.h>
|
||||
@@ -129,7 +129,7 @@ usr_add(str)
|
||||
return(-1);
|
||||
if ((usrtb == NULL) &&
|
||||
((usrtb = (USRT **)calloc(USR_TB_SZ, sizeof(USRT *))) == NULL)) {
|
||||
warn(1, "Unable to allocate memory for user selection table");
|
||||
pax_warn(1, "Unable to allocate memory for user selection table");
|
||||
return(-1);
|
||||
}
|
||||
|
||||
@@ -143,7 +143,7 @@ usr_add(str)
|
||||
if ((str[0] == '\\') && (str[1] == '#'))
|
||||
++str;
|
||||
if ((pw = getpwnam(str)) == NULL) {
|
||||
warn(1, "Unable to find uid for user: %s", str);
|
||||
pax_warn(1, "Unable to find uid for user: %s", str);
|
||||
return(-1);
|
||||
}
|
||||
uid = (uid_t)pw->pw_uid;
|
||||
@@ -176,7 +176,7 @@ usr_add(str)
|
||||
usrtb[indx] = pt;
|
||||
return(0);
|
||||
}
|
||||
warn(1, "User selection table out of memory");
|
||||
pax_warn(1, "User selection table out of memory");
|
||||
return(-1);
|
||||
}
|
||||
|
||||
@@ -242,7 +242,7 @@ grp_add(str)
|
||||
return(-1);
|
||||
if ((grptb == NULL) &&
|
||||
((grptb = (GRPT **)calloc(GRP_TB_SZ, sizeof(GRPT *))) == NULL)) {
|
||||
warn(1, "Unable to allocate memory fo group selection table");
|
||||
pax_warn(1, "Unable to allocate memory fo group selection table");
|
||||
return(-1);
|
||||
}
|
||||
|
||||
@@ -256,7 +256,7 @@ grp_add(str)
|
||||
if ((str[0] == '\\') && (str[1] == '#'))
|
||||
++str;
|
||||
if ((gr = getgrnam(str)) == NULL) {
|
||||
warn(1,"Cannot determine gid for group name: %s", str);
|
||||
pax_warn(1,"Cannot determine gid for group name: %s", str);
|
||||
return(-1);
|
||||
}
|
||||
gid = (gid_t)gr->gr_gid;
|
||||
@@ -289,7 +289,7 @@ grp_add(str)
|
||||
grptb[indx] = pt;
|
||||
return(0);
|
||||
}
|
||||
warn(1, "Group selection table out of memory");
|
||||
pax_warn(1, "Group selection table out of memory");
|
||||
return(-1);
|
||||
}
|
||||
|
||||
@@ -375,7 +375,7 @@ trng_add(str)
|
||||
* throw out the badly formed time ranges
|
||||
*/
|
||||
if ((str == NULL) || (*str == '\0')) {
|
||||
warn(1, "Empty time range string");
|
||||
pax_warn(1, "Empty time range string");
|
||||
return(-1);
|
||||
}
|
||||
|
||||
@@ -402,7 +402,7 @@ trng_add(str)
|
||||
++dot;
|
||||
continue;
|
||||
}
|
||||
warn(1, "Improperly specified time range: %s", str);
|
||||
pax_warn(1, "Improperly specified time range: %s", str);
|
||||
goto out;
|
||||
}
|
||||
|
||||
@@ -410,7 +410,7 @@ trng_add(str)
|
||||
* allocate space for the time range and store the limits
|
||||
*/
|
||||
if ((pt = (TIME_RNG *)malloc(sizeof(TIME_RNG))) == NULL) {
|
||||
warn(1, "Unable to allocate memory for time range");
|
||||
pax_warn(1, "Unable to allocate memory for time range");
|
||||
return(-1);
|
||||
}
|
||||
|
||||
@@ -433,7 +433,7 @@ trng_add(str)
|
||||
pt->flgs |= CMPCTME;
|
||||
break;
|
||||
default:
|
||||
warn(1, "Bad option %c with time range %s",
|
||||
pax_warn(1, "Bad option %c with time range %s",
|
||||
*flgpt, str);
|
||||
goto out;
|
||||
}
|
||||
@@ -450,7 +450,7 @@ trng_add(str)
|
||||
* add lower limit
|
||||
*/
|
||||
if (str_sec(str, &(pt->low_time)) < 0) {
|
||||
warn(1, "Illegal lower time range %s", str);
|
||||
pax_warn(1, "Illegal lower time range %s", str);
|
||||
(void)free((char *)pt);
|
||||
goto out;
|
||||
}
|
||||
@@ -462,7 +462,7 @@ trng_add(str)
|
||||
* add upper limit
|
||||
*/
|
||||
if (str_sec(up_pt, &(pt->high_time)) < 0) {
|
||||
warn(1, "Illegal upper time range %s", up_pt);
|
||||
pax_warn(1, "Illegal upper time range %s", up_pt);
|
||||
(void)free((char *)pt);
|
||||
goto out;
|
||||
}
|
||||
@@ -473,7 +473,7 @@ trng_add(str)
|
||||
*/
|
||||
if (pt->flgs & HASLOW) {
|
||||
if (pt->low_time > pt->high_time) {
|
||||
warn(1, "Upper %s and lower %s time overlap",
|
||||
pax_warn(1, "Upper %s and lower %s time overlap",
|
||||
up_pt, str);
|
||||
(void)free((char *)pt);
|
||||
return(-1);
|
||||
@@ -491,7 +491,7 @@ trng_add(str)
|
||||
return(0);
|
||||
|
||||
out:
|
||||
warn(1, "Time range format is: [yy[mm[dd[hh]]]]mm[.ss][/[c][m]]");
|
||||
pax_warn(1, "Time range format is: [yy[mm[dd[hh]]]]mm[.ss][/[c][m]]");
|
||||
return(-1);
|
||||
}
|
||||
|
||||
|
||||
+27
-25
@@ -34,11 +34,11 @@
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: tables.c,v 1.3 1995/05/30 00:07:01 rgrimes Exp $
|
||||
* $Id: tables.c,v 1.4.2.2 1997/08/25 08:37:05 jkh Exp $
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
static char sccsid[] = "@(#)tables.c 8.1 (Berkeley) 5/31/93";
|
||||
static char const sccsid[] = "@(#)tables.c 8.1 (Berkeley) 5/31/93";
|
||||
#endif /* not lint */
|
||||
|
||||
#include <sys/types.h>
|
||||
@@ -115,7 +115,7 @@ lnk_start()
|
||||
if (ltab != NULL)
|
||||
return(0);
|
||||
if ((ltab = (HRDLNK **)calloc(L_TAB_SZ, sizeof(HRDLNK *))) == NULL) {
|
||||
warn(1, "Cannot allocate memory for hard link table");
|
||||
pax_warn(1, "Cannot allocate memory for hard link table");
|
||||
return(-1);
|
||||
}
|
||||
return(0);
|
||||
@@ -180,6 +180,7 @@ chk_lnk(arcn)
|
||||
*/
|
||||
arcn->ln_nlen = l_strncpy(arcn->ln_name, pt->name,
|
||||
PAXPATHLEN+1);
|
||||
arcn->ln_name[PAXPATHLEN] = '\0';
|
||||
if (arcn->type == PAX_REG)
|
||||
arcn->type = PAX_HRG;
|
||||
else
|
||||
@@ -214,7 +215,7 @@ chk_lnk(arcn)
|
||||
(void)free((char *)pt);
|
||||
}
|
||||
|
||||
warn(1, "Hard link table out of memory");
|
||||
pax_warn(1, "Hard link table out of memory");
|
||||
return(-1);
|
||||
}
|
||||
|
||||
@@ -363,7 +364,7 @@ ftime_start()
|
||||
if (ftab != NULL)
|
||||
return(0);
|
||||
if ((ftab = (FTM **)calloc(F_TAB_SZ, sizeof(FTM *))) == NULL) {
|
||||
warn(1, "Cannot allocate memory for file time table");
|
||||
pax_warn(1, "Cannot allocate memory for file time table");
|
||||
return(-1);
|
||||
}
|
||||
|
||||
@@ -376,7 +377,7 @@ ftime_start()
|
||||
(void)unlink(pt);
|
||||
|
||||
if ((ffd = open(pt, O_RDWR | O_CREAT, S_IRWXU)) < 0) {
|
||||
syswarn(1, errno, "Unable to open temporary file: %s", pt);
|
||||
sys_warn(1, errno, "Unable to open temporary file: %s", pt);
|
||||
return(-1);
|
||||
}
|
||||
|
||||
@@ -434,12 +435,12 @@ chk_ftime(arcn)
|
||||
* from the scratch file.
|
||||
*/
|
||||
if (lseek(ffd,pt->seek,SEEK_SET) != pt->seek) {
|
||||
syswarn(1, errno,
|
||||
sys_warn(1, errno,
|
||||
"Failed ftime table seek");
|
||||
return(-1);
|
||||
}
|
||||
if (read(ffd, ckname, namelen) != namelen) {
|
||||
syswarn(1, errno,
|
||||
sys_warn(1, errno,
|
||||
"Failed ftime table read");
|
||||
return(-1);
|
||||
}
|
||||
@@ -491,11 +492,11 @@ chk_ftime(arcn)
|
||||
ftab[indx] = pt;
|
||||
return(0);
|
||||
}
|
||||
syswarn(1, errno, "Failed write to file time table");
|
||||
sys_warn(1, errno, "Failed write to file time table");
|
||||
} else
|
||||
syswarn(1, errno, "Failed seek on file time table");
|
||||
sys_warn(1, errno, "Failed seek on file time table");
|
||||
} else
|
||||
warn(1, "File time table ran out of memory");
|
||||
pax_warn(1, "File time table ran out of memory");
|
||||
|
||||
if (pt != NULL)
|
||||
(void)free((char *)pt);
|
||||
@@ -532,7 +533,7 @@ name_start()
|
||||
if (ntab != NULL)
|
||||
return(0);
|
||||
if ((ntab = (NAMT **)calloc(N_TAB_SZ, sizeof(NAMT *))) == NULL) {
|
||||
warn(1, "Cannot allocate memory for interactive rename table");
|
||||
pax_warn(1, "Cannot allocate memory for interactive rename table");
|
||||
return(-1);
|
||||
}
|
||||
return(0);
|
||||
@@ -565,7 +566,7 @@ add_name(oname, onamelen, nname)
|
||||
/*
|
||||
* should never happen
|
||||
*/
|
||||
warn(0, "No interactive rename table, links may fail\n");
|
||||
pax_warn(0, "No interactive rename table, links may fail\n");
|
||||
return(0);
|
||||
}
|
||||
|
||||
@@ -591,7 +592,7 @@ add_name(oname, onamelen, nname)
|
||||
|
||||
(void)free((char *)pt->nname);
|
||||
if ((pt->nname = strdup(nname)) == NULL) {
|
||||
warn(1, "Cannot update rename table");
|
||||
pax_warn(1, "Cannot update rename table");
|
||||
return(-1);
|
||||
}
|
||||
return(0);
|
||||
@@ -612,7 +613,7 @@ add_name(oname, onamelen, nname)
|
||||
}
|
||||
(void)free((char *)pt);
|
||||
}
|
||||
warn(1, "Interactive rename table out of memory");
|
||||
pax_warn(1, "Interactive rename table out of memory");
|
||||
return(-1);
|
||||
}
|
||||
|
||||
@@ -655,6 +656,7 @@ sub_name(oname, onamelen)
|
||||
* and return (we know that oname has enough space)
|
||||
*/
|
||||
*onamelen = l_strncpy(oname, pt->nname, PAXPATHLEN+1);
|
||||
oname[PAXPATHLEN] = '\0';
|
||||
return;
|
||||
}
|
||||
pt = pt->fow;
|
||||
@@ -724,7 +726,7 @@ dev_start()
|
||||
if (dtab != NULL)
|
||||
return(0);
|
||||
if ((dtab = (DEVT **)calloc(D_TAB_SZ, sizeof(DEVT *))) == NULL) {
|
||||
warn(1, "Cannot allocate memory for device mapping table");
|
||||
pax_warn(1, "Cannot allocate memory for device mapping table");
|
||||
return(-1);
|
||||
}
|
||||
return(0);
|
||||
@@ -810,7 +812,7 @@ chk_dev(dev, add)
|
||||
* list must be NULL.
|
||||
*/
|
||||
if ((pt = (DEVT *)malloc(sizeof(DEVT))) == NULL) {
|
||||
warn(1, "Device map table out of memory");
|
||||
pax_warn(1, "Device map table out of memory");
|
||||
return(NULL);
|
||||
}
|
||||
pt->dev = dev;
|
||||
@@ -952,9 +954,9 @@ map_dev(arcn, dev_mask, ino_mask)
|
||||
return(0);
|
||||
|
||||
bad:
|
||||
warn(1, "Unable to fix truncated inode/device field when storing %s",
|
||||
pax_warn(1, "Unable to fix truncated inode/device field when storing %s",
|
||||
arcn->name);
|
||||
warn(0, "Archive may create improper hard links when extracted");
|
||||
pax_warn(0, "Archive may create improper hard links when extracted");
|
||||
return(0);
|
||||
}
|
||||
|
||||
@@ -993,7 +995,7 @@ atdir_start()
|
||||
if (atab != NULL)
|
||||
return(0);
|
||||
if ((atab = (ATDIR **)calloc(A_TAB_SZ, sizeof(ATDIR *))) == NULL) {
|
||||
warn(1,"Cannot allocate space for directory access time table");
|
||||
pax_warn(1,"Cannot allocate space for directory access time table");
|
||||
return(-1);
|
||||
}
|
||||
return(0);
|
||||
@@ -1100,7 +1102,7 @@ add_atdir(fname, dev, ino, mtime, atime)
|
||||
(void)free((char *)pt);
|
||||
}
|
||||
|
||||
warn(1, "Directory access time reset table ran out of memory");
|
||||
pax_warn(1, "Directory access time reset table ran out of memory");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1222,7 +1224,7 @@ dir_start()
|
||||
(void)unlink(pt);
|
||||
return(0);
|
||||
}
|
||||
warn(1, "Unable to create temporary file for directory times: %s", pt);
|
||||
pax_warn(1, "Unable to create temporary file for directory times: %s", pt);
|
||||
return(-1);
|
||||
}
|
||||
|
||||
@@ -1261,7 +1263,7 @@ add_dir(name, nlen, psb, frc_mode)
|
||||
* in the trailer
|
||||
*/
|
||||
if ((dblk.npos = lseek(dirfd, 0L, SEEK_CUR)) < 0) {
|
||||
warn(1,"Unable to store mode and times for directory: %s",name);
|
||||
pax_warn(1,"Unable to store mode and times for directory: %s",name);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1279,7 +1281,7 @@ add_dir(name, nlen, psb, frc_mode)
|
||||
return;
|
||||
}
|
||||
|
||||
warn(1,"Unable to store mode and times for created directory: %s",name);
|
||||
pax_warn(1,"Unable to store mode and times for created directory: %s",name);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1335,7 +1337,7 @@ proc_dir()
|
||||
(void)close(dirfd);
|
||||
dirfd = -1;
|
||||
if (cnt != dircnt)
|
||||
warn(1,"Unable to set mode and times for created directories");
|
||||
pax_warn(1,"Unable to set mode and times for created directories");
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
+18
-18
@@ -34,11 +34,11 @@
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: tar.c,v 1.3 1995/05/30 00:07:03 rgrimes Exp $
|
||||
* $Id: tar.c,v 1.4.2.1 1997/08/25 08:37:05 jkh Exp $
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
static char sccsid[] = "@(#)tar.c 8.2 (Berkeley) 4/18/94";
|
||||
static char const sccsid[] = "@(#)tar.c 8.2 (Berkeley) 4/18/94";
|
||||
#endif /* not lint */
|
||||
|
||||
#include <sys/types.h>
|
||||
@@ -397,9 +397,9 @@ tar_opt()
|
||||
while ((opt = opt_next()) != NULL) {
|
||||
if (strcmp(opt->name, TAR_OPTION) ||
|
||||
strcmp(opt->value, TAR_NODIR)) {
|
||||
warn(1, "Unknown tar format -o option/value pair %s=%s",
|
||||
pax_warn(1, "Unknown tar format -o option/value pair %s=%s",
|
||||
opt->name, opt->value);
|
||||
warn(1,"%s=%s is the only supported tar format option",
|
||||
pax_warn(1,"%s=%s is the only supported tar format option",
|
||||
TAR_OPTION, TAR_NODIR);
|
||||
return(-1);
|
||||
}
|
||||
@@ -408,7 +408,7 @@ tar_opt()
|
||||
* we only support one option, and only when writing
|
||||
*/
|
||||
if ((act != APPND) && (act != ARCHIVE)) {
|
||||
warn(1, "%s=%s is only supported when writing.",
|
||||
pax_warn(1, "%s=%s is only supported when writing.",
|
||||
opt->name, opt->value);
|
||||
return(-1);
|
||||
}
|
||||
@@ -574,23 +574,23 @@ tar_wr(arcn)
|
||||
return(1);
|
||||
break;
|
||||
case PAX_CHR:
|
||||
warn(1, "Tar cannot archive a character device %s",
|
||||
pax_warn(1, "Tar cannot archive a character device %s",
|
||||
arcn->org_name);
|
||||
return(1);
|
||||
case PAX_BLK:
|
||||
warn(1, "Tar cannot archive a block device %s", arcn->org_name);
|
||||
pax_warn(1, "Tar cannot archive a block device %s", arcn->org_name);
|
||||
return(1);
|
||||
case PAX_SCK:
|
||||
warn(1, "Tar cannot archive a socket %s", arcn->org_name);
|
||||
pax_warn(1, "Tar cannot archive a socket %s", arcn->org_name);
|
||||
return(1);
|
||||
case PAX_FIF:
|
||||
warn(1, "Tar cannot archive a fifo %s", arcn->org_name);
|
||||
pax_warn(1, "Tar cannot archive a fifo %s", arcn->org_name);
|
||||
return(1);
|
||||
case PAX_SLK:
|
||||
case PAX_HLK:
|
||||
case PAX_HRG:
|
||||
if (arcn->ln_nlen > sizeof(hd->linkname)) {
|
||||
warn(1,"Link name too long for tar %s", arcn->ln_name);
|
||||
pax_warn(1,"Link name too long for tar %s", arcn->ln_name);
|
||||
return(1);
|
||||
}
|
||||
break;
|
||||
@@ -607,7 +607,7 @@ tar_wr(arcn)
|
||||
if (arcn->type == PAX_DIR)
|
||||
++len;
|
||||
if (len > sizeof(hd->name)) {
|
||||
warn(1, "File name too long for tar %s", arcn->name);
|
||||
pax_warn(1, "File name too long for tar %s", arcn->name);
|
||||
return(1);
|
||||
}
|
||||
|
||||
@@ -663,7 +663,7 @@ tar_wr(arcn)
|
||||
if (uqd_oct((u_quad_t)arcn->sb.st_size, hd->size,
|
||||
sizeof(hd->size), 1)) {
|
||||
# endif
|
||||
warn(1,"File is too large for tar %s", arcn->org_name);
|
||||
pax_warn(1,"File is too large for tar %s", arcn->org_name);
|
||||
return(1);
|
||||
}
|
||||
arcn->pad = TAR_PAD(arcn->sb.st_size);
|
||||
@@ -698,7 +698,7 @@ tar_wr(arcn)
|
||||
/*
|
||||
* header field is out of range
|
||||
*/
|
||||
warn(1, "Tar header field is too small for %s", arcn->org_name);
|
||||
pax_warn(1, "Tar header field is too small for %s", arcn->org_name);
|
||||
return(1);
|
||||
}
|
||||
|
||||
@@ -968,7 +968,7 @@ ustar_wr(arcn)
|
||||
* check for those file system types ustar cannot store
|
||||
*/
|
||||
if (arcn->type == PAX_SCK) {
|
||||
warn(1, "Ustar cannot archive a socket %s", arcn->org_name);
|
||||
pax_warn(1, "Ustar cannot archive a socket %s", arcn->org_name);
|
||||
return(1);
|
||||
}
|
||||
|
||||
@@ -977,7 +977,7 @@ ustar_wr(arcn)
|
||||
*/
|
||||
if (((arcn->type == PAX_SLK) || (arcn->type == PAX_HLK) ||
|
||||
(arcn->type == PAX_HRG)) && (arcn->ln_nlen > sizeof(hd->linkname))){
|
||||
warn(1, "Link name too long for ustar %s", arcn->ln_name);
|
||||
pax_warn(1, "Link name too long for ustar %s", arcn->ln_name);
|
||||
return(1);
|
||||
}
|
||||
|
||||
@@ -986,7 +986,7 @@ ustar_wr(arcn)
|
||||
* pt != arcn->name, the name has to be split
|
||||
*/
|
||||
if ((pt = name_split(arcn->name, arcn->nlen)) == NULL) {
|
||||
warn(1, "File name too long for ustar %s", arcn->name);
|
||||
pax_warn(1, "File name too long for ustar %s", arcn->name);
|
||||
return(1);
|
||||
}
|
||||
hd = (HD_USTAR *)hdblk;
|
||||
@@ -1080,7 +1080,7 @@ ustar_wr(arcn)
|
||||
if (uqd_oct((u_quad_t)arcn->sb.st_size, hd->size,
|
||||
sizeof(hd->size), 3)) {
|
||||
# endif
|
||||
warn(1,"File is too long for ustar %s",arcn->org_name);
|
||||
pax_warn(1,"File is too long for ustar %s",arcn->org_name);
|
||||
return(1);
|
||||
}
|
||||
break;
|
||||
@@ -1121,7 +1121,7 @@ ustar_wr(arcn)
|
||||
/*
|
||||
* header field is out of range
|
||||
*/
|
||||
warn(1, "Ustar header field is too small for %s", arcn->org_name);
|
||||
pax_warn(1, "Ustar header field is too small for %s", arcn->org_name);
|
||||
return(1);
|
||||
}
|
||||
|
||||
|
||||
+11
-11
@@ -34,11 +34,11 @@
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: tty_subs.c,v 1.2 1994/09/24 02:56:38 davidg Exp $
|
||||
* $Id: tty_subs.c,v 1.3.2.1 1997/08/25 08:37:06 jkh Exp $
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
static char sccsid[] = "@(#)tty_subs.c 8.2 (Berkeley) 4/18/94";
|
||||
static char const sccsid[] = "@(#)tty_subs.c 8.2 (Berkeley) 4/18/94";
|
||||
#endif /* not lint */
|
||||
|
||||
#include <sys/types.h>
|
||||
@@ -93,7 +93,7 @@ tty_init()
|
||||
}
|
||||
|
||||
if (iflag) {
|
||||
warn(1, "Fatal error, cannot open %s", DEVTTY);
|
||||
pax_warn(1, "Fatal error, cannot open %s", DEVTTY);
|
||||
return(-1);
|
||||
}
|
||||
return(0);
|
||||
@@ -161,17 +161,17 @@ tty_read(str, len)
|
||||
}
|
||||
|
||||
/*
|
||||
* warn()
|
||||
* write a warning message to stderr. if "set" the exit value of pax
|
||||
* pax_warn()
|
||||
* write a pax_warning message to stderr. if "set" the exit value of pax
|
||||
* will be non-zero.
|
||||
*/
|
||||
|
||||
#if __STDC__
|
||||
void
|
||||
warn(int set, char *fmt, ...)
|
||||
pax_warn(int set, char *fmt, ...)
|
||||
#else
|
||||
void
|
||||
warn(set, fmt, va_alist)
|
||||
pax_warn(set, fmt, va_alist)
|
||||
int set;
|
||||
char *fmt;
|
||||
va_dcl
|
||||
@@ -200,17 +200,17 @@ warn(set, fmt, va_alist)
|
||||
}
|
||||
|
||||
/*
|
||||
* syswarn()
|
||||
* write a warning message to stderr. if "set" the exit value of pax
|
||||
* sys_warn()
|
||||
* write a pax_warning message to stderr. if "set" the exit value of pax
|
||||
* will be non-zero.
|
||||
*/
|
||||
|
||||
#if __STDC__
|
||||
void
|
||||
syswarn(int set, int errnum, char *fmt, ...)
|
||||
sys_warn(int set, int errnum, char *fmt, ...)
|
||||
#else
|
||||
void
|
||||
syswarn(set, errnum, fmt, va_alist)
|
||||
sys_warn(set, errnum, fmt, va_alist)
|
||||
int set;
|
||||
int errnum;
|
||||
char *fmt;
|
||||
|
||||
+2
-2
@@ -1,9 +1,9 @@
|
||||
# @(#)Makefile 8.1 (Berkeley) 6/2/93
|
||||
# $Id: Makefile,v 1.5 1995/04/15 03:31:19 davidg Exp $
|
||||
# $Id: Makefile,v 1.6 1995/10/25 15:07:38 torstenb Exp $
|
||||
|
||||
PROG= ps
|
||||
SRCS= fmt.c keyword.c nlist.c print.c ps.c
|
||||
CFLAGS+=-I/sys
|
||||
CFLAGS+=-I${.CURDIR}/../../sys
|
||||
DPADD= ${LIBM} ${LIBKVM}
|
||||
LDADD= -lm -lkvm
|
||||
BINGRP= kmem
|
||||
|
||||
+2
-2
@@ -30,7 +30,7 @@
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: print.c,v 1.16 1996/10/21 07:30:24 peter Exp $
|
||||
* $Id: print.c,v 1.16.2.1 1997/04/16 16:10:48 jdp Exp $
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
@@ -405,7 +405,7 @@ lstarted(k, ve)
|
||||
(void)printf("%-*s", v->width, "-");
|
||||
return;
|
||||
}
|
||||
(void)strftime(buf, sizeof(buf) -1, "%C",
|
||||
(void)strftime(buf, sizeof(buf) -1, "%c",
|
||||
localtime(&k->ki_u.u_start.tv_sec));
|
||||
(void)printf("%-*s", v->width, buf);
|
||||
}
|
||||
|
||||
+2
-2
@@ -30,7 +30,7 @@
|
||||
.\" SUCH DAMAGE.
|
||||
.\"
|
||||
.\" @(#)ps.1 8.3 (Berkeley) 4/18/94
|
||||
.\" $Id: ps.1,v 1.10 1996/07/03 22:17:28 mpp Exp $
|
||||
.\" $Id: ps.1,v 1.11 1996/10/21 07:30:25 peter Exp $
|
||||
.\"
|
||||
.Dd April 18, 1994
|
||||
.Dt PS 1
|
||||
@@ -217,7 +217,7 @@ the include file
|
||||
The soft limit on memory used, specified via a call to
|
||||
.Xr setrlimit 2 .
|
||||
.It lstart
|
||||
The exact time the command started, using the ``%C'' format described in
|
||||
The exact time the command started, using the ``%c'' format described in
|
||||
.Xr strftime 3 .
|
||||
.It nice
|
||||
The process scheduling increment (see
|
||||
|
||||
+5
-6
@@ -30,7 +30,7 @@
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: ps.c,v 1.13 1996/10/21 07:30:26 peter Exp $
|
||||
* $Id: ps.c,v 1.13.2.1 1996/11/11 21:23:15 phk Exp $
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
@@ -517,10 +517,9 @@ static void
|
||||
usage()
|
||||
{
|
||||
|
||||
(void)fprintf(stderr,
|
||||
"usage:\t%s\n\t %s\n\t%s\n",
|
||||
"ps [-aChjlmrSTuvwx] [-O|o fmt] [-p pid] [-t tty] [-U user]",
|
||||
"[-M core] [-N system] [-W swap]",
|
||||
"ps [-L]");
|
||||
(void)fprintf(stderr, "%s\n%s\n%s\n",
|
||||
"usage: ps [-aChjlmrSTuvwx] [-O|o fmt] [-p pid] [-t tty] [-U user]",
|
||||
" [-M core] [-N system] [-W swap]",
|
||||
" ps [-L]");
|
||||
exit(1);
|
||||
}
|
||||
+4
-4
@@ -30,17 +30,17 @@
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id$
|
||||
* $Id: pwd.c,v 1.2 1994/09/24 02:56:52 davidg Exp $
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
static char copyright[] =
|
||||
static char const copyright[] =
|
||||
"@(#) Copyright (c) 1991, 1993, 1994\n\
|
||||
The Regents of the University of California. All rights reserved.\n";
|
||||
#endif /* not lint */
|
||||
|
||||
#ifndef lint
|
||||
static char sccsid[] = "@(#)pwd.c 8.3 (Berkeley) 4/1/94";
|
||||
static char const sccsid[] = "@(#)pwd.c 8.3 (Berkeley) 4/1/94";
|
||||
#endif /* not lint */
|
||||
|
||||
#include <err.h>
|
||||
@@ -65,7 +65,7 @@ main(argc, argv)
|
||||
* there's no way to display a logical path after forking. We don't
|
||||
* document either flag, only adding -P for future portability.
|
||||
*/
|
||||
while ((ch = getopt(argc, argv, "P")) != EOF)
|
||||
while ((ch = getopt(argc, argv, "P")) != -1)
|
||||
switch (ch) {
|
||||
case 'P':
|
||||
break;
|
||||
|
||||
+11
-10
@@ -30,17 +30,17 @@
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id$
|
||||
* $Id: rcp.c,v 1.8.2.2 1997/06/06 16:11:15 charnier Exp $
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
static char copyright[] =
|
||||
static char const copyright[] =
|
||||
"@(#) Copyright (c) 1983, 1990, 1992, 1993\n\
|
||||
The Regents of the University of California. All rights reserved.\n";
|
||||
#endif /* not lint */
|
||||
|
||||
#ifndef lint
|
||||
static char sccsid[] = "@(#)rcp.c 8.2 (Berkeley) 4/2/94";
|
||||
static char const sccsid[] = "@(#)rcp.c 8.2 (Berkeley) 4/2/94";
|
||||
#endif /* not lint */
|
||||
|
||||
#include <sys/param.h>
|
||||
@@ -121,7 +121,7 @@ main(argc, argv)
|
||||
char *targ, *shell;
|
||||
|
||||
fflag = tflag = 0;
|
||||
while ((ch = getopt(argc, argv, OPTIONS)) != EOF)
|
||||
while ((ch = getopt(argc, argv, OPTIONS)) != -1)
|
||||
switch(ch) { /* User-visible flags. */
|
||||
case 'K':
|
||||
#ifdef KERBEROS
|
||||
@@ -851,17 +851,18 @@ usage()
|
||||
{
|
||||
#ifdef KERBEROS
|
||||
#ifdef CRYPT
|
||||
(void)fprintf(stderr, "%s\n\t%s\n",
|
||||
(void)fprintf(stderr, "%s\n%s\n",
|
||||
"usage: rcp [-Kpx] [-k realm] f1 f2",
|
||||
"or: rcp [-Kprx] [-k realm] f1 ... fn directory");
|
||||
" rcp [-Kprx] [-k realm] f1 ... fn directory");
|
||||
#else
|
||||
(void)fprintf(stderr, "%s\n\t%s\n",
|
||||
(void)fprintf(stderr, "%s\n%s\n",
|
||||
"usage: rcp [-Kp] [-k realm] f1 f2",
|
||||
"or: rcp [-Kpr] [-k realm] f1 ... fn directory");
|
||||
" rcp [-Kpr] [-k realm] f1 ... fn directory");
|
||||
#endif
|
||||
#else
|
||||
(void)fprintf(stderr,
|
||||
"usage: rcp [-p] f1 f2; or: rcp [-pr] f1 ... fn directory\n");
|
||||
(void)fprintf(stderr, "%s\n%s\n",
|
||||
"usage: rcp [-p] f1 f2",
|
||||
" rcp [-pr] f1 ... fn directory");
|
||||
#endif
|
||||
exit(1);
|
||||
}
|
||||
|
||||
+2
-2
@@ -30,11 +30,11 @@
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: util.c,v 1.3 1995/03/19 13:29:16 joerg Exp $
|
||||
* $Id: util.c,v 1.4 1995/05/30 00:07:07 rgrimes Exp $
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
static char sccsid[] = "@(#)util.c 8.2 (Berkeley) 4/2/94";
|
||||
static char const sccsid[] = "@(#)util.c 8.2 (Berkeley) 4/2/94";
|
||||
#endif /* not lint */
|
||||
|
||||
#include <sys/param.h>
|
||||
|
||||
+18
-36
@@ -30,7 +30,7 @@
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: rmail.c,v 1.5 1995/05/30 00:07:08 rgrimes Exp $
|
||||
* $Id: rmail.c,v 1.6 1995/09/16 18:52:51 pst Exp $
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
@@ -72,6 +72,8 @@ static char sccsid[] = "@(#)rmail.c 8.1 (Berkeley) 5/31/93";
|
||||
#include <sys/wait.h>
|
||||
|
||||
#include <ctype.h>
|
||||
#include <err.h>
|
||||
#include <errno.h>
|
||||
#include <fcntl.h>
|
||||
#include <paths.h>
|
||||
#include <stdio.h>
|
||||
@@ -80,7 +82,6 @@ static char sccsid[] = "@(#)rmail.c 8.1 (Berkeley) 5/31/93";
|
||||
#include <sysexits.h>
|
||||
#include <unistd.h>
|
||||
|
||||
void err __P((int, const char *, ...));
|
||||
void usage __P((void));
|
||||
|
||||
int
|
||||
@@ -88,8 +89,6 @@ main(argc, argv)
|
||||
int argc;
|
||||
char *argv[];
|
||||
{
|
||||
extern char *optarg;
|
||||
extern int errno, optind;
|
||||
FILE *fp;
|
||||
struct stat sb;
|
||||
size_t fplen, fptlen, len;
|
||||
@@ -101,7 +100,7 @@ main(argc, argv)
|
||||
|
||||
debug = 0;
|
||||
domain = "UUCP"; /* Default "domain". */
|
||||
while ((ch = getopt(argc, argv, "D:T")) != EOF)
|
||||
while ((ch = getopt(argc, argv, "D:T")) != -1)
|
||||
switch (ch) {
|
||||
case 'T':
|
||||
debug = 1;
|
||||
@@ -262,11 +261,22 @@ main(argc, argv)
|
||||
/*
|
||||
* Don't copy arguments beginning with - as they will be
|
||||
* passed to sendmail and could be interpreted as flags.
|
||||
* To prevent confusion of sendmail wrap < and > around
|
||||
* the address (helps to pass addrs like @gw1,@gw2:aa@bb)
|
||||
*/
|
||||
do {
|
||||
if (*argv && **argv == '-')
|
||||
while (*argv) {
|
||||
if (**argv == '-')
|
||||
err(EX_USAGE, "dash precedes argument: %s", *argv);
|
||||
} while ((args[i++] = *argv++) != NULL);
|
||||
if (strchr(*argv, ',') == NULL || strchr(*argv, '<') != NULL)
|
||||
args[i++] = *argv;
|
||||
else {
|
||||
if ((args[i] = malloc(strlen(*argv) + 3)) == NULL)
|
||||
err(EX_TEMPFAIL, "Cannot malloc");
|
||||
sprintf (args [i++], "<%s>", *argv);
|
||||
}
|
||||
argv++;
|
||||
}
|
||||
args[i] = 0;
|
||||
|
||||
if (debug) {
|
||||
(void)fprintf(stderr, "Sendmail arguments:\n");
|
||||
@@ -339,31 +349,3 @@ usage()
|
||||
exit(EX_USAGE);
|
||||
}
|
||||
|
||||
#ifdef __STDC__
|
||||
#include <stdarg.h>
|
||||
#else
|
||||
#include <varargs.h>
|
||||
#endif
|
||||
|
||||
void
|
||||
#ifdef __STDC__
|
||||
err(int eval, const char *fmt, ...)
|
||||
#else
|
||||
err(eval, fmt, va_alist)
|
||||
int eval;
|
||||
const char *fmt;
|
||||
va_dcl
|
||||
#endif
|
||||
{
|
||||
va_list ap;
|
||||
#if __STDC__
|
||||
va_start(ap, fmt);
|
||||
#else
|
||||
va_start(ap);
|
||||
#endif
|
||||
(void)fprintf(stderr, "rmail: ");
|
||||
(void)vfprintf(stderr, fmt, ap);
|
||||
va_end(ap);
|
||||
(void)fprintf(stderr, "\n");
|
||||
exit(eval);
|
||||
}
|
||||
+16
-16
@@ -33,7 +33,7 @@
|
||||
.\" SUCH DAMAGE.
|
||||
.\"
|
||||
.\" @(#)rmdir.1 8.1 (Berkeley) 5/31/93
|
||||
.\" $Id: rmdir.1,v 1.2 1994/09/24 02:57:11 davidg Exp $
|
||||
.\" $Id: rmdir.1,v 1.3 1996/08/29 18:06:08 wosch Exp $
|
||||
.\"
|
||||
.Dd May 31, 1993
|
||||
.Dt RMDIR 1
|
||||
@@ -43,7 +43,7 @@
|
||||
.Nd remove directories
|
||||
.Sh SYNOPSIS
|
||||
.Nm rmdir
|
||||
.\" .Op Fl p
|
||||
.Op Fl p
|
||||
.Ar directory ...
|
||||
.Sh DESCRIPTION
|
||||
The rmdir utility removes the directory entry specified by
|
||||
@@ -58,24 +58,24 @@ must be specified first so the parent directory
|
||||
is empty when
|
||||
.Nm rmdir
|
||||
tries to remove it.
|
||||
.\" .Pp
|
||||
.\" The following option is available:
|
||||
.\" .Bl -tag -width Ds
|
||||
.\" .It Fl p
|
||||
.\" Each
|
||||
.\" .Ar directory
|
||||
.\" argument is treated as a pathname of which all
|
||||
.\" components will be removed, if they are empty,
|
||||
.\" starting with the last most component.
|
||||
.\" (See
|
||||
.\" .Xr rm 1
|
||||
.\" for fully non-discriminant recursive removal).
|
||||
.\" .El
|
||||
.Pp
|
||||
The following option is available:
|
||||
.Bl -tag -width Ds
|
||||
.It Fl p
|
||||
Each
|
||||
.Ar directory
|
||||
argument is treated as a pathname of which all
|
||||
components will be removed, if they are empty,
|
||||
starting with the last most component.
|
||||
(See
|
||||
.Xr rm 1
|
||||
for fully non-discriminant recursive removal.)
|
||||
.El
|
||||
.Pp
|
||||
The
|
||||
.Nm rmdir
|
||||
utility exits with one of the following values:
|
||||
.Bl -tag -width flag
|
||||
.Bl -tag -width Ds
|
||||
.It Li \&0
|
||||
Each directory entry specified by a dir operand
|
||||
referred to an empty directory and was removed
|
||||
|
||||
+45
-7
@@ -30,17 +30,17 @@
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id$
|
||||
* $Id: rmdir.c,v 1.2 1994/09/24 02:57:13 davidg Exp $
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
static char copyright[] =
|
||||
static char const copyright[] =
|
||||
"@(#) Copyright (c) 1992, 1993, 1994\n\
|
||||
The Regents of the University of California. All rights reserved.\n";
|
||||
#endif /* not lint */
|
||||
|
||||
#ifndef lint
|
||||
static char sccsid[] = "@(#)rmdir.c 8.3 (Berkeley) 4/2/94";
|
||||
static char const sccsid[] = "@(#)rmdir.c 8.3 (Berkeley) 4/2/94";
|
||||
#endif /* not lint */
|
||||
|
||||
#include <err.h>
|
||||
@@ -50,6 +50,7 @@ static char sccsid[] = "@(#)rmdir.c 8.3 (Berkeley) 4/2/94";
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
|
||||
int rm_path __P((char *));
|
||||
void usage __P((void));
|
||||
|
||||
int
|
||||
@@ -58,9 +59,14 @@ main(argc, argv)
|
||||
char *argv[];
|
||||
{
|
||||
int ch, errors;
|
||||
int pflag;
|
||||
|
||||
while ((ch = getopt(argc, argv, "")) != EOF)
|
||||
pflag = 0;
|
||||
while ((ch = getopt(argc, argv, "p")) != -1)
|
||||
switch(ch) {
|
||||
case 'p':
|
||||
pflag = 1;
|
||||
break;
|
||||
case '?':
|
||||
default:
|
||||
usage();
|
||||
@@ -71,18 +77,50 @@ main(argc, argv)
|
||||
if (argc == 0)
|
||||
usage();
|
||||
|
||||
for (errors = 0; *argv; ++argv)
|
||||
for (errors = 0; *argv; argv++) {
|
||||
char *p;
|
||||
|
||||
/* Delete trailing slashes, per POSIX. */
|
||||
p = *argv + strlen(*argv);
|
||||
while (--p > *argv && *p == '/')
|
||||
;
|
||||
*++p = '\0';
|
||||
|
||||
if (rmdir(*argv) < 0) {
|
||||
warn("%s", *argv);
|
||||
errors = 1;
|
||||
}
|
||||
} else if (pflag)
|
||||
errors |= rm_path(*argv);
|
||||
}
|
||||
|
||||
exit(errors);
|
||||
}
|
||||
|
||||
int
|
||||
rm_path(path)
|
||||
char *path;
|
||||
{
|
||||
char *p;
|
||||
|
||||
while ((p = strrchr(path, '/')) != NULL) {
|
||||
/* Delete trailing slashes. */
|
||||
while (--p > path && *p == '/')
|
||||
;
|
||||
*++p = '\0';
|
||||
|
||||
if (rmdir(path) < 0) {
|
||||
warn("%s", path);
|
||||
return (1);
|
||||
}
|
||||
}
|
||||
|
||||
return (0);
|
||||
}
|
||||
|
||||
void
|
||||
usage()
|
||||
{
|
||||
|
||||
(void)fprintf(stderr, "usage: rmdir directory ...\n");
|
||||
(void)fprintf(stderr, "usage: rmdir [-p] directory ...\n");
|
||||
exit(1);
|
||||
}
|
||||
+33
-16
@@ -1,15 +1,13 @@
|
||||
# @(#)Makefile 8.4 (Berkeley) 5/5/95
|
||||
# $Id: Makefile,v 1.14 1996/09/01 10:27:49 peter Exp $
|
||||
# $Id: Makefile,v 1.15.2.1 1997/08/25 09:09:28 jkh Exp $
|
||||
|
||||
PROG= sh
|
||||
SHSRCS= alias.c cd.c echo.c error.c eval.c exec.c expand.c \
|
||||
histedit.c input.c jobs.c mail.c main.c memalloc.c miscbltin.c \
|
||||
mystring.c options.c parser.c printf.c redir.c show.c \
|
||||
trap.c output.c var.c
|
||||
|
||||
GENSRCS=arith.c arith_lex.c builtins.c init.c nodes.c syntax.c
|
||||
|
||||
SRCS= ${GENSRCS} ${SHSRCS}
|
||||
mystring.c options.c output.c parser.c printf.c redir.c show.c \
|
||||
trap.c var.c
|
||||
GENSRCS= arith.c arith_lex.c builtins.c init.c nodes.c syntax.c
|
||||
SRCS= ${SHSRCS} ${GENSRCS}
|
||||
|
||||
DPADD+= ${LIBL} ${LIBEDIT} ${LIBTERMCAP}
|
||||
LDADD+= -ll -ledit -ltermcap
|
||||
@@ -21,17 +19,18 @@ CFLAGS+=-DSHELL -I. -I${.CURDIR}
|
||||
|
||||
.PATH: ${.CURDIR}/bltin ${.CURDIR}/../../usr.bin/printf
|
||||
|
||||
CLEANFILES+= builtins.h mkinit mkinit.o mknodes mknodes.o \
|
||||
mksyntax mksyntax.o \
|
||||
nodes.h syntax.h token.h y.tab.h
|
||||
CLEANFILES+= ${GENSRCS}
|
||||
CLEANFILES+= builtins.h mkinit mkinit.o mknodes mknodes.o \
|
||||
mksyntax mksyntax.o \
|
||||
nodes.h syntax.h token.h y.tab.h
|
||||
CLEANFILES+= ${GENSRCS}
|
||||
|
||||
beforedepend: token.h
|
||||
beforedepend: builtins.h nodes.h syntax.h token.h
|
||||
|
||||
builtins.h builtins.c: mkbuiltins builtins.def
|
||||
builtins.c builtins.h: mkbuiltins builtins.def
|
||||
cd ${.CURDIR}; sh mkbuiltins ${.OBJDIR}
|
||||
|
||||
init.c: mkinit ${SHSRCS}
|
||||
init.c: mkinit alias.c eval.c exec.c input.c jobs.c options.c parser.c \
|
||||
redir.c trap.c var.c
|
||||
./mkinit ${.ALLSRC:S/^mkinit$//}
|
||||
|
||||
# XXX this is just to stop the default .c rule being used, so that the
|
||||
@@ -49,12 +48,30 @@ mksyntax.o: mksyntax.c # XXX and many headers
|
||||
nodes.c nodes.h: mknodes nodetypes nodes.c.pat
|
||||
./mknodes ${.CURDIR}/nodetypes ${.CURDIR}/nodes.c.pat
|
||||
|
||||
parser.o: token.h
|
||||
|
||||
syntax.c syntax.h: mksyntax
|
||||
./mksyntax
|
||||
|
||||
token.h: mktokens
|
||||
sh ${.CURDIR}/mktokens
|
||||
|
||||
y.tab.h: arith.c
|
||||
|
||||
# Rules for object files that rely on generated headers.
|
||||
arith_lex.o: y.tab.h
|
||||
cd.o: nodes.h
|
||||
eval.o: builtins.h nodes.h syntax.h
|
||||
exec.o: builtins.h nodes.h syntax.h
|
||||
expand.o: nodes.h syntax.h
|
||||
input.o: syntax.h
|
||||
jobs.o: nodes.h syntax.h
|
||||
main.o: nodes.h
|
||||
mystring.o: syntax.h
|
||||
options.o: nodes.h
|
||||
output.o: syntax.h
|
||||
parser.o: nodes.h syntax.h token.h
|
||||
redir.o: nodes.h
|
||||
show.o: nodes.h
|
||||
trap.o: nodes.h syntax.h
|
||||
var.o: nodes.h syntax.h
|
||||
|
||||
.include <bsd.prog.mk>
|
||||
+5
-5
@@ -33,11 +33,11 @@
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: alias.c,v 1.3 1995/05/30 00:07:10 rgrimes Exp $
|
||||
* $Id: alias.c,v 1.4 1996/09/01 10:19:26 peter Exp $
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
static char sccsid[] = "@(#)alias.c 8.3 (Berkeley) 5/4/95";
|
||||
static char const sccsid[] = "@(#)alias.c 8.3 (Berkeley) 5/4/95";
|
||||
#endif /* not lint */
|
||||
|
||||
#include <stdlib.h>
|
||||
@@ -232,8 +232,8 @@ aliascmd(argc, argv)
|
||||
|
||||
int
|
||||
unaliascmd(argc, argv)
|
||||
int argc;
|
||||
char **argv;
|
||||
int argc __unused;
|
||||
char **argv __unused;
|
||||
{
|
||||
int i;
|
||||
|
||||
@@ -251,7 +251,7 @@ unaliascmd(argc, argv)
|
||||
|
||||
STATIC struct alias **
|
||||
hashalias(p)
|
||||
register char *p;
|
||||
char *p;
|
||||
{
|
||||
unsigned int hashval;
|
||||
|
||||
|
||||
+7
-6
@@ -1,4 +1,4 @@
|
||||
%token ARITH_NUM ARITH_LPAREN ARITH_RPAREN
|
||||
%token ARITH_NUM ARITH_LPAREN ARITH_RPAREN
|
||||
|
||||
%left ARITH_OR
|
||||
%left ARITH_AND
|
||||
@@ -39,12 +39,12 @@ expr: ARITH_LPAREN expr ARITH_RPAREN = { $$ = $2; }
|
||||
| expr ARITH_DIV expr = {
|
||||
if ($3 == 0)
|
||||
yyerror("division by zero");
|
||||
$$ = $1 / $3;
|
||||
$$ = $1 / $3;
|
||||
}
|
||||
| expr ARITH_REM expr = {
|
||||
if ($3 == 0)
|
||||
yyerror("division by zero");
|
||||
$$ = $1 % $3;
|
||||
$$ = $1 % $3;
|
||||
}
|
||||
| ARITH_NOT expr = { $$ = !($2); }
|
||||
| ARITH_BNOT expr = { $$ = ~($2); }
|
||||
@@ -88,11 +88,11 @@ expr: ARITH_LPAREN expr ARITH_RPAREN = { $$ = $2; }
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: arith.y,v 1.2 1994/09/24 02:57:21 davidg Exp $
|
||||
* $Id: arith.y,v 1.3 1996/09/01 10:19:38 peter Exp $
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
static char sccsid[] = "@(#)arith.y 8.3 (Berkeley) 5/4/95";
|
||||
static char const sccsid[] = "@(#)arith.y 8.3 (Berkeley) 5/4/95";
|
||||
#endif /* not lint */
|
||||
|
||||
#include "shell.h"
|
||||
@@ -101,10 +101,11 @@ static char sccsid[] = "@(#)arith.y 8.3 (Berkeley) 5/4/95";
|
||||
#include "memalloc.h"
|
||||
|
||||
char *arith_buf, *arith_startbuf;
|
||||
extern void arith_lex_reset();
|
||||
|
||||
int
|
||||
arith(s)
|
||||
char *s;
|
||||
char *s;
|
||||
{
|
||||
long result;
|
||||
|
||||
|
||||
+4
-3
@@ -34,11 +34,11 @@
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: arith_lex.l,v 1.4 1996/06/02 17:06:40 phk Exp $
|
||||
* $Id: arith_lex.l,v 1.5 1996/09/01 10:19:41 peter Exp $
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
static char sccsid[] = "@(#)arith_lex.l 8.3 (Berkeley) 5/4/95";
|
||||
static char const sccsid[] = "@(#)arith_lex.l 8.3 (Berkeley) 5/4/95";
|
||||
#endif /* not lint */
|
||||
|
||||
#include <unistd.h>
|
||||
@@ -50,6 +50,7 @@ extern char *arith_buf, *arith_startbuf;
|
||||
#undef YY_INPUT
|
||||
#define YY_INPUT(buf,result,max) \
|
||||
result = (*buf = *arith_buf++) ? 1 : YY_NULL;
|
||||
#define YY_NO_UNPUT
|
||||
%}
|
||||
|
||||
%%
|
||||
@@ -73,7 +74,7 @@ extern char *arith_buf, *arith_startbuf;
|
||||
"*" { return(ARITH_MUL); }
|
||||
"/" { return(ARITH_DIV); }
|
||||
"%" { return(ARITH_REM); }
|
||||
"+" { return(ARITH_ADD); }
|
||||
"+" { return(ARITH_ADD); }
|
||||
"-" { return(ARITH_SUB); }
|
||||
"~" { return(ARITH_BNOT); }
|
||||
"!" { return(ARITH_NOT); }
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)bltin.h 8.2 (Berkeley) 5/4/95
|
||||
* $Id: bltin.h,v 1.4 1995/12/14 23:19:36 bde Exp $
|
||||
* $Id: bltin.h,v 1.5 1996/09/01 10:22:13 peter Exp $
|
||||
*/
|
||||
|
||||
/*
|
||||
@@ -60,11 +60,12 @@
|
||||
#define fputs outstr
|
||||
#define fflush flushout
|
||||
#define INITARGS(argv)
|
||||
#define warnx(a, b, c) { \
|
||||
char buf[64]; \
|
||||
(void)snprintf(buf, sizeof(buf), a, b, c); \
|
||||
error(buf); \
|
||||
#define warnx(a, b, c) { \
|
||||
char buf[64]; \
|
||||
(void)snprintf(buf, sizeof(buf), a, b, c); \
|
||||
error("%s", buf); \
|
||||
}
|
||||
|
||||
#else
|
||||
#undef NULL
|
||||
#include <stdio.h>
|
||||
|
||||
+4
-7
@@ -34,16 +34,13 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)echo.c 8.2 (Berkeley) 5/4/95
|
||||
* $Id: echo.c,v 1.3 1995/08/23 05:31:06 pst Exp $
|
||||
* $Id: echo.c,v 1.4 1996/09/01 10:22:16 peter Exp $
|
||||
*/
|
||||
|
||||
/*
|
||||
* Echo command.
|
||||
*/
|
||||
|
||||
#ifdef main
|
||||
#undef main
|
||||
#endif
|
||||
#define main echocmd
|
||||
|
||||
#include "bltin.h"
|
||||
@@ -55,9 +52,9 @@ main(argc, argv)
|
||||
int argc;
|
||||
char **argv;
|
||||
{
|
||||
register char **ap;
|
||||
register char *p;
|
||||
register char c;
|
||||
char **ap;
|
||||
char *p;
|
||||
char c;
|
||||
int count;
|
||||
int nflag = 0;
|
||||
#ifndef eflag
|
||||
|
||||
+2
-1
@@ -35,7 +35,7 @@
|
||||
# SUCH DAMAGE.
|
||||
#
|
||||
# @(#)builtins.def 8.4 (Berkeley) 5/4/95
|
||||
# $Id: builtins.def,v 1.2 1996/09/01 10:19:44 peter Exp $
|
||||
# $Id: builtins.def,v 1.3 1996/10/01 04:59:13 peter Exp $
|
||||
|
||||
#
|
||||
# This file lists all the builtin commands. The first column is the name
|
||||
@@ -82,6 +82,7 @@ setvarcmd setvar
|
||||
shiftcmd shift
|
||||
trapcmd trap
|
||||
truecmd : true
|
||||
typecmd type
|
||||
umaskcmd umask
|
||||
unaliascmd unalias
|
||||
unsetcmd unset
|
||||
|
||||
+36
-187
@@ -33,16 +33,17 @@
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: cd.c,v 1.5 1995/11/14 01:04:52 peter Exp $
|
||||
* $Id: cd.c,v 1.6 1996/09/01 10:19:47 peter Exp $
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
static char sccsid[] = "@(#)cd.c 8.2 (Berkeley) 5/4/95";
|
||||
static char const sccsid[] = "@(#)cd.c 8.2 (Berkeley) 5/4/95";
|
||||
#endif /* not lint */
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
#include <errno.h>
|
||||
|
||||
@@ -58,29 +59,29 @@ static char sccsid[] = "@(#)cd.c 8.2 (Berkeley) 5/4/95";
|
||||
#include "output.h"
|
||||
#include "memalloc.h"
|
||||
#include "error.h"
|
||||
#include "exec.h"
|
||||
#include "redir.h"
|
||||
#include "mystring.h"
|
||||
#include "show.h"
|
||||
#include "cd.h"
|
||||
|
||||
STATIC int docd __P((char *, int));
|
||||
STATIC char *getcomponent __P((void));
|
||||
STATIC void updatepwd __P((char *));
|
||||
STATIC void getpwd __P((void));
|
||||
|
||||
char *curdir; /* current working directory */
|
||||
char *curdir = NULL; /* current working directory */
|
||||
char *prevdir; /* previous working directory */
|
||||
STATIC char *cdcomppath;
|
||||
|
||||
int
|
||||
cdcmd(argc, argv)
|
||||
int argc;
|
||||
char **argv;
|
||||
int argc __unused;
|
||||
char **argv __unused;
|
||||
{
|
||||
char *dest;
|
||||
char *path;
|
||||
char *p;
|
||||
struct stat statb;
|
||||
char *padvance();
|
||||
int print = 0;
|
||||
|
||||
nextopt(nullstr);
|
||||
@@ -119,135 +120,42 @@ cdcmd(argc, argv)
|
||||
|
||||
|
||||
/*
|
||||
* Actually do the chdir. If the name refers to symbolic links, we
|
||||
* compute the actual directory name before doing the cd. In an
|
||||
* interactive shell, print the directory name if "print" is nonzero
|
||||
* or if the name refers to a symbolic link. We also print the name
|
||||
* if "/u/logname" was expanded in it, since this is similar to a
|
||||
* symbolic link. (The check for this breaks if the user gives the
|
||||
* cd command some additional, unused arguments.)
|
||||
* Actually do the chdir. In an interactive shell, print the
|
||||
* directory name if "print" is nonzero.
|
||||
*/
|
||||
|
||||
#if SYMLINKS == 0
|
||||
STATIC int
|
||||
docd(dest, print)
|
||||
char *dest;
|
||||
int print;
|
||||
{
|
||||
{
|
||||
|
||||
TRACE(("docd(\"%s\", %d) called\n", dest, print));
|
||||
INTOFF;
|
||||
if (chdir(dest) < 0) {
|
||||
updatepwd(dest);
|
||||
if (chdir(stackblock()) < 0) {
|
||||
INTON;
|
||||
return -1;
|
||||
}
|
||||
updatepwd(dest);
|
||||
hashcd(); /* update command hash table */
|
||||
if (prevdir)
|
||||
ckfree(prevdir);
|
||||
prevdir = curdir;
|
||||
curdir = savestr(stackblock());
|
||||
INTON;
|
||||
if (print && iflag)
|
||||
out1fmt("%s\n", stackblock());
|
||||
return 0;
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
|
||||
|
||||
STATIC int
|
||||
docd(dest, print)
|
||||
char *dest;
|
||||
int print;
|
||||
{
|
||||
register char *p;
|
||||
register char *q;
|
||||
char *symlink;
|
||||
char *component;
|
||||
struct stat statb;
|
||||
int first;
|
||||
int i;
|
||||
|
||||
TRACE(("docd(\"%s\", %d) called\n", dest, print));
|
||||
|
||||
top:
|
||||
cdcomppath = dest;
|
||||
STARTSTACKSTR(p);
|
||||
if (*dest == '/') {
|
||||
STPUTC('/', p);
|
||||
cdcomppath++;
|
||||
}
|
||||
first = 1;
|
||||
while ((q = getcomponent()) != NULL) {
|
||||
if (q[0] == '\0' || (q[0] == '.' && q[1] == '\0'))
|
||||
continue;
|
||||
if (! first)
|
||||
STPUTC('/', p);
|
||||
first = 0;
|
||||
component = q;
|
||||
while (*q)
|
||||
STPUTC(*q++, p);
|
||||
if (equal(component, ".."))
|
||||
continue;
|
||||
STACKSTRNUL(p);
|
||||
if (lstat(stackblock(), &statb) < 0)
|
||||
error("lstat %s failed", stackblock());
|
||||
if (!S_ISLNK(statb.st_mode))
|
||||
continue;
|
||||
|
||||
/* Hit a symbolic link. We have to start all over again. */
|
||||
print = 1;
|
||||
STPUTC('\0', p);
|
||||
symlink = grabstackstr(p);
|
||||
i = (int)statb.st_size + 2; /* 2 for '/' and '\0' */
|
||||
if (cdcomppath != NULL)
|
||||
i += strlen(cdcomppath);
|
||||
p = stalloc(i);
|
||||
if (readlink(symlink, p, (int)statb.st_size) < 0) {
|
||||
error("readlink %s failed", stackblock());
|
||||
}
|
||||
if (cdcomppath != NULL) {
|
||||
p[(int)statb.st_size] = '/';
|
||||
scopy(cdcomppath, p + (int)statb.st_size + 1);
|
||||
} else {
|
||||
p[(int)statb.st_size] = '\0';
|
||||
}
|
||||
if (p[0] != '/') { /* relative path name */
|
||||
char *r;
|
||||
q = r = symlink;
|
||||
while (*q) {
|
||||
if (*q++ == '/')
|
||||
r = q;
|
||||
}
|
||||
*r = '\0';
|
||||
dest = stalloc(strlen(symlink) + strlen(p) + 1);
|
||||
scopy(symlink, dest);
|
||||
strcat(dest, p);
|
||||
} else {
|
||||
dest = p;
|
||||
}
|
||||
goto top;
|
||||
}
|
||||
STPUTC('\0', p);
|
||||
p = grabstackstr(p);
|
||||
INTOFF;
|
||||
if (chdir(*p ? p : ".") < 0) {
|
||||
INTON;
|
||||
return -1;
|
||||
}
|
||||
updatepwd(p);
|
||||
INTON;
|
||||
if (print && iflag)
|
||||
out1fmt("%s\n", p);
|
||||
return 0;
|
||||
}
|
||||
#endif /* SYMLINKS */
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* Get the next component of the path name pointed to by cdcomppath.
|
||||
* This routine overwrites the string pointed to by cdcomppath.
|
||||
*/
|
||||
|
||||
STATIC char *
|
||||
getcomponent() {
|
||||
register char *p;
|
||||
getcomponent()
|
||||
{
|
||||
char *p;
|
||||
char *start;
|
||||
|
||||
if ((p = cdcomppath) == NULL)
|
||||
@@ -265,23 +173,17 @@ getcomponent() {
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* Update curdir (the name of the current directory) in response to a
|
||||
* cd command. We also call hashcd to let the routines in exec.c know
|
||||
* that the current directory has changed.
|
||||
* Determine the new working directory, but don't actually enforce
|
||||
* any changes.
|
||||
*/
|
||||
|
||||
void hashcd();
|
||||
|
||||
STATIC void
|
||||
updatepwd(dir)
|
||||
char *dir;
|
||||
{
|
||||
{
|
||||
char *new;
|
||||
char *p;
|
||||
|
||||
hashcd(); /* update command hash table */
|
||||
cdcomppath = stalloc(strlen(dir) + 1);
|
||||
scopy(dir, cdcomppath);
|
||||
STARTSTACKSTR(new);
|
||||
@@ -306,83 +208,30 @@ updatepwd(dir)
|
||||
if (new == stackblock())
|
||||
STPUTC('/', new);
|
||||
STACKSTRNUL(new);
|
||||
INTOFF;
|
||||
if (prevdir)
|
||||
ckfree(prevdir);
|
||||
prevdir = curdir;
|
||||
curdir = savestr(stackblock());
|
||||
INTON;
|
||||
}
|
||||
|
||||
|
||||
|
||||
int
|
||||
pwdcmd(argc, argv)
|
||||
int argc;
|
||||
char **argv;
|
||||
int argc __unused;
|
||||
char **argv __unused;
|
||||
{
|
||||
getpwd();
|
||||
if (!getpwd())
|
||||
error("getcwd() failed: %s", strerror(errno));
|
||||
out1str(curdir);
|
||||
out1c('\n');
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* Run /bin/pwd to find out what the current directory is. We suppress
|
||||
* interrupts throughout most of this, but the user can still break out
|
||||
* of it by killing the pwd program. If we already know the current
|
||||
* Find out what the current directory is. If we already know the current
|
||||
* directory, this routine returns immediately.
|
||||
*/
|
||||
|
||||
#define MAXPWD 256
|
||||
|
||||
STATIC void
|
||||
getpwd() {
|
||||
char buf[MAXPWD];
|
||||
char *p;
|
||||
int i;
|
||||
int status;
|
||||
struct job *jp;
|
||||
int pip[2];
|
||||
char *pwd_bin = "/bin/pwd";
|
||||
|
||||
char *
|
||||
getpwd()
|
||||
{
|
||||
if (curdir)
|
||||
return;
|
||||
INTOFF;
|
||||
if (pipe(pip) < 0)
|
||||
error("Pipe call failed");
|
||||
/* make a fall-back guess, otherwise we're simply screwed */
|
||||
if (access(pwd_bin, X_OK) == -1)
|
||||
pwd_bin = "/stand/pwd";
|
||||
jp = makejob((union node *)NULL, 1);
|
||||
if (forkshell(jp, (union node *)NULL, FORK_NOJOB) == 0) {
|
||||
close(pip[0]);
|
||||
if (pip[1] != 1) {
|
||||
close(1);
|
||||
copyfd(pip[1], 1);
|
||||
close(pip[1]);
|
||||
}
|
||||
execl(pwd_bin, "pwd", (char *)0);
|
||||
error("Cannot exec %s", pwd_bin);
|
||||
}
|
||||
close(pip[1]);
|
||||
pip[1] = -1;
|
||||
p = buf;
|
||||
while ((i = read(pip[0], p, buf + MAXPWD - p)) > 0
|
||||
|| (i == -1 && errno == EINTR)) {
|
||||
if (i > 0)
|
||||
p += i;
|
||||
}
|
||||
close(pip[0]);
|
||||
pip[0] = -1;
|
||||
status = waitforjob(jp);
|
||||
if (status != 0)
|
||||
error((char *)0);
|
||||
if (i < 0 || p == buf || p[-1] != '\n')
|
||||
error("pwd command failed");
|
||||
p[-1] = '\0';
|
||||
curdir = savestr(buf);
|
||||
INTON;
|
||||
return (curdir);
|
||||
return ((curdir = getcwd(NULL, 0)));
|
||||
}
|
||||
+62
-25
@@ -33,11 +33,11 @@
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: error.c,v 1.4 1996/09/01 10:19:53 peter Exp $
|
||||
* $Id: error.c,v 1.5 1996/09/03 14:15:46 peter Exp $
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
static char sccsid[] = "@(#)error.c 8.2 (Berkeley) 5/4/95";
|
||||
static char const sccsid[] = "@(#)error.c 8.2 (Berkeley) 5/4/95";
|
||||
#endif /* not lint */
|
||||
|
||||
/*
|
||||
@@ -66,6 +66,8 @@ volatile int intpending;
|
||||
char *commandname;
|
||||
|
||||
|
||||
static void exverror __P((int, char *, va_list));
|
||||
|
||||
/*
|
||||
* Called to raise an exception. Since C doesn't include exceptions, we
|
||||
* just do a longjmp to the exception handler. The type of exception is
|
||||
@@ -73,7 +75,7 @@ char *commandname;
|
||||
*/
|
||||
|
||||
void
|
||||
exraise(e)
|
||||
exraise(e)
|
||||
int e;
|
||||
{
|
||||
if (handler == NULL)
|
||||
@@ -104,6 +106,7 @@ onint() {
|
||||
intpending = 0;
|
||||
sigemptyset(&sigset);
|
||||
sigprocmask(SIG_SETMASK, &sigset, NULL);
|
||||
out2str("\n");
|
||||
if (rootshell && iflag)
|
||||
exraise(EXINT);
|
||||
else
|
||||
@@ -111,14 +114,38 @@ onint() {
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* Error is called to raise the error exception. If the first argument
|
||||
* Exverror is called to raise the error exception. If the first argument
|
||||
* is not NULL then error prints an error message using printf style
|
||||
* formatting. It then raises the error exception.
|
||||
*/
|
||||
static void
|
||||
exverror(cond, msg, ap)
|
||||
int cond;
|
||||
char *msg;
|
||||
va_list ap;
|
||||
{
|
||||
CLEAR_PENDING_INT;
|
||||
INTOFF;
|
||||
|
||||
#if __STDC__
|
||||
#ifdef DEBUG
|
||||
if (msg)
|
||||
TRACE(("exverror(%d, \"%s\") pid=%d\n", cond, msg, getpid()));
|
||||
else
|
||||
TRACE(("exverror(%d, NULL) pid=%d\n", cond, getpid()));
|
||||
#endif
|
||||
if (msg) {
|
||||
if (commandname)
|
||||
outfmt(&errout, "%s: ", commandname);
|
||||
doformat(&errout, msg, ap);
|
||||
out2c('\n');
|
||||
}
|
||||
flushall();
|
||||
exraise(cond);
|
||||
}
|
||||
|
||||
|
||||
#ifdef __STDC__
|
||||
void
|
||||
error(char *msg, ...)
|
||||
#else
|
||||
@@ -127,34 +154,44 @@ error(va_alist)
|
||||
va_dcl
|
||||
#endif
|
||||
{
|
||||
#if !__STDC__
|
||||
#ifndef __STDC__
|
||||
char *msg;
|
||||
#endif
|
||||
va_list ap;
|
||||
CLEAR_PENDING_INT;
|
||||
INTOFF;
|
||||
|
||||
#if __STDC__
|
||||
#ifdef __STDC__
|
||||
va_start(ap, msg);
|
||||
#else
|
||||
va_start(ap);
|
||||
msg = va_arg(ap, char *);
|
||||
#endif
|
||||
#ifdef DEBUG
|
||||
if (msg)
|
||||
TRACE(("error(\"%s\") pid=%d\n", msg, getpid()));
|
||||
else
|
||||
TRACE(("error(NULL) pid=%d\n", getpid()));
|
||||
exverror(EXERROR, msg, ap);
|
||||
va_end(ap);
|
||||
}
|
||||
|
||||
|
||||
#ifdef __STDC__
|
||||
void
|
||||
exerror(int cond, char *msg, ...)
|
||||
#else
|
||||
void
|
||||
exerror(va_alist)
|
||||
va_dcl
|
||||
#endif
|
||||
if (msg) {
|
||||
if (commandname)
|
||||
outfmt(&errout, "%s: ", commandname);
|
||||
doformat(&errout, msg, ap);
|
||||
out2c('\n');
|
||||
}
|
||||
{
|
||||
#ifndef __STDC__
|
||||
int cond;
|
||||
char *msg;
|
||||
#endif
|
||||
va_list ap;
|
||||
#ifdef __STDC__
|
||||
va_start(ap, msg);
|
||||
#else
|
||||
va_start(ap);
|
||||
cond = va_arg(ap, int);
|
||||
msg = va_arg(ap, char *);
|
||||
#endif
|
||||
exverror(cond, msg, ap);
|
||||
va_end(ap);
|
||||
flushall();
|
||||
exraise(EXERROR);
|
||||
}
|
||||
|
||||
|
||||
@@ -234,7 +271,7 @@ STATIC const struct errname errormsg[] = {
|
||||
*/
|
||||
|
||||
char *
|
||||
errmsg(e, action)
|
||||
errmsg(e, action)
|
||||
int e;
|
||||
int action;
|
||||
{
|
||||
|
||||
+3
-1
@@ -34,7 +34,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)error.h 8.2 (Berkeley) 5/4/95
|
||||
* $Id: error.h,v 1.3 1996/09/01 10:19:55 peter Exp $
|
||||
* $Id: error.h,v 1.4 1996/09/03 14:15:48 peter Exp $
|
||||
*/
|
||||
|
||||
/*
|
||||
@@ -69,6 +69,7 @@ extern int exception;
|
||||
#define EXINT 0 /* SIGINT received */
|
||||
#define EXERROR 1 /* a generic error */
|
||||
#define EXSHELLPROC 2 /* execute a shell procedure */
|
||||
#define EXEXEC 3 /* command execution failed */
|
||||
|
||||
|
||||
/*
|
||||
@@ -91,6 +92,7 @@ extern char *commandname; /* name of command--printed on error */
|
||||
void exraise __P((int));
|
||||
void onint __P((void));
|
||||
void error __P((char *, ...));
|
||||
void exerror __P((int, char *, ...));
|
||||
char *errmsg __P((int, int));
|
||||
|
||||
|
||||
|
||||
+44
-46
@@ -33,11 +33,11 @@
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: eval.c,v 1.7.2.1 1996/11/12 19:23:44 jkh Exp $
|
||||
* $Id: eval.c,v 1.7.2.2 1997/05/13 19:18:56 steve Exp $
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
static char sccsid[] = "@(#)eval.c 8.9 (Berkeley) 6/8/95";
|
||||
static char const sccsid[] = "@(#)eval.c 8.9 (Berkeley) 6/8/95";
|
||||
#endif /* not lint */
|
||||
|
||||
#include <signal.h>
|
||||
@@ -76,12 +76,6 @@ static char sccsid[] = "@(#)eval.c 8.9 (Berkeley) 6/8/95";
|
||||
#define EV_TESTED 02 /* exit status is checked; ignore -e flag */
|
||||
#define EV_BACKCMD 04 /* command executing within back quotes */
|
||||
|
||||
|
||||
/* reasons for skipping commands (see comment on breakcmd routine) */
|
||||
#define SKIPBREAK 1
|
||||
#define SKIPCONT 2
|
||||
#define SKIPFUNC 3
|
||||
|
||||
MKINIT int evalskip; /* set if we are skipping commands */
|
||||
STATIC int skipcount; /* number of levels to skip */
|
||||
MKINIT int loopnest; /* current loop nesting level */
|
||||
@@ -129,9 +123,9 @@ SHELLPROC {
|
||||
*/
|
||||
|
||||
int
|
||||
evalcmd(argc, argv)
|
||||
evalcmd(argc, argv)
|
||||
int argc;
|
||||
char **argv;
|
||||
char **argv;
|
||||
{
|
||||
char *p;
|
||||
char *concat;
|
||||
@@ -234,17 +228,15 @@ evaltree(n, flags)
|
||||
evalsubshell(n, flags);
|
||||
break;
|
||||
case NIF: {
|
||||
int status;
|
||||
|
||||
evaltree(n->nif.test, EV_TESTED);
|
||||
status = exitstatus;
|
||||
exitstatus = 0;
|
||||
if (evalskip)
|
||||
goto out;
|
||||
if (status == 0)
|
||||
if (exitstatus == 0)
|
||||
evaltree(n->nif.ifpart, flags);
|
||||
else if (n->nif.elsepart)
|
||||
evaltree(n->nif.elsepart, flags);
|
||||
else
|
||||
exitstatus = 0;
|
||||
break;
|
||||
}
|
||||
case NWHILE:
|
||||
@@ -430,7 +422,7 @@ STATIC void
|
||||
expredir(n)
|
||||
union node *n;
|
||||
{
|
||||
register union node *redir;
|
||||
union node *redir;
|
||||
|
||||
for (redir = n ; redir ; redir = redir->nfile.next) {
|
||||
struct arglist fn;
|
||||
@@ -688,7 +680,7 @@ evalcommand(cmd, flags, backcmd)
|
||||
|
||||
find_command(argv[0], &cmdentry, 1, path);
|
||||
if (cmdentry.cmdtype == CMDUNKNOWN) { /* command not found */
|
||||
exitstatus = 1;
|
||||
exitstatus = 127;
|
||||
flushout(&errout);
|
||||
return;
|
||||
}
|
||||
@@ -700,7 +692,7 @@ evalcommand(cmd, flags, backcmd)
|
||||
break;
|
||||
if ((cmdentry.u.index = find_builtin(*argv)) < 0) {
|
||||
outfmt(&errout, "%s: not found\n", *argv);
|
||||
exitstatus = 1;
|
||||
exitstatus = 127;
|
||||
flushout(&errout);
|
||||
return;
|
||||
}
|
||||
@@ -741,10 +733,13 @@ evalcommand(cmd, flags, backcmd)
|
||||
/* This is the child process if a fork occurred. */
|
||||
/* Execute the command. */
|
||||
if (cmdentry.cmdtype == CMDFUNCTION) {
|
||||
#ifdef DEBUG
|
||||
trputs("Shell function: "); trargs(argv);
|
||||
#endif
|
||||
redirect(cmd->ncmd.redirect, REDIR_PUSH);
|
||||
saveparam = shellparam;
|
||||
shellparam.malloc = 0;
|
||||
shellparam.reset = 1;
|
||||
shellparam.nparam = argc - 1;
|
||||
shellparam.p = argv + 1;
|
||||
shellparam.optnext = NULL;
|
||||
@@ -786,7 +781,9 @@ evalcommand(cmd, flags, backcmd)
|
||||
if (flags & EV_EXIT)
|
||||
exitshell(exitstatus);
|
||||
} else if (cmdentry.cmdtype == CMDBUILTIN) {
|
||||
#ifdef DEBUG
|
||||
trputs("builtin command: "); trargs(argv);
|
||||
#endif
|
||||
mode = (cmdentry.u.index == EXECCMD)? 0 : REDIR_PUSH;
|
||||
if (flags == EV_BACKCMD) {
|
||||
memout.nleft = 0;
|
||||
@@ -822,13 +819,14 @@ cmddone:
|
||||
}
|
||||
handler = savehandler;
|
||||
if (e != -1) {
|
||||
if (e != EXERROR || cmdentry.u.index == BLTINCMD
|
||||
|| cmdentry.u.index == DOTCMD
|
||||
|| cmdentry.u.index == EVALCMD
|
||||
if ((e != EXERROR && e != EXEXEC)
|
||||
|| cmdentry.u.index == BLTINCMD
|
||||
|| cmdentry.u.index == DOTCMD
|
||||
|| cmdentry.u.index == EVALCMD
|
||||
#ifndef NO_HISTORY
|
||||
|| cmdentry.u.index == HISTCMD
|
||||
|| cmdentry.u.index == HISTCMD
|
||||
#endif
|
||||
|| cmdentry.u.index == EXECCMD)
|
||||
|| cmdentry.u.index == EXECCMD)
|
||||
exraise(e);
|
||||
FORCEINTON;
|
||||
}
|
||||
@@ -840,7 +838,9 @@ cmddone:
|
||||
memout.buf = NULL;
|
||||
}
|
||||
} else {
|
||||
#ifdef DEBUG
|
||||
trputs("normal command: "); trargs(argv);
|
||||
#endif
|
||||
clearredir();
|
||||
redirect(cmd->ncmd.redirect, 0);
|
||||
for (sp = varlist.list ; sp ; sp = sp->next)
|
||||
@@ -903,13 +903,13 @@ prehash(n)
|
||||
|
||||
int
|
||||
bltincmd(argc, argv)
|
||||
int argc;
|
||||
char **argv;
|
||||
int argc __unused;
|
||||
char **argv __unused;
|
||||
{
|
||||
listsetvar(cmdenviron);
|
||||
/*
|
||||
/*
|
||||
* Preserve exitstatus of a previous possible redirection
|
||||
* as POSIX mandates
|
||||
* as POSIX mandates
|
||||
*/
|
||||
return exitstatus;
|
||||
}
|
||||
@@ -929,13 +929,10 @@ bltincmd(argc, argv)
|
||||
int
|
||||
breakcmd(argc, argv)
|
||||
int argc;
|
||||
char **argv;
|
||||
char **argv;
|
||||
{
|
||||
int n;
|
||||
int n = argc > 1 ? number(argv[1]) : 1;
|
||||
|
||||
n = 1;
|
||||
if (argc > 1)
|
||||
n = number(argv[1]);
|
||||
if (n > loopnest)
|
||||
n = loopnest;
|
||||
if (n > 0) {
|
||||
@@ -951,45 +948,46 @@ breakcmd(argc, argv)
|
||||
*/
|
||||
|
||||
int
|
||||
returncmd(argc, argv)
|
||||
returncmd(argc, argv)
|
||||
int argc;
|
||||
char **argv;
|
||||
char **argv;
|
||||
{
|
||||
int ret;
|
||||
int ret = argc > 1 ? number(argv[1]) : oexitstatus;
|
||||
|
||||
ret = oexitstatus;
|
||||
if (argc > 1)
|
||||
ret = number(argv[1]);
|
||||
if (funcnest) {
|
||||
evalskip = SKIPFUNC;
|
||||
skipcount = 1;
|
||||
} else {
|
||||
/* skip the rest of the file */
|
||||
evalskip = SKIPFILE;
|
||||
skipcount = 1;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
falsecmd(argc, argv)
|
||||
int argc;
|
||||
char **argv;
|
||||
falsecmd(argc, argv)
|
||||
int argc __unused;
|
||||
char **argv __unused;
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
truecmd(argc, argv)
|
||||
int argc;
|
||||
char **argv;
|
||||
truecmd(argc, argv)
|
||||
int argc __unused;
|
||||
char **argv __unused;
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
execcmd(argc, argv)
|
||||
execcmd(argc, argv)
|
||||
int argc;
|
||||
char **argv;
|
||||
char **argv;
|
||||
{
|
||||
if (argc > 1) {
|
||||
struct strlist *sp;
|
||||
|
||||
+8
-1
@@ -34,7 +34,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)eval.h 8.2 (Berkeley) 5/4/95
|
||||
* $Id: eval.h,v 1.2 1994/09/24 02:57:31 davidg Exp $
|
||||
* $Id: eval.h,v 1.3 1996/09/01 10:19:59 peter Exp $
|
||||
*/
|
||||
|
||||
extern char *commandname; /* currently executing command */
|
||||
@@ -64,3 +64,10 @@ int execcmd __P((int, char **));
|
||||
/* in_function returns nonzero if we are currently evaluating a function */
|
||||
#define in_function() funcnest
|
||||
extern int funcnest;
|
||||
extern int evalskip;
|
||||
|
||||
/* reasons for skipping commands (see comment on breakcmd routine) */
|
||||
#define SKIPBREAK 1
|
||||
#define SKIPCONT 2
|
||||
#define SKIPFUNC 3
|
||||
#define SKIPFILE 4
|
||||
+101
-10
@@ -33,11 +33,11 @@
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: exec.c,v 1.5 1996/09/01 10:20:02 peter Exp $
|
||||
* $Id: exec.c,v 1.6 1996/09/03 14:15:49 peter Exp $
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
static char sccsid[] = "@(#)exec.c 8.4 (Berkeley) 6/8/95";
|
||||
static char const sccsid[] = "@(#)exec.c 8.4 (Berkeley) 6/8/95";
|
||||
#endif /* not lint */
|
||||
|
||||
#include <sys/types.h>
|
||||
@@ -75,6 +75,7 @@ static char sccsid[] = "@(#)exec.c 8.4 (Berkeley) 6/8/95";
|
||||
#include "mystring.h"
|
||||
#include "show.h"
|
||||
#include "jobs.h"
|
||||
#include "alias.h"
|
||||
|
||||
|
||||
#define CMDTABLESIZE 31 /* should be prime */
|
||||
@@ -93,10 +94,13 @@ struct tblentry {
|
||||
|
||||
STATIC struct tblentry *cmdtable[CMDTABLESIZE];
|
||||
STATIC int builtinloc = -1; /* index in path of %builtin, or -1 */
|
||||
int exerrno = 0; /* Last exec error */
|
||||
|
||||
|
||||
STATIC void tryexec __P((char *, char **, char **));
|
||||
#ifndef BSD
|
||||
STATIC void execinterp __P((char **, char **));
|
||||
#endif
|
||||
STATIC void printentry __P((struct tblentry *, int));
|
||||
STATIC void clearcmdentry __P((int));
|
||||
STATIC struct tblentry *cmdlookup __P((char *, int));
|
||||
@@ -132,7 +136,20 @@ shellexec(argv, envp, path, index)
|
||||
stunalloc(cmdname);
|
||||
}
|
||||
}
|
||||
error("%s: %s", argv[0], errmsg(e, E_EXEC));
|
||||
|
||||
/* Map to POSIX errors */
|
||||
switch (e) {
|
||||
case EACCES:
|
||||
exerrno = 126;
|
||||
break;
|
||||
case ENOENT:
|
||||
exerrno = 127;
|
||||
break;
|
||||
default:
|
||||
exerrno = 2;
|
||||
break;
|
||||
}
|
||||
exerror(EXEXEC, "%s: %s", argv[0], errmsg(e, E_EXEC));
|
||||
}
|
||||
|
||||
|
||||
@@ -271,7 +288,7 @@ padvance(path, name)
|
||||
char **path;
|
||||
char *name;
|
||||
{
|
||||
register char *p, *q;
|
||||
char *p, *q;
|
||||
char *start;
|
||||
int len;
|
||||
|
||||
@@ -308,8 +325,8 @@ padvance(path, name)
|
||||
|
||||
int
|
||||
hashcmd(argc, argv)
|
||||
int argc;
|
||||
char **argv;
|
||||
int argc __unused;
|
||||
char **argv __unused;
|
||||
{
|
||||
struct tblentry **pp;
|
||||
struct tblentry *cmdp;
|
||||
@@ -538,7 +555,7 @@ int
|
||||
find_builtin(name)
|
||||
char *name;
|
||||
{
|
||||
register const struct builtincmd *bp;
|
||||
const struct builtincmd *bp;
|
||||
|
||||
for (bp = builtincmd ; bp->name ; bp++) {
|
||||
if (*bp->name == *name && equal(bp->name, name))
|
||||
@@ -578,9 +595,9 @@ hashcd() {
|
||||
|
||||
void
|
||||
changepath(newval)
|
||||
char *newval;
|
||||
const char *newval;
|
||||
{
|
||||
char *old, *new;
|
||||
const char *old, *new;
|
||||
int index;
|
||||
int firstchange;
|
||||
int bltin;
|
||||
@@ -701,7 +718,7 @@ cmdlookup(name, add)
|
||||
int add;
|
||||
{
|
||||
int hashval;
|
||||
register char *p;
|
||||
char *p;
|
||||
struct tblentry *cmdp;
|
||||
struct tblentry **pp;
|
||||
|
||||
@@ -825,3 +842,77 @@ unsetfunc(name)
|
||||
}
|
||||
return (1);
|
||||
}
|
||||
|
||||
/*
|
||||
* Locate and print what a word is...
|
||||
*/
|
||||
|
||||
int
|
||||
typecmd(argc, argv)
|
||||
int argc;
|
||||
char **argv;
|
||||
{
|
||||
struct cmdentry entry;
|
||||
struct tblentry *cmdp;
|
||||
char **pp;
|
||||
struct alias *ap;
|
||||
int i;
|
||||
int error = 0;
|
||||
extern char *const parsekwd[];
|
||||
|
||||
for (i = 1; i < argc; i++) {
|
||||
out1str(argv[i]);
|
||||
/* First look at the keywords */
|
||||
for (pp = (char **)parsekwd; *pp; pp++)
|
||||
if (**pp == *argv[i] && equal(*pp, argv[i]))
|
||||
break;
|
||||
|
||||
if (*pp) {
|
||||
out1str(" is a shell keyword\n");
|
||||
continue;
|
||||
}
|
||||
|
||||
/* Then look at the aliases */
|
||||
if ((ap = lookupalias(argv[i], 1)) != NULL) {
|
||||
out1fmt(" is an alias for %s\n", ap->val);
|
||||
continue;
|
||||
}
|
||||
|
||||
/* Then check if it is a tracked alias */
|
||||
if ((cmdp = cmdlookup(argv[i], 0)) != NULL) {
|
||||
entry.cmdtype = cmdp->cmdtype;
|
||||
entry.u = cmdp->param;
|
||||
}
|
||||
else {
|
||||
/* Finally use brute force */
|
||||
find_command(argv[i], &entry, 0, pathval());
|
||||
}
|
||||
|
||||
switch (entry.cmdtype) {
|
||||
case CMDNORMAL: {
|
||||
int j = entry.u.index;
|
||||
char *path = pathval(), *name;
|
||||
do {
|
||||
name = padvance(&path, argv[i]);
|
||||
stunalloc(name);
|
||||
} while (--j >= 0);
|
||||
out1fmt(" is%s %s\n",
|
||||
cmdp ? " a tracked alias for" : "", name);
|
||||
break;
|
||||
}
|
||||
case CMDFUNCTION:
|
||||
out1str(" is a shell function\n");
|
||||
break;
|
||||
|
||||
case CMDBUILTIN:
|
||||
out1str(" is a shell builtin\n");
|
||||
break;
|
||||
|
||||
default:
|
||||
out1str(" not found\n");
|
||||
error |= 127;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return error;
|
||||
}
|
||||
+4
-2
@@ -34,7 +34,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)exec.h 8.3 (Berkeley) 6/8/95
|
||||
* $Id: exec.h,v 1.2 1994/09/24 02:57:33 davidg Exp $
|
||||
* $Id: exec.h,v 1.3 1996/09/01 10:20:05 peter Exp $
|
||||
*/
|
||||
|
||||
/* values of cmdtype */
|
||||
@@ -54,6 +54,7 @@ struct cmdentry {
|
||||
|
||||
|
||||
extern char *pathopt; /* set by padvance */
|
||||
extern int exerrno; /* last exec error */
|
||||
|
||||
void shellexec __P((char **, char **, char *, int));
|
||||
char *padvance __P((char **, char *));
|
||||
@@ -61,9 +62,10 @@ int hashcmd __P((int, char **));
|
||||
void find_command __P((char *, struct cmdentry *, int, char *));
|
||||
int find_builtin __P((char *));
|
||||
void hashcd __P((void));
|
||||
void changepath __P((char *));
|
||||
void changepath __P((const char *));
|
||||
void deletefuncs __P((void));
|
||||
void getcmdentry __P((char *, struct cmdentry *));
|
||||
void addcmdentry __P((char *, struct cmdentry *));
|
||||
void defun __P((char *, union node *));
|
||||
int unsetfunc __P((char *));
|
||||
int typecmd __P((int, char **));
|
||||
+86
-48
@@ -33,11 +33,11 @@
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $Id: expand.c,v 1.11 1996/10/31 07:15:54 ache Exp $
|
||||
* $Id: expand.c,v 1.11.2.4 1997/06/19 17:57:30 jkh Exp $
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
static char sccsid[] = "@(#)expand.c 8.5 (Berkeley) 5/15/95";
|
||||
static char const sccsid[] = "@(#)expand.c 8.5 (Berkeley) 5/15/95";
|
||||
#endif /* not lint */
|
||||
|
||||
#include <sys/types.h>
|
||||
@@ -95,9 +95,9 @@ struct arglist exparg; /* holds expanded arg list */
|
||||
STATIC void argstr __P((char *, int));
|
||||
STATIC char *exptilde __P((char *, int));
|
||||
STATIC void expbackq __P((union node *, int, int));
|
||||
STATIC int subevalvar __P((char *, char *, int, int, int));
|
||||
STATIC int subevalvar __P((char *, char *, int, int, int, int));
|
||||
STATIC char *evalvar __P((char *, int));
|
||||
STATIC int varisset __P((char *));
|
||||
STATIC int varisset __P((char *, int));
|
||||
STATIC void varvalue __P((char *, int, int));
|
||||
STATIC void recordregion __P((int, int, int));
|
||||
STATIC void ifsbreakup __P((char *, struct arglist *));
|
||||
@@ -210,10 +210,10 @@ expandarg(arg, arglist, flag)
|
||||
|
||||
STATIC void
|
||||
argstr(p, flag)
|
||||
register char *p;
|
||||
char *p;
|
||||
int flag;
|
||||
{
|
||||
register char c;
|
||||
char c;
|
||||
int quotes = flag & (EXP_FULL | EXP_CASE); /* do CTLESC */
|
||||
int firsteq = 1;
|
||||
|
||||
@@ -325,6 +325,16 @@ expari(flag)
|
||||
int result;
|
||||
int quotes = flag & (EXP_FULL | EXP_CASE);
|
||||
|
||||
while (ifsfirst.next != NULL) {
|
||||
struct ifsregion *ifsp;
|
||||
INTOFF;
|
||||
ifsp = ifsfirst.next->next;
|
||||
ckfree(ifsfirst.next);
|
||||
ifsfirst.next = ifsp;
|
||||
INTON;
|
||||
}
|
||||
ifslastp = NULL;
|
||||
|
||||
/*
|
||||
* This routine is slightly over-compilcated for
|
||||
* efficiency. First we make sure there is
|
||||
@@ -442,30 +452,35 @@ expbackq(cmd, quoted, flag)
|
||||
|
||||
|
||||
STATIC int
|
||||
subevalvar(p, str, subtype, startloc, varflags)
|
||||
subevalvar(p, str, strloc, subtype, startloc, varflags)
|
||||
char *p;
|
||||
char *str;
|
||||
int strloc;
|
||||
int subtype;
|
||||
int startloc;
|
||||
int varflags;
|
||||
{
|
||||
|
||||
char *startp;
|
||||
char *loc = NULL;
|
||||
int c = 0;
|
||||
int saveherefd = herefd;
|
||||
struct nodelist *saveargbackq = argbackq;
|
||||
int amount;
|
||||
|
||||
herefd = -1;
|
||||
argstr(p, 0);
|
||||
STACKSTRNUL(expdest);
|
||||
herefd = saveherefd;
|
||||
argbackq = saveargbackq;
|
||||
startp = stackblock() + startloc;
|
||||
if (str == NULL)
|
||||
str = stackblock() + strloc;
|
||||
|
||||
switch (subtype) {
|
||||
case VSASSIGN:
|
||||
setvar(str, startp, 0);
|
||||
STADJUST(startp - expdest, expdest);
|
||||
amount = startp - expdest;
|
||||
STADJUST(amount, expdest);
|
||||
varflags &= ~VSNUL;
|
||||
if (c != 0)
|
||||
*loc = c;
|
||||
@@ -482,7 +497,7 @@ subevalvar(p, str, subtype, startloc, varflags)
|
||||
return 0;
|
||||
|
||||
case VSTRIMLEFT:
|
||||
for (loc = startp; loc < str - 1; loc++) {
|
||||
for (loc = startp; loc < str; loc++) {
|
||||
c = *loc;
|
||||
*loc = '\0';
|
||||
if (patmatch(str, startp)) {
|
||||
@@ -508,7 +523,8 @@ subevalvar(p, str, subtype, startloc, varflags)
|
||||
case VSTRIMRIGHT:
|
||||
for (loc = str - 1; loc >= startp; loc--) {
|
||||
if (patmatch(str, loc)) {
|
||||
expdest = loc;
|
||||
amount = loc - expdest;
|
||||
STADJUST(amount, expdest);
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
@@ -517,7 +533,8 @@ subevalvar(p, str, subtype, startloc, varflags)
|
||||
case VSTRIMRIGHTMAX:
|
||||
for (loc = startp; loc < str - 1; loc++) {
|
||||
if (patmatch(str, loc)) {
|
||||
expdest = loc;
|
||||
amount = loc - expdest;
|
||||
STADJUST(amount, expdest);
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
@@ -529,7 +546,8 @@ subevalvar(p, str, subtype, startloc, varflags)
|
||||
}
|
||||
|
||||
recordleft:
|
||||
expdest = (str - 1) - (loc - startp);
|
||||
amount = ((str - 1) - (loc - startp)) - expdest;
|
||||
STADJUST(amount, expdest);
|
||||
while (loc != str - 1)
|
||||
*startp++ = *loc++;
|
||||
return 1;
|
||||
@@ -568,7 +586,7 @@ evalvar(p, flag)
|
||||
p = strchr(p, '=') + 1;
|
||||
again: /* jump here after setting a variable with ${var=text} */
|
||||
if (special) {
|
||||
set = varisset(var);
|
||||
set = varisset(var, varflags & VSNUL);
|
||||
val = NULL;
|
||||
} else {
|
||||
val = lookupvar(var);
|
||||
@@ -583,15 +601,13 @@ again: /* jump here after setting a variable with ${var=text} */
|
||||
if (set && subtype != VSPLUS) {
|
||||
/* insert the value of the variable */
|
||||
if (special) {
|
||||
char *exp, *oexpdest = expdest;
|
||||
varvalue(var, varflags & VSQUOTE, flag & EXP_FULL);
|
||||
if (subtype == VSLENGTH) {
|
||||
for (exp = oexpdest;exp != expdest; exp++)
|
||||
varlen++;
|
||||
expdest = oexpdest;
|
||||
varlen = expdest - stackblock() - startloc;
|
||||
STADJUST(-varlen, expdest);
|
||||
}
|
||||
} else {
|
||||
char const *syntax = (varflags & VSQUOTE) ? DQSYNTAX
|
||||
char const *syntax = (varflags & VSQUOTE) ? DQSYNTAX
|
||||
: BASESYNTAX;
|
||||
|
||||
if (subtype == VSLENGTH) {
|
||||
@@ -608,11 +624,11 @@ again: /* jump here after setting a variable with ${var=text} */
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (subtype == VSPLUS)
|
||||
set = ! set;
|
||||
|
||||
easy = ((varflags & VSQUOTE) == 0 ||
|
||||
easy = ((varflags & VSQUOTE) == 0 ||
|
||||
(*var == '@' && shellparam.nparam != 1));
|
||||
|
||||
|
||||
@@ -625,7 +641,7 @@ again: /* jump here after setting a variable with ${var=text} */
|
||||
if (!easy)
|
||||
break;
|
||||
record:
|
||||
recordregion(startloc, expdest - stackblock(),
|
||||
recordregion(startloc, expdest - stackblock(),
|
||||
varflags & VSQUOTE);
|
||||
break;
|
||||
|
||||
@@ -651,15 +667,22 @@ record:
|
||||
*/
|
||||
STPUTC('\0', expdest);
|
||||
pat = expdest;
|
||||
if (subevalvar(p, pat, subtype, startloc, varflags))
|
||||
if (subevalvar(p, NULL, expdest - stackblock(), subtype,
|
||||
startloc, varflags))
|
||||
goto record;
|
||||
else {
|
||||
int amount = (expdest - pat) + 1;
|
||||
STADJUST(-amount, expdest);
|
||||
}
|
||||
break;
|
||||
|
||||
case VSASSIGN:
|
||||
case VSQUESTION:
|
||||
if (!set) {
|
||||
if (subevalvar(p, var, subtype, startloc, varflags))
|
||||
if (subevalvar(p, var, 0, subtype, startloc, varflags)) {
|
||||
varflags &= ~VSNUL;
|
||||
goto again;
|
||||
}
|
||||
break;
|
||||
}
|
||||
if (easy)
|
||||
@@ -697,24 +720,39 @@ record:
|
||||
*/
|
||||
|
||||
STATIC int
|
||||
varisset(name)
|
||||
varisset(name, nulok)
|
||||
char *name;
|
||||
{
|
||||
char **ap;
|
||||
int num;
|
||||
int nulok;
|
||||
{
|
||||
|
||||
if (*name == '!') {
|
||||
if (backgndpid == -1)
|
||||
return 0;
|
||||
} else if (*name == '@' || *name == '*') {
|
||||
if (*name == '!')
|
||||
return backgndpid != -1;
|
||||
else if (*name == '@' || *name == '*') {
|
||||
if (*shellparam.p == NULL)
|
||||
return 0;
|
||||
|
||||
if (nulok) {
|
||||
char **av;
|
||||
|
||||
for (av = shellparam.p; *av; av++)
|
||||
if (**av != '\0')
|
||||
return 1;
|
||||
return 0;
|
||||
}
|
||||
} else if (is_digit(*name)) {
|
||||
num = atoi(name);
|
||||
ap = shellparam.p;
|
||||
while (num-- > 0)
|
||||
if (*ap++ == NULL)
|
||||
return 0;
|
||||
char *ap;
|
||||
int num = atoi(name);
|
||||
|
||||
if (num > shellparam.nparam)
|
||||
return 0;
|
||||
|
||||
if (num == 0)
|
||||
ap = arg0;
|
||||
else
|
||||
ap = shellparam.p[num - 1];
|
||||
|
||||
if (nulok && (ap == NULL || *ap == '\0'))
|
||||
return 0;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
@@ -814,12 +852,12 @@ allargs:
|
||||
*/
|
||||
|
||||
STATIC void
|
||||
recordregion(start, end, nulonly)
|
||||
recordregion(start, end, nulonly)
|
||||
int start;
|
||||
int end;
|
||||
int nulonly;
|
||||
{
|
||||
register struct ifsregion *ifsp;
|
||||
struct ifsregion *ifsp;
|
||||
|
||||
if (ifslastp == NULL) {
|
||||
ifsp = &ifsfirst;
|
||||
@@ -849,7 +887,7 @@ ifsbreakup(string, arglist)
|
||||
struct ifsregion *ifsp;
|
||||
struct strlist *sp;
|
||||
char *start;
|
||||
register char *p;
|
||||
char *p;
|
||||
char *q;
|
||||
char *ifs;
|
||||
int ifsspc;
|
||||
@@ -918,7 +956,7 @@ char *expdir;
|
||||
STATIC void
|
||||
expandmeta(str, flag)
|
||||
struct strlist *str;
|
||||
int flag;
|
||||
int flag __unused;
|
||||
{
|
||||
char *p;
|
||||
struct strlist **savelastp;
|
||||
@@ -976,7 +1014,7 @@ expmeta(enddir, name)
|
||||
char *enddir;
|
||||
char *name;
|
||||
{
|
||||
register char *p;
|
||||
char *p;
|
||||
char *q;
|
||||
char *start;
|
||||
char *endname;
|
||||
@@ -994,7 +1032,7 @@ expmeta(enddir, name)
|
||||
metaflag = 1;
|
||||
else if (*p == '[') {
|
||||
q = p + 1;
|
||||
if (*q == '!')
|
||||
if (*q == '!' || *q == '^')
|
||||
q++;
|
||||
for (;;) {
|
||||
if (*q == CTLESC)
|
||||
@@ -1192,8 +1230,8 @@ pmatch(pattern, string)
|
||||
char *pattern;
|
||||
char *string;
|
||||
{
|
||||
register char *p, *q;
|
||||
register char c;
|
||||
char *p, *q;
|
||||
char c;
|
||||
|
||||
p = pattern;
|
||||
q = string;
|
||||
@@ -1229,7 +1267,7 @@ pmatch(pattern, string)
|
||||
char chr;
|
||||
|
||||
endp = p;
|
||||
if (*endp == '!')
|
||||
if (*endp == '!' || *endp == '^')
|
||||
endp++;
|
||||
for (;;) {
|
||||
if (*endp == '\0')
|
||||
@@ -1240,7 +1278,7 @@ pmatch(pattern, string)
|
||||
break;
|
||||
}
|
||||
invert = 0;
|
||||
if (*p == '!') {
|
||||
if (*p == '!' || *p == '^') {
|
||||
invert++;
|
||||
p++;
|
||||
}
|
||||
@@ -1292,7 +1330,7 @@ void
|
||||
rmescapes(str)
|
||||
char *str;
|
||||
{
|
||||
register char *p, *q;
|
||||
char *p, *q;
|
||||
|
||||
p = str;
|
||||
while (*p != CTLESC) {
|
||||
|
||||
Loaded 100 of 3331 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user