]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Get rid unneccessary useless calls to lseek(2) from getgrent(3).
authorEdward Tomasz Napierala <trasz@FreeBSD.org>
Tue, 16 Oct 2018 18:17:07 +0000 (18:17 +0000)
committerEdward Tomasz Napierala <trasz@FreeBSD.org>
Tue, 16 Oct 2018 18:17:07 +0000 (18:17 +0000)
commit8bb6c72e6309618639d5d14378b084a024e9c993
tree5ea94efb3da0a56424ba358538a2874693f095f4
parent2fd0c8e7caf5fcf5989a0faaa6e488dd643df87d
Get rid unneccessary useless calls to lseek(2) from getgrent(3).
Looks like this:

 fstatat(AT_FDCWD,"/etc/nsswitch.conf",{ mode=-rw-r--r-- ,inode=2167001,size=390,blksize=32768 },0x0) = 0 (0x0)
 open("/etc/group",O_RDONLY|O_CLOEXEC,0666)      = 3 (0x3)
 fstat(3,{ mode=-rw-r--r-- ,inode=2166927,size=919,blksize=32768 }) = 0 (0x0)
-lseek(3,0x0,SEEK_CUR)                           = 0 (0x0)
-lseek(3,0x0,SEEK_SET)                           = 0 (0x0)
 read(3,"# $FreeBSD: release/10.0.0/etc/g"...,32768) = 919 (0x397)
 close(3)                                        = 0 (0x0)

Reviewed by: kib
Approved by: re (gjb)
MFC after: 2 weeks
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D17571
lib/libc/gen/getgrent.c