Skip to content

Commit

Permalink
Replace the impl of Syscall.rename and remove Mono.Posix.NETStandard (#…
Browse files Browse the repository at this point in the history
…1641)

Co-authored-by: Tatsuro Shibamura <me@shibayan.jp>
  • Loading branch information
davidmrdavid and shibayan authored Jan 14, 2021
1 parent 88033ae commit ee0e2aa
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
12 changes: 7 additions & 5 deletions src/WebJobs.Extensions.DurableTask/LinuxAppServiceFileLogger.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
/// <summary>
Expand Down Expand Up @@ -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
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@
<PackageReference Include="Microsoft.Extensions.Http" Version="2.2.0" />
<PackageReference Include="Microsoft.ApplicationInsights" Version="2.12.2" />
<PackageReference Include="Microsoft.ApplicationInsights.DependencyCollector" Version="2.12.2" />
<PackageReference Include="Mono.Posix.NETStandard" Version="1.0.0" />
</ItemGroup>

<ItemGroup>
Expand Down

0 comments on commit ee0e2aa

Please sign in to comment.