diff mbox series

[hurd,commited] hurd: Fix returning value for fcntl(F_*LK*)

Message ID 20181130014310.26204-1-samuel.thibault@ens-lyon.org
State New
Headers show
Series [hurd,commited] hurd: Fix returning value for fcntl(F_*LK*) | expand

Commit Message

Samuel Thibault Nov. 30, 2018, 1:43 a.m. UTC
to avoid calling va_end again, etc.

	* sysdeps/mach/hurd/fcntl.c (__libc_fcntl): Directly return value
	returned by __f_setlk.
---
 ChangeLog                 |  5 +++++
 sysdeps/mach/hurd/fcntl.c | 10 ++++------
 2 files changed, 9 insertions(+), 6 deletions(-)
diff mbox series

Patch

diff --git a/ChangeLog b/ChangeLog
index f852a8b299..f7c43277a2 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@ 
+2018-11-30  Samuel Thibault  <samuel.thibault@ens-lyon.org>
+
+	* sysdeps/mach/hurd/fcntl.c (__libc_fcntl): Directly return value
+	returned by __f_setlk.
+
 2018-11-29  H.J. Lu  <hongjiu.lu@intel.com>
 	    Adhemerval Zanella  <adhemerval.zanella@linaro.org>
 
diff --git a/sysdeps/mach/hurd/fcntl.c b/sysdeps/mach/hurd/fcntl.c
index 6fa63f2fc7..f7f9abce03 100644
--- a/sysdeps/mach/hurd/fcntl.c
+++ b/sysdeps/mach/hurd/fcntl.c
@@ -141,9 +141,8 @@  __libc_fcntl (int fd, int cmd, ...)
 	    wait = 1;
 	    /* FALLTHROUGH */
 	  case F_SETLK:
-	    result = __f_setlk (fd, fl->l_type, fl->l_whence,
-				fl->l_start, fl->l_len, wait);
-	    break;
+	    return __f_setlk (fd, fl->l_type, fl->l_whence,
+			      fl->l_start, fl->l_len, wait);
 	  default:
 	    errno = EINVAL;
 	    return -1;
@@ -166,9 +165,8 @@  __libc_fcntl (int fd, int cmd, ...)
 	    wait = 1;
 	    /* FALLTHROUGH */
 	  case F_SETLK:
-	    result = __f_setlk (fd, fl->l_type, fl->l_whence,
-				fl->l_start, fl->l_len, wait);
-	    break;
+	    return __f_setlk (fd, fl->l_type, fl->l_whence,
+			      fl->l_start, fl->l_len, wait);
 	  default:
 	    errno = EINVAL;
 	    return -1;