This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
[review] login: Remove double-assignment of fl.l_whence in try_file_lock
- From: "Carlos O'Donell (Code Review)" <gerrit at gnutoolchain-gerrit dot osci dot io>
- To: Florian Weimer <fweimer at redhat dot com>, libc-alpha at sourceware dot org
- Date: Wed, 6 Nov 2019 16:56:36 -0500
- Subject: [review] login: Remove double-assignment of fl.l_whence in try_file_lock
- Auto-submitted: auto-generated
- References: <gerrit.1573077292000.I2baf9e70690e723c61051b25ccbd510aec15976c@gnutoolchain-gerrit.osci.io>
- Reply-to: gnutoolchain-gerrit at osci dot io
Carlos O'Donell has posted comments on this change.
Change URL: https://gnutoolchain-gerrit.osci.io/r/c/glibc/+/515
......................................................................
Patch Set 1: Code-Review+2
(1 comment)
https://gnutoolchain-gerrit.osci.io/r/c/glibc/+/515/1/login/utmp_file.c
File login/utmp_file.c:
https://gnutoolchain-gerrit.osci.io/r/c/glibc/+/515/1/login/utmp_file.c@82
PS1, Line 82:
63 | try_file_lock (int fd, int type)
| ...
77 |
78 | /* Try to get the lock. */
79 | struct flock64 fl =
80 | {
81 | .l_type = type,
82 > .l_whence = SEEK_SET,
83 | };
84 |
85 | bool status = __fcntl64_nocancel (fd, F_SETLKW, &fl) < 0;
86 | int saved_errno = errno;
87 |
OK. The double assignment is that we used 'fl' in the orignal code. This fix is correct.
--
Gerrit-Project: glibc
Gerrit-Branch: master
Gerrit-Change-Id: I2baf9e70690e723c61051b25ccbd510aec15976c
Gerrit-Change-Number: 515
Gerrit-PatchSet: 1
Gerrit-Owner: Florian Weimer <fweimer@redhat.com>
Gerrit-Reviewer: Carlos O'Donell <carlos@redhat.com>
Gerrit-Comment-Date: Wed, 06 Nov 2019 21:56:36 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment