From 6feb7c02002cb3a3083b4bb7ca8f695ba2f5d588 Mon Sep 17 00:00:00 2001 From: Kenneth Skovhede Date: Fri, 1 Mar 2024 14:30:28 +0100 Subject: [PATCH] Smaller fixes to build --- Duplicati/Library/Utility/CallContextSettings.cs | 8 ++++---- Duplicati/Server/SingleInstance.cs | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Duplicati/Library/Utility/CallContextSettings.cs b/Duplicati/Library/Utility/CallContextSettings.cs index 6165c259a..eb522aa1a 100644 --- a/Duplicati/Library/Utility/CallContextSettings.cs +++ b/Duplicati/Library/Utility/CallContextSettings.cs @@ -23,10 +23,10 @@ using System; using System.Collections.Generic; using System.Linq; using System.Net.Security; -using System.Runtime.Remoting.Messaging; using System.Security.Cryptography.X509Certificates; using Duplicati.Library.Interface; +using Duplicati.Library.Logging; namespace Duplicati.Library.Utility { @@ -322,7 +322,7 @@ namespace Duplicati.Library.Utility public ContextGuard() { - CallContext.LogicalSetData(contextSettingsType, ID); + CallContext.SetData(contextSettingsType, ID); } /// @@ -344,7 +344,7 @@ namespace Duplicati.Library.Utility _settings.Remove(ID); } - CallContext.LogicalSetData(contextSettingsType, null); + CallContext.SetData(contextSettingsType, null); } } @@ -356,7 +356,7 @@ namespace Duplicati.Library.Utility { get { - return contextSettingsType != null ? CallContext.LogicalGetData(contextSettingsType) as string : null; + return contextSettingsType != null ? CallContext.GetData(contextSettingsType) as string : null; } } } diff --git a/Duplicati/Server/SingleInstance.cs b/Duplicati/Server/SingleInstance.cs index a6d0ed13b..156bea027 100644 --- a/Duplicati/Server/SingleInstance.cs +++ b/Duplicati/Server/SingleInstance.cs @@ -144,7 +144,7 @@ namespace Duplicati.Server try { if (Platform.IsClientPosix) - temp_fs = UnixSupport.File.OpenExclusive(m_lockfilename, System.IO.FileAccess.Write); + temp_fs = PosixFile.OpenExclusive(m_lockfilename, System.IO.FileAccess.Write); else temp_fs = System.IO.File.Open(m_lockfilename, System.IO.FileMode.Create, System.IO.FileAccess.Write, System.IO.FileShare.None); @@ -199,7 +199,7 @@ namespace Duplicati.Server //Write out the commandline arguments string[] cmdargs = System.Environment.GetCommandLineArgs(); - using (System.IO.StreamWriter sw = new System.IO.StreamWriter(Platform.IsClientPosix ? UnixSupport.File.OpenExclusive(filename, System.IO.FileAccess.Write) : new System.IO.FileStream(filename, System.IO.FileMode.CreateNew, System.IO.FileAccess.Write, System.IO.FileShare.None))) + using (System.IO.StreamWriter sw = new System.IO.StreamWriter(Platform.IsClientPosix ? PosixFile.OpenExclusive(filename, System.IO.FileAccess.Write) : new System.IO.FileStream(filename, System.IO.FileMode.CreateNew, System.IO.FileAccess.Write, System.IO.FileShare.None))) for (int i = 1; i < cmdargs.Length; i++) //Skip the first, as that is the filename sw.WriteLine(cmdargs[i]); @@ -252,7 +252,7 @@ namespace Duplicati.Server return; List args = new List(); - using (System.IO.StreamReader sr = new System.IO.StreamReader(Platform.IsClientPosix ? UnixSupport.File.OpenExclusive(e.FullPath, System.IO.FileAccess.ReadWrite) : new System.IO.FileStream(e.FullPath, System.IO.FileMode.Open, System.IO.FileAccess.Read, System.IO.FileShare.None))) + using (System.IO.StreamReader sr = new System.IO.StreamReader(Platform.IsClientPosix ? PosixFile.OpenExclusive(e.FullPath, System.IO.FileAccess.ReadWrite) : new System.IO.FileStream(e.FullPath, System.IO.FileMode.Open, System.IO.FileAccess.Read, System.IO.FileShare.None))) { while (!sr.EndOfStream) {