~ubuntu-branches/ubuntu/hardy/mysql-dfsg-5.0/hardy-proposed

« back to all changes in this revision

Viewing changes to mysys/my_os2mutex.c

  • Committer: Package Import Robot
  • Author(s): Marc Deslauriers
  • Date: 2012-02-23 11:21:11 UTC
  • mfrom: (1.1.16) (38.1.4 hardy-security)
  • Revision ID: package-import@ubuntu.com-20120223112111-rn9ruzg86juli2ec
Tags: 5.0.95-0ubuntu1
* SECURITY UPDATE: Update to 5.0.95 to fix multiple security issues
  (LP: #937869)
  - http://www.oracle.com/technetwork/topics/security/cpujan2012-366304.html
  - CVE-2012-0075
  - CVE-2012-0087
  - CVE-2012-0101
  - CVE-2012-0102
  - CVE-2012-0114
  - CVE-2012-0484
  - CVE-2012-0490
* Dropped patches unnecessary with 5.0.95:
  - debian/patches/91_SECURITY_CVE-2007-5925.dpatch
  - debian/patches/95_SECURITY_CVE-2008-3963.dpatch
  - debian/patches/96_SECURITY_CVE-2008-4098.dpatch
  - debian/patches/97_CVE-2008-4456.dpatch
  - debian/patches/97_CVE-2009-2446.dpatch
  - debian/patches/97_CVE-2009-4019.dpatch
  - debian/patches/97_CVE-2009-4030.dpatch
  - debian/patches/98_CVE-2009-4484.dpatch
  - debian/patches/99_ssl_test_certs.dpatch
  - debian/patches/100_CVE-2010-1850.dpatch
  - debian/patches/101_CVE-2010-1849.dpatch
  - debian/patches/102_CVE-2010-1848.dpatch
  - debian/patches/103_CVE-2010-1626.dpatch
  - debian/patches/98_CVE-2010-3677.dpatch
  - debian/patches/98_CVE-2010-3680.dpatch
  - debian/patches/98_CVE-2010-3681.dpatch
  - debian/patches/98_CVE-2010-3682.dpatch
  - debian/patches/98_CVE-2010-3833.dpatch
  - debian/patches/98_CVE-2010-3834.dpatch
  - debian/patches/98_CVE-2010-3835.dpatch
  - debian/patches/98_CVE-2010-3836.dpatch
  - debian/patches/98_CVE-2010-3837.dpatch
  - debian/patches/98_CVE-2010-3838.dpatch
  - debian/patches/98_CVE-2010-3840.dpatch
  - debian/patches/45_warn-CLI-passwords.dpatch
  - debian/patches/50_fix_mysqldump.dpatch
  - debian/patches/51_incorrect-order.dpatch
  - debian/patches/52_ndb-gcc-4.2.dpatch
  - debian/patches/53_integer-gcc-4.2.dpatch
  - debian/patches/54_ssl-client-support.dpatch
  - debian/patches/55_testsuite-2008.dpatch
  - debian/patches/58-disable-ndb-backup-print.dpatch
  - debian/patches/59-fix-mysql-replication-logs.dpatch
  - debian/patches/86_PATH_MAX.dpatch
  - debian/patches/90_upstreamdebiandir.dpatch
  - debian/patches/92_fix_order_by32202.dpatch
  - debian/patches/93_fix_user_setup_on_localhost.dpatch
  - debian/patches/94_fix_mysqldump_with_old_versions.dpatch
  - debian/patches/56-mysqlhotcopy-invalid-dbtable.dpatch
  - debian/patches/57-fix-mysqlslowdump-config.dpatch
* debian/mysql-client-5.0.docs, debian/mysql-server-5.0.docs: removed
  EXCEPTIONS-CLIENT file
* debian/libmysqlclient15-dev.docs, debian/libmysqlclient15off.docs:
  removed, no longer necessary.
* debian/patches/25_mysys__default.c.dpatch: updated for 5.0.95.
* debian/mysql-server-5.0.files: change ndb_mgmd and ndbd manpage
  locations. Removed mysqlmanagerc.1 and mysqlmanager-pwgen.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*
2
 
 * Copyright (c) 1995 John Birrell <jb@cimlogic.com.au>.
3
 
 * All rights reserved.
4
 
 *
5
 
 * Modified and extended by Antony T Curtis <antony.curtis@olcs.net>
6
 
 * for use with OS/2.
7
 
 *
8
 
 * Redistribution and use in source and binary forms, with or without
9
 
 * modification, are permitted provided that the following conditions
10
 
 * are met:
11
 
 * 1. Redistributions of source code must retain the above copyright
12
 
 *    notice, this list of conditions and the following disclaimer.
13
 
 * 2. Redistributions in binary form must reproduce the above copyright
14
 
 *    notice, this list of conditions and the following disclaimer in the
15
 
 *    documentation and/or other materials provided with the distribution.
16
 
 * 3. All advertising materials mentioning features or use of this software
17
 
 *    must display the following acknowledgement:
18
 
 *      This product includes software developed by John Birrell.
19
 
 * 4. Neither the name of the author nor the names of any co-contributors
20
 
 *    may be used to endorse or promote products derived from this software
21
 
 *    without specific prior written permission.
22
 
 *
23
 
 * THIS SOFTWARE IS PROVIDED BY JOHN BIRRELL AND CONTRIBUTORS ``AS IS'' AND
24
 
 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
25
 
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
26
 
 * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
27
 
 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
28
 
 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
29
 
 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
30
 
 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
31
 
 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
32
 
 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
33
 
 * SUCH DAMAGE.
34
 
 *
35
 
 */
36
 
#include <stdlib.h>
37
 
#include <errno.h>
38
 
#ifdef _THREAD_SAFE
39
 
 
40
 
int
41
 
pthread_mutex_init(pthread_mutex_t * mutex,
42
 
                   const pthread_mutexattr_t * mutex_attr)
43
 
{
44
 
  (void) DosCreateMutexSem(NULL,mutex,0,0);
45
 
  return (0);                           /* Return the completion status: */
46
 
}
47
 
 
48
 
 
49
 
int
50
 
pthread_mutex_destroy(pthread_mutex_t * mutex)
51
 
{
52
 
  APIRET rc;
53
 
 
54
 
  do
55
 
  {
56
 
    rc = DosCloseMutexSem(*mutex);
57
 
    if (rc == 301) DosReleaseMutexSem(*mutex);
58
 
  } while (rc == 301);
59
 
 
60
 
  *mutex = 0;
61
 
  return (0);                           /* Return the completion status: */
62
 
}
63
 
 
64
 
 
65
 
int
66
 
pthread_mutex_lock(pthread_mutex_t * mutex)
67
 
{
68
 
  APIRET rc;
69
 
 
70
 
  rc = DosRequestMutexSem(*mutex,SEM_INDEFINITE_WAIT);
71
 
  if (rc)
72
 
    return(EINVAL);
73
 
  return (0);                           /* Return the completion status: */
74
 
}
75
 
 
76
 
 
77
 
int
78
 
pthread_mutex_unlock(pthread_mutex_t * mutex)
79
 
{
80
 
  (void) DosReleaseMutexSem(*mutex);
81
 
  return (0);                           /* Return the completion status: */
82
 
}
83
 
#endif