]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
(lockf): Move initilisation of fl.l_whence and fl.l_start at beginning
authorUlrich Drepper <drepper@redhat.com>
Tue, 1 Sep 1998 18:32:10 +0000 (18:32 +0000)
committerUlrich Drepper <drepper@redhat.com>
Tue, 1 Sep 1998 18:32:10 +0000 (18:32 +0000)
of function.

io/lockf.c

index 7bf90c9b5935295cb77850525d159cd88f4e3372..c5eb43aabfa2a21a09585cb3392584c8b0437aa8 100644 (file)
@@ -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);
 }