Source-Changes-HG archive

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

[src/trunk]: src/lib/libpthread sem_init(): oops, only destroy the ksem on er...



details:   https://anonhg.NetBSD.org/src/rev/e969608ffb9c
branches:  trunk
changeset: 542167:e969608ffb9c
user:      thorpej <thorpej%NetBSD.org@localhost>
date:      Wed Jan 22 23:18:06 2003 +0000

description:
sem_init(): oops, only destroy the ksem on error if it is a ksem.

diffstat:

 lib/libpthread/sem.c |  5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diffs (19 lines):

diff -r cb1579a0a9dd -r e969608ffb9c lib/libpthread/sem.c
--- a/lib/libpthread/sem.c      Wed Jan 22 23:06:37 2003 +0000
+++ b/lib/libpthread/sem.c      Wed Jan 22 23:18:06 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: sem.c,v 1.3 2003/01/22 22:51:42 thorpej Exp $  */
+/*     $NetBSD: sem.c,v 1.4 2003/01/22 23:18:06 thorpej Exp $  */
 
 /*-
  * Copyright (c) 2003 The NetBSD Foundation, Inc.
@@ -140,7 +140,8 @@
                return (-1);
 
        if ((error = sem_alloc(value, semid, sem)) != 0) {
-               _ksem_destroy(semid);
+               if (semid != USEM_USER)
+                       _ksem_destroy(semid);
                errno = error;
                return (-1);
        }



Home | Main Index | Thread Index | Old Index