From: Ulrich Drepper Date: Tue, 1 Sep 1998 18:32:10 +0000 (+0000) Subject: (lockf): Move initilisation of fl.l_whence and fl.l_start at beginning X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=66853af29cfb3241dab4395adf131cc824aa16e0;p=thirdparty%2Fglibc.git (lockf): Move initilisation of fl.l_whence and fl.l_start at beginning of function. --- diff --git a/io/lockf.c b/io/lockf.c index 7bf90c9b593..c5eb43aabfa 100644 --- a/io/lockf.c +++ b/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); }