diff options
author | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2016-12-12 14:47:18 -0500 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2016-12-12 14:47:18 -0500 |
commit | 496c9a929384bfb5c829847ee1b068e96dcbaaf8 (patch) | |
tree | fe5f873c4add78fc357163199fbe1768b1806e5b /tools | |
parent | 69973b830859bc6529a7a0468ba0d80ee5117826 (diff) | |
parent | 5a6e7ec3bfef2ea518061d8d5d77367952770efb (diff) |
Merge branch 'acpica'
* acpica:
ACPICA: Utilities: Add new decode function for parser values
ACPICA: Tables: Add an error message complaining driver bugs
ACPICA: Tables: Add acpi_tb_unload_table()
ACPICA: Tables: Cleanup acpi_tb_install_and_load_table()
ACPICA: Events: Fix acpi_ev_initialize_region() return value
ACPICA: Back port of "ACPICA: Dispatcher: Tune interpreter lock around AcpiEvInitializeRegion()"
ACPICA: Namespace: Add acpi_ns_handle_to_name()
ACPICA: Update version to 20160930
ACPICA: Move acpi_gbl_max_loop_iterations to the public globals file
ACPICA: Disassembler: Fix for Divide() support, new support for test suite
ACPICA: Increase loop limit for AE_AML_INFINITE_LOOP exception
ACPICA: MacOSX: Fix wrong sem_destroy definition
ACPICA: MacOSX: Fix anonymous semaphore implementation
ACPICA: Update an info message during table load phase
Diffstat (limited to 'tools')
-rw-r--r-- | tools/power/acpi/os_specific/service_layers/osunixxf.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/tools/power/acpi/os_specific/service_layers/osunixxf.c b/tools/power/acpi/os_specific/service_layers/osunixxf.c index 8d8003c919d4..10648aaf6164 100644 --- a/tools/power/acpi/os_specific/service_layers/osunixxf.c +++ b/tools/power/acpi/os_specific/service_layers/osunixxf.c | |||
@@ -646,8 +646,12 @@ acpi_os_create_semaphore(u32 max_units, | |||
646 | } | 646 | } |
647 | #ifdef __APPLE__ | 647 | #ifdef __APPLE__ |
648 | { | 648 | { |
649 | char *semaphore_name = tmpnam(NULL); | 649 | static int semaphore_count = 0; |
650 | char semaphore_name[32]; | ||
650 | 651 | ||
652 | snprintf(semaphore_name, sizeof(semaphore_name), "acpi_sem_%d", | ||
653 | semaphore_count++); | ||
654 | printf("%s\n", semaphore_name); | ||
651 | sem = | 655 | sem = |
652 | sem_open(semaphore_name, O_EXCL | O_CREAT, 0755, | 656 | sem_open(semaphore_name, O_EXCL | O_CREAT, 0755, |
653 | initial_units); | 657 | initial_units); |
@@ -692,10 +696,15 @@ acpi_status acpi_os_delete_semaphore(acpi_handle handle) | |||
692 | if (!sem) { | 696 | if (!sem) { |
693 | return (AE_BAD_PARAMETER); | 697 | return (AE_BAD_PARAMETER); |
694 | } | 698 | } |
695 | 699 | #ifdef __APPLE__ | |
700 | if (sem_close(sem) == -1) { | ||
701 | return (AE_BAD_PARAMETER); | ||
702 | } | ||
703 | #else | ||
696 | if (sem_destroy(sem) == -1) { | 704 | if (sem_destroy(sem) == -1) { |
697 | return (AE_BAD_PARAMETER); | 705 | return (AE_BAD_PARAMETER); |
698 | } | 706 | } |
707 | #endif | ||
699 | 708 | ||
700 | return (AE_OK); | 709 | return (AE_OK); |
701 | } | 710 | } |