mirror of
git://sourceware.org/git/glibc.git
synced 2025-04-06 14:10:30 +08:00
(lockf): Move initilisation of fl.l_whence and fl.l_start at beginning
of function.
This commit is contained in:
parent
50197d2585
commit
66853af29c
11
io/lockf.c
11
io/lockf.c
@ -31,6 +31,11 @@ lockf (int fd, int cmd, off_t len)
|
||||
|
||||
memset ((char *) &fl, '\0', sizeof (fl));
|
||||
|
||||
/* lockf is always relative to the current file position. */
|
||||
fl.l_whence = SEEK_CUR;
|
||||
fl.l_start = 0;
|
||||
fl.l_len = len;
|
||||
|
||||
switch (cmd)
|
||||
{
|
||||
case F_TEST:
|
||||
@ -61,11 +66,5 @@ lockf (int fd, int cmd, off_t len)
|
||||
return -1;
|
||||
}
|
||||
|
||||
/* lockf is always relative to the current file position. */
|
||||
fl.l_whence = SEEK_CUR;
|
||||
fl.l_start = 0;
|
||||
|
||||
fl.l_len = len;
|
||||
|
||||
return fcntl (fd, cmd, &fl);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user