git: fa977a3b2bb2 - main - diff: eliminate a useless lseek

Baptiste Daroussin bapt at FreeBSD.org
Wed Jan 27 11:18:53 UTC 2021


The branch main has been updated by bapt:

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

commit fa977a3b2bb2d0e6c2957b14474c31b58dd3a8e1
Author:     Baptiste Daroussin <bapt at FreeBSD.org>
AuthorDate: 2021-01-26 10:42:20 +0000
Commit:     Baptiste Daroussin <bapt at FreeBSD.org>
CommitDate: 2021-01-27 11:18:45 +0000

    diff: eliminate a useless lseek
    
    fdopen with the "r" already position the stream at the beginning
    of the file.
---
 usr.bin/diff/diffreg.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/usr.bin/diff/diffreg.c b/usr.bin/diff/diffreg.c
index 4e887ab27c7b..a8d668ea0984 100644
--- a/usr.bin/diff/diffreg.c
+++ b/usr.bin/diff/diffreg.c
@@ -491,7 +491,6 @@ 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