Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 9 Jan 2016 15:33:48 +0000 (UTC)
From:      Dmitry Chagin <dchagin@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org
Subject:   svn commit: r293507 - stable/10/sys/compat/linux
Message-ID:  <201601091533.u09FXm11021381@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: dchagin
Date: Sat Jan  9 15:33:48 2016
New Revision: 293507
URL: https://svnweb.freebsd.org/changeset/base/293507

Log:
  MFC r283398:
  
  Sched_rr_get_interval returns EINVAL in case when the invalid pid
  specified. This silence the ltp tests.

Modified:
  stable/10/sys/compat/linux/linux_misc.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/compat/linux/linux_misc.c
==============================================================================
--- stable/10/sys/compat/linux/linux_misc.c	Sat Jan  9 15:32:33 2016	(r293506)
+++ stable/10/sys/compat/linux/linux_misc.c	Sat Jan  9 15:33:48 2016	(r293507)
@@ -2041,6 +2041,13 @@ linux_sched_rr_get_interval(struct threa
 	struct thread *tdt;
 	int error;
 
+	/*
+	 * According to man in case the invalid pid specified
+	 * EINVAL should be returned.
+	 */
+	if (uap->pid < 0)
+		return (EINVAL);
+
 	tdt = linux_tdfind(td, uap->pid, -1);
 	if (tdt == NULL)
 		return (ESRCH);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201601091533.u09FXm11021381>