Gentoo Archives: gentoo-commits

From: Conrad Kostecki <conikost@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: sys-block/buffer/files/
Date: Fri, 08 Oct 2021 21:51:46
Message-Id: 1633729826.3626fe64cc57608331b9db18b001304f237dab8f.conikost@gentoo
1 commit: 3626fe64cc57608331b9db18b001304f237dab8f
2 Author: Michael Mair-Keimberger <mmk <AT> levelnine <DOT> at>
3 AuthorDate: Wed Oct 6 16:07:31 2021 +0000
4 Commit: Conrad Kostecki <conikost <AT> gentoo <DOT> org>
5 CommitDate: Fri Oct 8 21:50:26 2021 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=3626fe64
7
8 sys-block/buffer: remove unused patch(es)
9
10 Closes: https://github.com/gentoo/gentoo/pull/22505
11 Package-Manager: Portage-3.0.26, Repoman-3.0.3
12 Signed-off-by: Michael Mair-Keimberger <mmk <AT> levelnine.at>
13 Signed-off-by: Conrad Kostecki <conikost <AT> gentoo.org>
14
15 sys-block/buffer/files/1.19-deb-gentoo.patch | 293 ---------------------------
16 1 file changed, 293 deletions(-)
17
18 diff --git a/sys-block/buffer/files/1.19-deb-gentoo.patch b/sys-block/buffer/files/1.19-deb-gentoo.patch
19 deleted file mode 100644
20 index 66ea66433bc..00000000000
21 --- a/sys-block/buffer/files/1.19-deb-gentoo.patch
22 +++ /dev/null
23 @@ -1,293 +0,0 @@
24 -diff -ur buffer-1.19.orig/buffer.c buffer-1.19/buffer.c
25 ---- buffer-1.19.orig/buffer.c 2004-08-21 01:45:29.938082048 -0400
26 -+++ buffer-1.19/buffer.c 2004-08-21 01:45:39.444118464 -0400
27 -@@ -109,6 +109,9 @@
28 - * Initial revision
29 - *
30 - */
31 -+#include <stdlib.h>
32 -+#include <string.h>
33 -+#include <limits.h>
34 - #include <unistd.h>
35 - #include <stdio.h>
36 - #include <signal.h>
37 -@@ -120,6 +123,7 @@
38 - #include <sys/shm.h>
39 - #include <sys/sem.h>
40 - #include <sys/wait.h>
41 -+#include <sys/time.h>
42 - #include "sem.h"
43 -
44 - #ifndef lint
45 -@@ -127,8 +131,8 @@
46 - #endif
47 -
48 --#ifndef __alpha
49 -+#ifndef __linux__
50 - extern char *shmat();
51 --#endif /* __alpha */
52 -+#endif /* __linux__ */
53 -
54 - /* General macros */
55 - #define TRUE 1
56 -@@ -136,6 +140,14 @@
57 - #define K *1024
58 - #define M *1024*1024
59 -
60 -+#if defined __GNUC__ || __STDC_VERSION__ >= 199901L
61 -+#define NUM_K_TYPE unsigned long long
62 -+#define NUM_K_FMT "llu"
63 -+#else
64 -+#define NUM_K_TYPE unsigned long
65 -+#define NUM_K_FMT "lu"
66 -+#endif
67 -+
68 - /* Some forward declarations */
69 - void byee();
70 - void start_reader_and_writer();
71 -@@ -250,7 +262,9 @@
72 -
73 - char print_total = 0;
74 - /* Number of K output */
75 --unsigned long outk = 0;
76 -+NUM_K_TYPE outk = 0;
77 -+
78 -+struct timeval starttime;
79 -
80 - int
81 - main( argc, argv )
82 -@@ -262,6 +276,8 @@
83 - set_handlers();
84 -
85 - buffer_allocate();
86 -+
87 -+ gettimeofday(&starttime, NULL);
88 -
89 - start_reader_and_writer();
90 -
91 -@@ -384,8 +400,8 @@
92 - fprintf( stderr, "Usage: %s [-B] [-t] [-S size] [-m memsize] [-b blocks] [-p percent] [-s blocksize] [-u pause] [-i infile] [-o outfile] [-z size]\n",
93 - progname );
94 - fprintf( stderr, "-B = blocked device - pad out last block\n" );
95 -- fprintf( stderr, "-t = show total amount writen at end\n" );
96 -- fprintf( stderr, "-S size = show amount writen every size bytes\n" );
97 -+ fprintf( stderr, "-t = show total amount written at end\n" );
98 -+ fprintf( stderr, "-S size = show amount written every size bytes\n" );
99 - fprintf( stderr, "-m size = size of shared mem chunk to grab\n" );
100 - fprintf( stderr, "-b num = number of blocks in queue\n" );
101 - fprintf( stderr, "-p percent = don't start writing until percent blocks filled\n" );
102 -@@ -397,6 +413,11 @@
103 - byee( -1 );
104 - }
105 - }
106 -+
107 -+ if (argc > optind) {
108 -+ fprintf( stderr, "too many arguments\n" );
109 -+ byee( -1 );
110 -+ }
111 -
112 - if (zflag) showevery = blocksize;
113 -
114 -@@ -507,9 +528,9 @@
115 - get_buffer();
116 -
117 - if( debug )
118 -- fprintf( stderr, "%s pbuffer is 0x%08x, buffer_size is %d [%d x %d]\n",
119 -+ fprintf( stderr, "%s pbuffer is 0x%08lx, buffer_size is %d [%d x %d]\n",
120 - proc_string,
121 -- (char *)pbuffer, buffer_size, blocks, blocksize );
122 -+ (unsigned long)pbuffer, buffer_size, blocks, blocksize );
123 -
124 - #ifdef SYS5
125 - memset( (char *)pbuffer, '\0', buffer_size );
126 -@@ -528,7 +549,17 @@
127 - pbuffer->blocks_free_lock = 1;
128 - /* start this off so lock() can be called on it for each block
129 - * till all the blocks are used up */
130 -+ /* Initializing the semaphore to "blocks - 1" causes a hang when using option
131 -+ * "-p 100" because it always keeps one block free, so we'll never reach 100% fill
132 -+ * level. However, there doesn't seem to be a good reason to keep one block free,
133 -+ * so we initialize the semaphore to "blocks" instead.
134 -+ * <mbuck@××××××.org> 2004-01-11
135 -+ */
136 -+#if 0
137 - sem_set( pbuffer->semid, pbuffer->blocks_free_lock, blocks - 1 );
138 -+#else
139 -+ sem_set( pbuffer->semid, pbuffer->blocks_free_lock, blocks );
140 -+#endif
141 -
142 - /* Detattach the shared memory so the fork doesnt do anything odd */
143 - shmdt( (char *)pbuffer );
144 -@@ -648,7 +679,7 @@
145 - int
146 - fill_block()
147 - {
148 -- int bytes;
149 -+ int bytes = 0;
150 - char *start;
151 - int toread;
152 - static char eof_reached = 0;
153 -@@ -707,7 +738,7 @@
154 - {
155 - int filled = 0;
156 - int maxfilled = (blocks * percent) / 100;
157 -- int first_block;
158 -+ int first_block = 0;
159 -
160 - if( debug )
161 - fprintf( stderr, "\tW: Entering writer\n blocks = %d\n maxfilled = %d\n",
162 -@@ -742,7 +773,7 @@
163 - }
164 -
165 - if( print_total ){
166 -- fprintf( stderr, "Kilobytes Out %lu\n", outk );
167 -+ fprintf( stderr, "Kilobytes Out %" NUM_K_FMT "\n", outk );
168 - }
169 -
170 - if( debug )
171 -@@ -783,14 +814,14 @@
172 - void
173 - write_block_to_stdout()
174 - {
175 -- static unsigned long out = 0;
176 -+ unsigned long out = 0;
177 - static unsigned long last_gb = 0;
178 -- static unsigned long next_k = 0;
179 -+ static NUM_K_TYPE next_k = 0;
180 - int written;
181 -
182 - if( next_k == 0 && showevery ){
183 - if( debug > 3 )
184 -- fprintf( stderr, "W: next_k = %lu showevery = %d\n", next_k, showevery );
185 -+ fprintf( stderr, "W: next_k = %" NUM_K_FMT " showevery = %d\n", next_k, showevery );
186 - showevery = showevery / 1024;
187 - next_k = showevery;
188 - }
189 -@@ -798,7 +829,7 @@
190 - if( (written = write( fdout, curr_block->data, curr_block->bytes )) != curr_block->bytes ){
191 - report_proc();
192 - perror( "write of data failed" );
193 -- fprintf( stderr, "bytes to write=%d, bytes written=%d, total written %10luK\n", curr_block->bytes, written, outk );
194 -+ fprintf( stderr, "bytes to write=%d, bytes written=%d, total written %10" NUM_K_FMT "K\n", curr_block->bytes, written, outk );
195 - byee( -1 );
196 - }
197 -
198 -@@ -825,7 +856,7 @@
199 - }
200 - if( showevery ){
201 - if( debug > 3 )
202 -- fprintf( stderr, "W: outk = %lu, next_k = %lu\n",
203 -+ fprintf( stderr, "W: outk = %" NUM_K_FMT ", next_k = %" NUM_K_FMT "\n",
204 - outk, next_k );
205 - if( outk >= next_k ){
206 - pr_out();
207 -@@ -914,13 +945,12 @@
208 - do_size( arg )
209 - char *arg;
210 - {
211 -- char format[ 20 ];
212 -- int ret;
213 -+ int ret = 0;
214 -
215 -- *format = '\0';
216 -- sscanf( arg, "%d%s", &ret, format );
217 -+ char unit = '\0';
218 -+ sscanf( arg, "%d%c", &ret, &unit );
219 -
220 -- switch( *format ){
221 -+ switch( unit ){
222 - case 'm':
223 - case 'M':
224 - ret = ret K K;
225 -@@ -941,7 +971,36 @@
226 - void
227 - pr_out()
228 - {
229 -- fprintf( stderr, " %10luK\r", outk );
230 -+ struct timeval now;
231 -+ unsigned long ms_delta, k_per_s;
232 -+
233 -+ gettimeofday(&now, NULL);
234 -+ ms_delta = (now.tv_sec - starttime.tv_sec) * 1000
235 -+ + (now.tv_usec - starttime.tv_usec) / 1000;
236 -+ if (ms_delta) {
237 -+ /* Use increased accuracy for small amounts of data,
238 -+ * decreased accuracy for *huge* throughputs > 4.1GB/s
239 -+ * to avoid division by 0. This will overflow if your
240 -+ * machine's throughput exceeds 4TB/s - you deserve to
241 -+ * loose if you're still using 32 bit longs on such a
242 -+ * beast ;-)
243 -+ * <mbuck@××××××.org>
244 -+ */
245 -+ if (outk < ULONG_MAX / 1000) {
246 -+ k_per_s = (outk * 1000) / ms_delta;
247 -+ } else if (ms_delta >= 1000) {
248 -+ k_per_s = outk / (ms_delta / 1000);
249 -+ } else {
250 -+ k_per_s = (outk / ms_delta) * 1000;
251 -+ }
252 -+ fprintf( stderr, " %10" NUM_K_FMT "K, %10luK/s\r", outk, k_per_s );
253 -+ } else {
254 -+ if (outk) {
255 -+ fprintf( stderr, " %10" NUM_K_FMT "K, ?K/s\r", outk );
256 -+ } else {
257 -+ fprintf( stderr, " 0K, 0K/s\r");
258 -+ }
259 -+ }
260 - }
261 -
262 - #ifdef SYS5
263 -diff -ur buffer-1.19.orig/buffer.man buffer-1.19/buffer.man
264 ---- buffer-1.19.orig/buffer.man 2004-08-21 01:45:29.935085504 -0400
265 -+++ buffer-1.19/buffer.man 2004-08-21 01:45:39.441121920 -0400
266 -@@ -37,7 +37,8 @@
267 - Use the given file as the output file. The default is stdout.
268 - .TP
269 - .B \-S size
270 --After every chunk this size has been writen print out how much been writen so far.
271 -+After every chunk of this size has been written, print out how much has
272 -+been written so far. Also prints the total througput.
273 - By default this is not set.
274 - .TP
275 - .B \-s size
276 -@@ -71,9 +72,9 @@
277 - throughput on some drives.)
278 - .TP
279 - .B \-B
280 --Force each block writen to be padded out to the blocksize. This is needed by some tape
281 -+Force each block written to be padded out to the blocksize. This is needed by some tape
282 - and cartridge drives. Defaults to unpadded. This only affects the
283 --last block writen.
284 -+last block written.
285 - .TP
286 - .B \-t
287 - On exiting print to stderr a brief message showing the total number of
288 -@@ -82,7 +83,7 @@
289 - .B \-Z
290 - If reading/writing directly to a character device (like a tape drive)
291 - then after each gigabyte perform an lseek to the start of the file.
292 --Use this flag with extreme care. If can only be used on devices where
293 -+Use this flag with extreme care. It can only be used on devices where
294 - an lseek does not rewind the tape but does reset the kernels position
295 - flags. It is used to allow more than 2 gigabytes to be written.
296 - .PP
297 -diff -ur buffer-1.19.orig/sem.c buffer-1.19/sem.c
298 ---- buffer-1.19.orig/sem.c 2004-08-21 01:45:29.939080896 -0400
299 -+++ buffer-1.19/sem.c 2004-08-21 01:47:41.265618240 -0400
300 -@@ -27,6 +27,7 @@
301 - * semaphores */
302 -
303 - #include <stdio.h>
304 -+#include <unistd.h>
305 - #include <sys/types.h>
306 - #include <sys/stat.h>
307 - #include <sys/ipc.h>
308 -@@ -95,7 +96,7 @@
309 - return sem;
310 - }
311 -
312 --static
313 -+static void
314 - do_sem( sem_id, pbuf, err )
315 - int sem_id;
316 - struct sembuf *pbuf;