From ee0e2aaecc7a333ae7ef834657296e2dd247fba4 Mon Sep 17 00:00:00 2001 From: David Justo Date: Thu, 14 Jan 2021 13:30:48 -0800 Subject: [PATCH] Replace the impl of Syscall.rename and remove Mono.Posix.NETStandard (#1641) Co-authored-by: Tatsuro Shibamura --- .../LinuxAppServiceFileLogger.cs | 12 +++++++----- .../WebJobs.Extensions.DurableTask.csproj | 1 - 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/WebJobs.Extensions.DurableTask/LinuxAppServiceFileLogger.cs b/src/WebJobs.Extensions.DurableTask/LinuxAppServiceFileLogger.cs index d7b78f890..555081fc0 100644 --- a/src/WebJobs.Extensions.DurableTask/LinuxAppServiceFileLogger.cs +++ b/src/WebJobs.Extensions.DurableTask/LinuxAppServiceFileLogger.cs @@ -6,13 +6,10 @@ using System.Collections.Generic; using System.IO; using System.Linq; +using System.Runtime.InteropServices; using System.Threading; using System.Threading.Tasks; -#if !FUNCTIONS_V1 -using Mono.Unix.Native; -#endif - namespace Microsoft.Azure.WebJobs.Extensions.DurableTask { /// @@ -173,9 +170,14 @@ private void RollFiles() // Rename current file to older file. #if !FUNCTIONS_V1 - Syscall.rename(this.logFilePath, this.archiveFilePath); + rename(this.logFilePath, this.archiveFilePath); #endif } + +#if !FUNCTIONS_V1 + [DllImport("libc", SetLastError = true)] + private static extern int rename(string oldPath, string newPath); +#endif } } diff --git a/src/WebJobs.Extensions.DurableTask/WebJobs.Extensions.DurableTask.csproj b/src/WebJobs.Extensions.DurableTask/WebJobs.Extensions.DurableTask.csproj index bb9d544da..91f6aac88 100644 --- a/src/WebJobs.Extensions.DurableTask/WebJobs.Extensions.DurableTask.csproj +++ b/src/WebJobs.Extensions.DurableTask/WebJobs.Extensions.DurableTask.csproj @@ -70,7 +70,6 @@ -