git: c69047ca7526 - main - Revert "diff: eliminate a useless lseek"

Baptiste Daroussin bapt at FreeBSD.org
Tue Feb 2 09:09:36 UTC 2021


The branch main has been updated by bapt:

URL: https://cgit.FreeBSD.org/src/commit/?id=c69047ca7526090cc2aa92c57d9f21a77a82fc2e

commit c69047ca7526090cc2aa92c57d9f21a77a82fc2e
Author:     Baptiste Daroussin <bapt at FreeBSD.org>
AuthorDate: 2021-02-02 09:07:57 +0000
Commit:     Baptiste Daroussin <bapt at FreeBSD.org>
CommitDate: 2021-02-02 09:08:25 +0000

    Revert "diff: eliminate a useless lseek"
    
    This changes breaks when one of the files is stdin
    
    This reverts commit fa977a3b2bb2d0e6c2957b14474c31b58dd3a8e1.
    
    Reported by:    olivier
---
 usr.bin/diff/diffreg.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/usr.bin/diff/diffreg.c b/usr.bin/diff/diffreg.c
index 4c9211510459..1b28281024c6 100644
--- a/usr.bin/diff/diffreg.c
+++ b/usr.bin/diff/diffreg.c
@@ -490,6 +490,7 @@ opentemp(const char *f)
 		}
 	}
 	close(ifd);
+	lseek(ofd, (off_t)0, SEEK_SET);
 	return (fdopen(ofd, "r"));
 }
 


More information about the dev-commits-src-main mailing list