View | Details | Raw Unified | Return to bug 237740
Collapse All | Expand All

(-)dd.c (-1 / +10 lines)
Lines 364-369 Link Here
364
dd_in(void)
364
dd_in(void)
365
{
365
{
366
	ssize_t n;
366
	ssize_t n;
367
	off_t offset = -1;
367
368
368
	for (;;) {
369
	for (;;) {
369
		switch (cpy_cnt) {
370
		switch (cpy_cnt) {
Lines 393-398 Link Here
393
				memset(in.dbp, 0, in.dbsz);
394
				memset(in.dbp, 0, in.dbsz);
394
		}
395
		}
395
396
397
		if (in.flags & ISSEEK) {
398
			offset = lseek(in.fd, 0, SEEK_CUR);
399
			if (offset == -1) {
400
				warn("%s", in.name);
401
			}
402
		}
403
396
		n = read(in.fd, in.dbp, in.dbsz);
404
		n = read(in.fd, in.dbp, in.dbsz);
397
		if (n == 0) {
405
		if (n == 0) {
398
			in.dbrcnt = 0;
406
			in.dbrcnt = 0;
Lines 417-423 Link Here
417
			 * in sector size chunks.
425
			 * in sector size chunks.
418
			 */
426
			 */
419
			if (in.flags & ISSEEK &&
427
			if (in.flags & ISSEEK &&
420
			    lseek(in.fd, (off_t)in.dbsz, SEEK_CUR))
428
			    (offset == -1 ? lseek(in.fd, (off_t)in.dbsz, SEEK_CUR) :
429
			     lseek(in.fd, offset + in.dbsz, SEEK_SET)) == -1)
421
				warn("%s", in.name);
430
				warn("%s", in.name);
422
431
423
			/* If sync not specified, omit block and continue. */
432
			/* If sync not specified, omit block and continue. */

Return to bug 237740