Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/lib/libpthread pthread_attr_getschedpolicy() wasn't setting ...



details:   https://anonhg.NetBSD.org/src/rev/47ee42ef01b9
branches:  trunk
changeset: 584507:47ee42ef01b9
user:      tv <tv%NetBSD.org@localhost>
date:      Wed Sep 21 15:27:14 2005 +0000

description:
pthread_attr_getschedpolicy() wasn't setting the return buffer at all.
SCHED_OTHER happens to be 0, so this assignment to "int *" succeeds,
and becomes a no-op.

Fix by dereferencing "policy" to do the assignment, thus filling the
return buffer with 0.

diffstat:

 lib/libpthread/pthread_attr.c |  6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diffs (27 lines):

diff -r 45008a7f4257 -r 47ee42ef01b9 lib/libpthread/pthread_attr.c
--- a/lib/libpthread/pthread_attr.c     Wed Sep 21 15:06:22 2005 +0000
+++ b/lib/libpthread/pthread_attr.c     Wed Sep 21 15:27:14 2005 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: pthread_attr.c,v 1.4 2004/12/29 00:59:57 nathanw Exp $ */
+/*     $NetBSD: pthread_attr.c,v 1.5 2005/09/21 15:27:14 tv Exp $      */
 
 /*-
  * Copyright (c) 2001,2002,2003 The NetBSD Foundation, Inc.
@@ -37,7 +37,7 @@
  */
 
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: pthread_attr.c,v 1.4 2004/12/29 00:59:57 nathanw Exp $");
+__RCSID("$NetBSD: pthread_attr.c,v 1.5 2005/09/21 15:27:14 tv Exp $");
 
 #include <errno.h>
 #include <stdio.h>
@@ -286,7 +286,7 @@
     int *policy)
 {
 
-       policy = SCHED_OTHER;
+       *policy = SCHED_OTHER;
 
        return 0;
 }



Home | Main Index | Thread Index | Old Index