Smaller fixes to build

This commit is contained in:
Kenneth Skovhede
2024-03-01 14:30:28 +01:00
parent f395da68d7
commit 6feb7c0200
2 changed files with 7 additions and 7 deletions
@@ -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);
}
/// <summary>
@@ -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;
}
}
}
+3 -3
View File
@@ -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<string> args = new List<string>();
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)
{