Mono.Posix to Mono.Unix and Mono.Unix.Native
This commit is contained in:
		| @@ -1,7 +1,7 @@ | |||||||
| using System; | using System; | ||||||
| using System.Net; | using System.Net; | ||||||
| using System.Net.Sockets; | using System.Net.Sockets; | ||||||
| using Mono.Unix; | using Mono.Unix.Native; | ||||||
| using System.IO; | using System.IO; | ||||||
| using System.Text; | using System.Text; | ||||||
| using System.Threading; | using System.Threading; | ||||||
| @@ -20,7 +20,7 @@ namespace sscs.communication | |||||||
|         private Socket listeningSocket; |         private Socket listeningSocket; | ||||||
|         private Socket connectedSocket; |         private Socket connectedSocket; | ||||||
|         private string socketFileName = "/tmp/.novellCASA"; |         private string socketFileName = "/tmp/.novellCASA"; | ||||||
|         private EndPoint sockEndPoint; |         private Mono.Unix.UnixEndPoint sockEndPoint; | ||||||
|         private ManualResetEvent eventVar = null; |         private ManualResetEvent eventVar = null; | ||||||
|  |  | ||||||
|  |  | ||||||
| @@ -34,7 +34,7 @@ namespace sscs.communication | |||||||
|             listeningSocket = new Socket( AddressFamily.Unix, |             listeningSocket = new Socket( AddressFamily.Unix, | ||||||
|                                           SocketType.Stream, |                                           SocketType.Stream, | ||||||
|                                           ProtocolType.IP ); |                                           ProtocolType.IP ); | ||||||
|             sockEndPoint = new UnixEndPoint(socketFileName); |             sockEndPoint = new Mono.Unix.UnixEndPoint(socketFileName); | ||||||
|             eventVar = new ManualResetEvent(true); |             eventVar = new ManualResetEvent(true); | ||||||
|  |  | ||||||
|         } |         } | ||||||
|   | |||||||
| @@ -1,7 +1,7 @@ | |||||||
| using System; | using System; | ||||||
| using System.Net; | using System.Net; | ||||||
| using System.Net.Sockets; | using System.Net.Sockets; | ||||||
| using Mono.Posix; | using Mono.Unix; | ||||||
| using System.IO; | using System.IO; | ||||||
| using System.Text; | using System.Text; | ||||||
| using sscs.common; | using sscs.common; | ||||||
|   | |||||||
| @@ -23,7 +23,7 @@ class SecretStoreClientService | |||||||
|             if(!AcquireLock()) |             if(!AcquireLock()) | ||||||
|             { |             { | ||||||
|                 Console.WriteLine("Another instance of micasad is already running"); |                 Console.WriteLine("Another instance of micasad is already running"); | ||||||
|                 Mono.Unix.Syscall.exit(-1); |                 Mono.Unix.Native.Syscall.exit(-1); | ||||||
|             } |             } | ||||||
|  |  | ||||||
|             RegisterSignals(); |             RegisterSignals(); | ||||||
| @@ -102,11 +102,11 @@ class SecretStoreClientService | |||||||
|         if(( (int)Environment.OSVersion.Platform) == 128) |         if(( (int)Environment.OSVersion.Platform) == 128) | ||||||
|         { |         { | ||||||
|             //SIGTERM |             //SIGTERM | ||||||
|             Mono.Unix.Stdlib.signal(Mono.Unix.Signum.SIGTERM, new Mono.Unix.SignalHandler(Terminate)); |             Mono.Unix.Native.Stdlib.signal(Mono.Unix.Native.Signum.SIGTERM, new Mono.Unix.Native.SignalHandler(Terminate)); | ||||||
|             //SIGINT |             //SIGINT | ||||||
|             Mono.Unix.Stdlib.signal(Mono.Unix.Signum.SIGINT, new Mono.Unix.SignalHandler(Terminate)); |             Mono.Unix.Native.Stdlib.signal(Mono.Unix.Native.Signum.SIGINT, new Mono.Unix.Native.SignalHandler(Terminate)); | ||||||
|             //SIGHUP |             //SIGHUP | ||||||
|             Mono.Unix.Stdlib.signal(Mono.Unix.Signum.SIGHUP, new Mono.Unix.SignalHandler(Terminate)); |             Mono.Unix.Native.Stdlib.signal(Mono.Unix.Native.Signum.SIGHUP, new Mono.Unix.Native.SignalHandler(Terminate)); | ||||||
|         } |         } | ||||||
|  |  | ||||||
|     } |     } | ||||||
| @@ -131,12 +131,12 @@ class SecretStoreClientService | |||||||
|             { |             { | ||||||
|                 File.Delete(ConstStrings.SSCS_LINUX_PIDFILE); |                 File.Delete(ConstStrings.SSCS_LINUX_PIDFILE); | ||||||
|             } |             } | ||||||
|             Mono.Unix.Syscall.exit(0); |             Mono.Unix.Native.Syscall.exit(0); | ||||||
|         } |         } | ||||||
|     } |     } | ||||||
|     private static void CreatePidFile() |     private static void CreatePidFile() | ||||||
|     { |     { | ||||||
|         int pid = Mono.Unix.Syscall.getpid(); |         int pid = Mono.Unix.Native.Syscall.getpid(); | ||||||
|         string pidStr = String.Format("{0}",pid); |         string pidStr = String.Format("{0}",pid); | ||||||
|  |  | ||||||
|         FileInfo fInfo = new FileInfo(ConstStrings.SSCS_LINUX_PIDFILE); |         FileInfo fInfo = new FileInfo(ConstStrings.SSCS_LINUX_PIDFILE); | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user