summaryrefslogtreecommitdiffstats
path: root/tools/power
diff options
context:
space:
mode:
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>2016-12-01 14:24:54 +0100
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2016-12-01 14:24:54 +0100
commitd0ab6714c53c9d7f3e42b7ea2e108afbd7449305 (patch)
treecbc41759898f3e29f58564e6eff48e58aa94217c /tools/power
parente2174b0c24caca170ca61eda2ae49c9561ff8896 (diff)
parent69d4e425d218e866e4cf3d34099691e9bcde0209 (diff)
downloadlinux-d0ab6714c53c9d7f3e42b7ea2e108afbd7449305.tar.bz2
Merge back earlier ACPICA material for v4.10.
Diffstat (limited to 'tools/power')
-rw-r--r--tools/power/acpi/os_specific/service_layers/osunixxf.c13
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,
}
#ifdef __APPLE__
{
- char *semaphore_name = tmpnam(NULL);
+ static int semaphore_count = 0;
+ char semaphore_name[32];
+ snprintf(semaphore_name, sizeof(semaphore_name), "acpi_sem_%d",
+ semaphore_count++);
+ printf("%s\n", semaphore_name);
sem =
sem_open(semaphore_name, O_EXCL | O_CREAT, 0755,
initial_units);
@@ -692,10 +696,15 @@ acpi_status acpi_os_delete_semaphore(acpi_handle handle)
if (!sem) {
return (AE_BAD_PARAMETER);
}
-
+#ifdef __APPLE__
+ if (sem_close(sem) == -1) {
+ return (AE_BAD_PARAMETER);
+ }
+#else
if (sem_destroy(sem) == -1) {
return (AE_BAD_PARAMETER);
}
+#endif
return (AE_OK);
}