Convert to Mono.Unix, and add the BEAGLE_THERE_BE_NO_QUITTIN env var, which when set, disables our SIGQUIT handler. Index: BeagleClient/Indexable.cs =================================================================== RCS file: /cvs/gnome/beagle/BeagleClient/Indexable.cs,v retrieving revision 1.38 diff -u -B -p -r1.38 Indexable.cs --- BeagleClient/Indexable.cs 10 Oct 2005 21:02:19 -0000 1.38 +++ BeagleClient/Indexable.cs 24 Oct 2005 22:59:41 -0000 @@ -500,7 +500,7 @@ namespace Beagle { // Make sure the temporary file is only readable by the owner. // FIXME: There is probably a race here. Could some malicious program // do something to the file between creation and the chmod? - Mono.Posix.Syscall.chmod (filename, (Mono.Posix.FileMode) 256); + Mono.Unix.Syscall.chmod (filename, (Mono.Unix.FilePermissions) 256); BufferedStream bufferedStream = new BufferedStream (fileStream); StreamWriter writer = new StreamWriter (bufferedStream); @@ -536,7 +536,7 @@ namespace Beagle { // Make sure the temporary file is only readable by the owner. // FIXME: There is probably a race here. Could some malicious program // do something to the file between creation and the chmod? - Mono.Posix.Syscall.chmod (filename, (Mono.Posix.FileMode) 256); + Mono.Unix.Syscall.chmod (filename, (Mono.Unix.FilePermissions) 256); BufferedStream bufferedStream = new BufferedStream (fileStream); Index: Best/Best.cs =================================================================== RCS file: /cvs/gnome/beagle/Best/Best.cs,v retrieving revision 1.25 diff -u -B -p -r1.25 Best.cs --- Best/Best.cs 22 Aug 2005 21:56:47 -0000 1.25 +++ Best/Best.cs 24 Oct 2005 22:59:41 -0000 @@ -13,7 +13,7 @@ using Gtk; using GtkSharp; using Gnome; -using Mono.Posix; +using Mono.Unix; using Beagle; using Beagle.Util; Index: Best/BestTray.cs =================================================================== RCS file: /cvs/gnome/beagle/Best/BestTray.cs,v retrieving revision 1.25 diff -u -B -p -r1.25 BestTray.cs --- Best/BestTray.cs 17 Oct 2005 21:27:49 -0000 1.25 +++ Best/BestTray.cs 24 Oct 2005 22:59:42 -0000 @@ -13,7 +13,7 @@ using System.Runtime.InteropServices; using Gtk; using Gdk; -using Mono.Posix; +using Mono.Unix; using Beagle; using Beagle.Tile; Index: Best/BestWindow.cs =================================================================== RCS file: /cvs/gnome/beagle/Best/BestWindow.cs,v retrieving revision 1.82 diff -u -B -p -r1.82 BestWindow.cs --- Best/BestWindow.cs 24 Oct 2005 22:15:11 -0000 1.82 +++ Best/BestWindow.cs 24 Oct 2005 22:59:42 -0000 @@ -32,7 +32,7 @@ using Gnome; using Gtk; using GD=Gdk; -using Mono.Posix; +using Mono.Unix; using Beagle; using Beagle.Util; Index: Filters/FilterMail.cs =================================================================== RCS file: /cvs/gnome/beagle/Filters/FilterMail.cs,v retrieving revision 1.4 diff -u -B -p -r1.4 FilterMail.cs --- Filters/FilterMail.cs 29 Aug 2005 05:34:02 -0000 1.4 +++ Filters/FilterMail.cs 24 Oct 2005 22:59:42 -0000 @@ -29,8 +29,6 @@ using System; using System.Collections; using System.IO; -using Mono.Posix; - using GMime; using Beagle; @@ -64,7 +62,7 @@ namespace Beagle.Filters { } } - int mail_fd = Syscall.open (info.FullName, OpenFlags.O_RDONLY); + int mail_fd = Mono.Unix.Syscall.open (info.FullName, Mono.Unix.OpenFlags.O_RDONLY); if (mail_fd == -1) throw new IOException (String.Format ("Unable to read {0} for parsing mail", info.FullName)); Index: ImLogViewer/ImLogViewer.cs =================================================================== RCS file: /cvs/gnome/beagle/ImLogViewer/ImLogViewer.cs,v retrieving revision 1.27 diff -u -B -p -r1.27 ImLogViewer.cs --- ImLogViewer/ImLogViewer.cs 24 Oct 2005 20:16:58 -0000 1.27 +++ ImLogViewer/ImLogViewer.cs 24 Oct 2005 22:59:42 -0000 @@ -26,7 +26,7 @@ // using System; -using Mono.Posix; +using Mono.Unix; using Beagle.Util; namespace ImLogViewer { Index: ImLogViewer/ImLogWindow.cs =================================================================== RCS file: /cvs/gnome/beagle/ImLogViewer/ImLogWindow.cs,v retrieving revision 1.7 diff -u -B -p -r1.7 ImLogWindow.cs --- ImLogViewer/ImLogWindow.cs 24 Oct 2005 20:16:58 -0000 1.7 +++ ImLogViewer/ImLogWindow.cs 24 Oct 2005 22:59:42 -0000 @@ -32,7 +32,7 @@ using Gtk; using Glade; using System.Threading; using Beagle.Util; -using Mono.Posix; +using Mono.Unix; namespace ImLogViewer { Index: Tiles/Template.cs =================================================================== RCS file: /cvs/gnome/beagle/Tiles/Template.cs,v retrieving revision 1.17 diff -u -B -p -r1.17 Template.cs --- Tiles/Template.cs 18 Aug 2005 21:13:25 -0000 1.17 +++ Tiles/Template.cs 24 Oct 2005 22:59:43 -0000 @@ -160,7 +160,7 @@ namespace Beagle.Tile { return (string)values[subkey]; } case "text" : - return Mono.Posix.Catalog.GetString (subkey); // I18N + return Mono.Unix.Catalog.GetString (subkey); // I18N default : if (values.Contains (key)) return BU.StringFu.EscapeStringForHtml ((string)values[subkey], false); Index: Tiles/TileDocs.cs =================================================================== RCS file: /cvs/gnome/beagle/Tiles/TileDocs.cs,v retrieving revision 1.10 diff -u -B -p -r1.10 TileDocs.cs --- Tiles/TileDocs.cs 8 Jun 2005 18:52:09 -0000 1.10 +++ Tiles/TileDocs.cs 24 Oct 2005 22:59:43 -0000 @@ -29,7 +29,7 @@ using System.Diagnostics; using System.IO; using System.Text; -using Mono.Posix; +using Mono.Unix; using BU = Beagle.Util; Index: Tiles/TileFolder.cs =================================================================== RCS file: /cvs/gnome/beagle/Tiles/TileFolder.cs,v retrieving revision 1.18 diff -u -B -p -r1.18 TileFolder.cs --- Tiles/TileFolder.cs 18 Jul 2005 20:16:49 -0000 1.18 +++ Tiles/TileFolder.cs 24 Oct 2005 22:59:43 -0000 @@ -29,7 +29,7 @@ using System.Diagnostics; using System.IO; using BU = Beagle.Util; -using Mono.Posix; +using Mono.Unix; namespace Beagle.Tile { Index: Tiles/TileImLog.cs =================================================================== RCS file: /cvs/gnome/beagle/Tiles/TileImLog.cs,v retrieving revision 1.42 diff -u -B -p -r1.42 TileImLog.cs --- Tiles/TileImLog.cs 24 Oct 2005 20:16:58 -0000 1.42 +++ Tiles/TileImLog.cs 24 Oct 2005 22:59:43 -0000 @@ -30,7 +30,7 @@ using System.Collections; using System.Diagnostics; using Beagle.Util; -using Mono.Posix; +using Mono.Unix; namespace Beagle.Tile { Index: Tiles/TileMailMessage.cs =================================================================== RCS file: /cvs/gnome/beagle/Tiles/TileMailMessage.cs,v retrieving revision 1.40 diff -u -B -p -r1.40 TileMailMessage.cs --- Tiles/TileMailMessage.cs 11 Oct 2005 00:20:29 -0000 1.40 +++ Tiles/TileMailMessage.cs 24 Oct 2005 22:59:43 -0000 @@ -31,7 +31,7 @@ using System.Text; using System.Text.RegularExpressions; using BU = Beagle.Util; using GMime; -using Mono.Posix; +using Mono.Unix; namespace Beagle.Tile { Index: Tiles/TileSpreadsheet.cs =================================================================== RCS file: /cvs/gnome/beagle/Tiles/TileSpreadsheet.cs,v retrieving revision 1.2 diff -u -B -p -r1.2 TileSpreadsheet.cs --- Tiles/TileSpreadsheet.cs 14 Apr 2005 12:45:36 -0000 1.2 +++ Tiles/TileSpreadsheet.cs 24 Oct 2005 22:59:43 -0000 @@ -29,7 +29,7 @@ using System.Diagnostics; using System.IO; using System.Text; -using Mono.Posix; +using Mono.Unix; using BU = Beagle.Util; Index: Tiles/TranslationHack.cs =================================================================== RCS file: /cvs/gnome/beagle/Tiles/TranslationHack.cs,v retrieving revision 1.3 diff -u -B -p -r1.3 TranslationHack.cs --- Tiles/TranslationHack.cs 11 Jul 2005 19:14:48 -0000 1.3 +++ Tiles/TranslationHack.cs 24 Oct 2005 22:59:43 -0000 @@ -1,4 +1,4 @@ -using Mono.Posix; +using Mono.Unix; public class TranslationHack { private void NotToBecalled () { Index: Tiles/extract-translations.pl =================================================================== RCS file: /cvs/gnome/beagle/Tiles/extract-translations.pl,v retrieving revision 1.1 diff -u -B -p -r1.1 extract-translations.pl --- Tiles/extract-translations.pl 5 Apr 2005 19:54:16 -0000 1.1 +++ Tiles/extract-translations.pl 24 Oct 2005 22:59:43 -0000 @@ -6,7 +6,7 @@ closedir(DIR); open (OUTPUT, ">TranslationHack.cs"); -print OUTPUT "using Mono.Posix;\n\npublic class TranslationHack {\n\tprivate void NotToBecalled () {\n"; +print OUTPUT "using Mono.Unix;\n\npublic class TranslationHack {\n\tprivate void NotToBecalled () {\n"; foreach $file (@files) { open (TEMPLATE, $file); Index: Util/Evolution.cs =================================================================== RCS file: /cvs/gnome/beagle/Util/Evolution.cs,v retrieving revision 1.5 diff -u -B -p -r1.5 Evolution.cs --- Util/Evolution.cs 10 Aug 2005 18:08:58 -0000 1.5 +++ Util/Evolution.cs 24 Oct 2005 22:59:43 -0000 @@ -29,7 +29,7 @@ using System; using System.IO; using System.Collections; -using Mono.Posix; +using Mono.Unix; namespace Beagle.Util { // FIXME: IMAP4 Index: Util/ExifData.cs =================================================================== RCS file: /cvs/gnome/beagle/Util/ExifData.cs,v retrieving revision 1.3 diff -u -B -p -r1.3 ExifData.cs --- Util/ExifData.cs 1 Apr 2005 18:05:29 -0000 1.3 +++ Util/ExifData.cs 24 Oct 2005 22:59:44 -0000 @@ -223,17 +223,17 @@ namespace Beagle.Util { { switch (ifd) { case ExifIfd.Zero: - return Mono.Posix.Catalog.GetString ("Image Directory"); + return Mono.Unix.Catalog.GetString ("Image Directory"); case ExifIfd.One: - return Mono.Posix.Catalog.GetString ("Thumbnail Directory"); + return Mono.Unix.Catalog.GetString ("Thumbnail Directory"); case ExifIfd.Exif: - return Mono.Posix.Catalog.GetString ("Exif Directory"); + return Mono.Unix.Catalog.GetString ("Exif Directory"); case ExifIfd.Gps: - return Mono.Posix.Catalog.GetString ("GPS Directory"); + return Mono.Unix.Catalog.GetString ("GPS Directory"); case ExifIfd.InterOperability: - return Mono.Posix.Catalog.GetString ("InterOperability Directory"); + return Mono.Unix.Catalog.GetString ("InterOperability Directory"); default: - return Mono.Posix.Catalog.GetString ("Unknown Directory"); + return Mono.Unix.Catalog.GetString ("Unknown Directory"); } } Index: Util/ExtendedAttribute.cs =================================================================== RCS file: /cvs/gnome/beagle/Util/ExtendedAttribute.cs,v retrieving revision 1.19 diff -u -B -p -r1.19 ExtendedAttribute.cs --- Util/ExtendedAttribute.cs 20 Aug 2005 19:45:50 -0000 1.19 +++ Util/ExtendedAttribute.cs 24 Oct 2005 22:59:44 -0000 @@ -30,16 +30,13 @@ using System; using System.IO; using System.Text; using System.Runtime.InteropServices; -using Mono.Posix; namespace Beagle.Util { public class ExtendedAttribute { - // FIXME: Once Mono 1.1/1.2 is required, we should start using the - // xattr bindings which are now present in the Mono.Unix.Syscall class. - // The interface provided via Syscall in future Mono versions will support both - // Linux/FreeBSD attributes transparently. + // FIXME: When Mono 1.1.9 is required, start using the Mono.Unix.Syscall + // xattr bindings. // Linux xattrs [DllImport (ExternalStringsHack.XattrLib, SetLastError=true)] @@ -88,7 +85,7 @@ namespace Beagle.Util { int retval = extattr_set_link (path, 1, name, buffer, (uint) buffer.Length); #endif if (retval == -1) - throw new IOException ("Could not set extended attribute on " + path + ": " + Syscall.strerror (Marshal.GetLastWin32Error ())); + throw new IOException ("Could not set extended attribute on " + path + ": " + Mono.Unix.Stdlib.strerror (Mono.Unix.Syscall.GetLastError ())); } public static bool Exists (string path, string name) @@ -130,7 +127,7 @@ namespace Beagle.Util { int retval = extattr_get_link (path, 1, name, buffer, (uint) size); #endif if (retval < 0) - throw new IOException ("Could not get extended attribute on " + path + ": " + Syscall.strerror (Marshal.GetLastWin32Error ())); + throw new IOException ("Could not get extended attribute on " + path + ": " + Mono.Unix.Stdlib.strerror (Mono.Unix.Syscall.GetLastError ())); return encoding.GetString (buffer); } @@ -148,7 +145,7 @@ namespace Beagle.Util { int retval = extattr_delete_link (path, 1, name); #endif if (retval != 0) - throw new IOException ("Could not remove extended attribute on " + path + ": " + Syscall.strerror (Marshal.GetLastWin32Error ())); + throw new IOException ("Could not remove extended attribute on " + path + ": " + Mono.Unix.Stdlib.strerror (Mono.Unix.Syscall.GetLastError ())); } // Check to see if it is possible to get and set attributes on a given file. Index: Util/FileAdvise.cs =================================================================== RCS file: /cvs/gnome/beagle/Util/FileAdvise.cs,v retrieving revision 1.6 diff -u -B -p -r1.6 FileAdvise.cs --- Util/FileAdvise.cs 18 Oct 2005 15:37:37 -0000 1.6 +++ Util/FileAdvise.cs 24 Oct 2005 22:59:50 -0000 @@ -30,7 +30,6 @@ using System; using System.IO; using System.Text; using System.Runtime.InteropServices; -using Mono.Posix; using Beagle.Util; @@ -95,7 +94,7 @@ namespace Beagle.Util { FileAccess.Read); int ret = GiveAdvice (file, AdviseNormal); if (ret != 0) - Log.Error ("FileAdvise failed: {0}", Syscall.strerror (Marshal.GetLastWin32Error())); + Log.Error ("FileAdvise failed: {0}", Mono.Unix.Stdlib.strerror (Mono.Unix.Syscall.GetLastError())); file.Close (); } catch { } } Index: Util/FileSystem.cs =================================================================== RCS file: /cvs/gnome/beagle/Util/FileSystem.cs,v retrieving revision 1.2 diff -u -B -p -r1.2 FileSystem.cs --- Util/FileSystem.cs 12 Oct 2004 01:19:25 -0000 1.2 +++ Util/FileSystem.cs 24 Oct 2005 22:59:50 -0000 @@ -27,8 +27,6 @@ using System; using System.IO; -using Mono.Posix; - namespace Beagle.Util { public class FileSystem { @@ -58,10 +56,9 @@ namespace Beagle.Util { // I guess this is as good a place for this as any. static public bool IsSymLink (string path) { - Stat stat = new Stat (); - Syscall.lstat (path, out stat); - int mode = (int) stat.Mode & (int)StatModeMasks.TypeMask; - return mode == (int) StatMode.SymLink; + Mono.Unix.Stat stat; + Mono.Unix.Syscall.lstat (path, out stat); + return (stat.st_mode & Mono.Unix.FilePermissions.S_IFLNK) == Mono.Unix.FilePermissions.S_IFLNK; } } Index: Util/Inotify.cs =================================================================== RCS file: /cvs/gnome/beagle/Util/Inotify.cs,v retrieving revision 1.56 diff -u -B -p -r1.56 Inotify.cs --- Util/Inotify.cs 17 Oct 2005 19:24:00 -0000 1.56 +++ Util/Inotify.cs 24 Oct 2005 22:59:50 -0000 @@ -34,8 +34,6 @@ using System.Text; using System.Text.RegularExpressions; using System.Threading; -using Mono.Posix; - namespace Beagle.Util { public class Inotify { Index: Util/KdeUtils.cs =================================================================== RCS file: /cvs/gnome/beagle/Util/KdeUtils.cs,v retrieving revision 1.3 diff -u -B -p -r1.3 KdeUtils.cs --- Util/KdeUtils.cs 24 May 2005 18:46:24 -0000 1.3 +++ Util/KdeUtils.cs 24 Oct 2005 22:59:50 -0000 @@ -27,7 +27,7 @@ using System; using System.Diagnostics; using System.IO; -using Mono.Posix; +using System.Text; namespace Beagle.Util { public class KdeUtils { @@ -64,7 +64,9 @@ namespace Beagle.Util { // We handle the situations if either (or both) of these aren't present, or // if default.kde == hicolor. - string icon_theme_default = Syscall.readlink (Path.Combine (icon_prefix, "default.kde")); + StringBuilder icon_theme_default_sb = new StringBuilder (); + Mono.Unix.Syscall.readlink (Path.Combine (icon_prefix, "default.kde"), icon_theme_default_sb); + string icon_theme_default = icon_theme_default_sb.ToString (); if (icon_theme_default != null) { if (! icon_theme_default.StartsWith ("/")) icon_theme_default = Path.Combine (icon_prefix, icon_theme_default); Index: Util/Log.cs =================================================================== RCS file: /cvs/gnome/beagle/Util/Log.cs,v retrieving revision 1.1 diff -u -B -p -r1.1 Log.cs --- Util/Log.cs 18 Oct 2005 18:05:30 -0000 1.1 +++ Util/Log.cs 24 Oct 2005 22:59:50 -0000 @@ -151,7 +151,7 @@ namespace Beagle.Util { string log_link; log_link = Path.Combine (log_directory, "current-" + name); - Mono.Posix.Syscall.symlink (log_path, log_link); + Mono.Unix.Syscall.symlink (log_path, log_link); return writer; } Index: Util/PathFinder.cs =================================================================== RCS file: /cvs/gnome/beagle/Util/PathFinder.cs,v retrieving revision 1.9 diff -u -B -p -r1.9 PathFinder.cs --- Util/PathFinder.cs 12 Aug 2005 17:14:03 -0000 1.9 +++ Util/PathFinder.cs 24 Oct 2005 22:59:50 -0000 @@ -106,7 +106,7 @@ namespace Beagle.Util { Directory.CreateDirectory (storage_dir); // Make sure that the directory is only // readable by the owner. - Mono.Posix.Syscall.chmod (storage_dir, (Mono.Posix.FileMode) 448); // 448 == 0700 + Mono.Unix.Syscall.chmod (storage_dir, (Mono.Unix.FilePermissions) 448); // 448 == 0700 } } } @@ -152,7 +152,7 @@ namespace Beagle.Util { Directory.CreateDirectory (remote_storage_dir); // Make sure that the directory is only // readable by the owner. - Mono.Posix.Syscall.chmod (remote_storage_dir, (Mono.Posix.FileMode) 448); // 448 == 0700 + Mono.Unix.Syscall.chmod (remote_storage_dir, (Mono.Unix.FilePermissions) 448); // 448 == 0700 } } } else @@ -176,7 +176,7 @@ namespace Beagle.Util { // Make sure that the directory is only readable by the owner. // Required when using index synchronization as then it resides in /tmp - Mono.Posix.Syscall.chmod (index_dir, (Mono.Posix.FileMode) 448); // 448 == 0700 + Mono.Unix.Syscall.chmod (index_dir, (Mono.Unix.FilePermissions) 448); // 448 == 0700 } } Index: Util/StringFu.cs =================================================================== RCS file: /cvs/gnome/beagle/Util/StringFu.cs,v retrieving revision 1.34 diff -u -B -p -r1.34 StringFu.cs --- Util/StringFu.cs 21 Oct 2005 21:24:55 -0000 1.34 +++ Util/StringFu.cs 24 Oct 2005 22:59:50 -0000 @@ -31,7 +31,7 @@ using System.IO; using System.Text; using System.Xml; -using Mono.Posix; +using Mono.Unix; namespace Beagle.Util { Index: Util/SystemInformation.cs =================================================================== RCS file: /cvs/gnome/beagle/Util/SystemInformation.cs,v retrieving revision 1.16 diff -u -B -p -r1.16 SystemInformation.cs --- Util/SystemInformation.cs 5 Oct 2005 14:33:15 -0000 1.16 +++ Util/SystemInformation.cs 24 Oct 2005 22:59:50 -0000 @@ -31,7 +31,6 @@ using System.Globalization; using System.IO; using System.Runtime.InteropServices; using System.Text.RegularExpressions; -using Mono.Posix; namespace Beagle.Util { @@ -56,7 +55,7 @@ namespace Beagle.Util { int retval = getloadavg (loadavg, 3); if (retval == -1) - throw new IOException ("Could not get system load average: " + Syscall.strerror (Marshal.GetLastWin32Error ())); + throw new IOException ("Could not get system load average: " + Mono.Unix.Stdlib.strerror (Mono.Unix.Syscall.GetLastError ())); else if (retval != 3) throw new IOException ("Could not get system load average: getloadavg() returned an unexpected number of samples"); @@ -259,12 +258,12 @@ namespace Beagle.Util { // Get the (major,minor) pair for the block device from which the index is mounted. static private void GetIndexDev () { - Mono.Posix.Stat stat = new Mono.Posix.Stat (); - if (Mono.Posix.Syscall.stat (PathFinder.StorageDir, out stat) != 0) + Mono.Unix.Stat stat; + if (Mono.Unix.Syscall.stat (PathFinder.StorageDir, out stat) != 0) return; - major = (uint) stat.Device >> 8; - minor = (uint) stat.Device & 0xff; + major = (uint) stat.st_dev >> 8; + minor = (uint) stat.st_dev & 0xff; } static public int DiskStatsReadReqs { @@ -305,11 +304,11 @@ namespace Beagle.Util { static public bool IsPathOnBlockDevice (string path) { - Mono.Posix.Stat stat; - if (Mono.Posix.Syscall.stat (path, out stat) != 0) + Mono.Unix.Stat stat; + if (Mono.Unix.Syscall.stat (path, out stat) != 0) return false; - return (stat.Device >> 8 != 0); + return (stat.st_dev >> 8 != 0); } #if false Index: Util/UnixClient.cs =================================================================== RCS file: /cvs/gnome/beagle/Util/UnixClient.cs,v retrieving revision 1.5 diff -u -B -p -r1.5 UnixClient.cs --- Util/UnixClient.cs 27 Jul 2005 21:48:51 -0000 1.5 +++ Util/UnixClient.cs 24 Oct 2005 22:59:50 -0000 @@ -33,7 +33,7 @@ using System.Net; using System.Net.Sockets; using System.Runtime.InteropServices; -using Mono.Posix; +using Mono.Unix; namespace Beagle.Util { Index: Util/UnixListener.cs =================================================================== RCS file: /cvs/gnome/beagle/Util/UnixListener.cs,v retrieving revision 1.3 diff -u -B -p -r1.3 UnixListener.cs --- Util/UnixListener.cs 16 May 2005 16:05:48 -0000 1.3 +++ Util/UnixListener.cs 24 Oct 2005 22:59:50 -0000 @@ -33,7 +33,7 @@ using System.Net; using System.Net.Sockets; using System.IO; -using Mono.Posix; +using Mono.Unix; namespace Beagle.Util { Index: Util/XKeybinder.cs =================================================================== RCS file: /cvs/gnome/beagle/Util/XKeybinder.cs,v retrieving revision 1.4 diff -u -B -p -r1.4 XKeybinder.cs --- Util/XKeybinder.cs 5 Oct 2005 14:33:15 -0000 1.4 +++ Util/XKeybinder.cs 24 Oct 2005 22:59:50 -0000 @@ -2,7 +2,6 @@ using System; using System.Collections; using System.Runtime.InteropServices; -using Mono.Posix; namespace Beagle.Util { Index: beagled/BeagleDaemon.cs =================================================================== RCS file: /cvs/gnome/beagle/beagled/BeagleDaemon.cs,v retrieving revision 1.97 diff -u -B -p -r1.97 BeagleDaemon.cs --- beagled/BeagleDaemon.cs 19 Oct 2005 13:07:13 -0000 1.97 +++ beagled/BeagleDaemon.cs 24 Oct 2005 22:59:50 -0000 @@ -396,25 +396,16 @@ namespace Beagle.Daemon { ///////////////////////////////////////////////////////////////////////////// - // The integer values of the Mono.Posix.Signal enumeration don't actually - // match the Linux signal numbers of Linux. Oops! - // This is fixed in Mono.Unix, but for the moment we want to maintain - // compatibility with mono 1.0.x. - const int ACTUAL_LINUX_SIGINT = 2; - const int ACTUAL_LINUX_SIGQUIT = 3; - const int ACTUAL_LINUX_SIGTERM = 15; - static void SetupSignalHandlers () { // Force OurSignalHandler to be JITed OurSignalHandler (-1); // Set up our signal handler - Mono.Posix.Syscall.sighandler_t sig_handler; - sig_handler = new Mono.Posix.Syscall.sighandler_t (OurSignalHandler); - Mono.Posix.Syscall.signal (ACTUAL_LINUX_SIGINT, sig_handler); - Mono.Posix.Syscall.signal (ACTUAL_LINUX_SIGQUIT, sig_handler); - Mono.Posix.Syscall.signal (ACTUAL_LINUX_SIGTERM, sig_handler); + Mono.Unix.Stdlib.signal (Mono.Unix.Signum.SIGINT, OurSignalHandler); + Mono.Unix.Stdlib.signal (Mono.Unix.Signum.SIGTERM, OurSignalHandler); + if (Environment.GetEnvironmentVariable("BEAGLE_THERE_BE_NO_QUITTIN") == null) + Mono.Unix.Stdlib.signal (Mono.Unix.Signum.SIGQUIT, OurSignalHandler); } // Our handler triggers an orderly shutdown when it receives a signal. Index: beagled/BuildIndex.cs =================================================================== RCS file: /cvs/gnome/beagle/beagled/BuildIndex.cs,v retrieving revision 1.20 diff -u -B -p -r1.20 BuildIndex.cs --- beagled/BuildIndex.cs 8 Sep 2005 03:49:56 -0000 1.20 +++ beagled/BuildIndex.cs 24 Oct 2005 22:59:50 -0000 @@ -424,25 +424,16 @@ namespace Beagle.Daemon // From BeagleDaemon.cs - // The integer values of the Mono.Posix.Signal enumeration don't actually - // match the Linux signal numbers of Linux. Oops! - // This is fixed in Mono.Unix, but for the moment we want to maintain - // compatibility with mono 1.0.x. - const int ACTUAL_LINUX_SIGINT = 2; - const int ACTUAL_LINUX_SIGQUIT = 3; - const int ACTUAL_LINUX_SIGTERM = 15; - static void SetupSignalHandlers () { // Force OurSignalHandler to be JITed OurSignalHandler (-1); // Set up our signal handler - Mono.Posix.Syscall.sighandler_t sig_handler; - sig_handler = new Mono.Posix.Syscall.sighandler_t (OurSignalHandler); - Mono.Posix.Syscall.signal (ACTUAL_LINUX_SIGINT, sig_handler); - Mono.Posix.Syscall.signal (ACTUAL_LINUX_SIGQUIT, sig_handler); - Mono.Posix.Syscall.signal (ACTUAL_LINUX_SIGTERM, sig_handler); + Mono.Unix.Stdlib.signal (Mono.Unix.Signum.SIGINT, OurSignalHandler); + Mono.Unix.Stdlib.signal (Mono.Unix.Signum.SIGTERM, OurSignalHandler); + if (Environment.GetEnvironmentVariable("BEAGLE_THERE_BE_NO_QUITTIN") == null) + Mono.Unix.Stdlib.signal (Mono.Unix.Signum.SIGQUIT, OurSignalHandler); } static void OurSignalHandler (int signal) Index: beagled/Filter.cs =================================================================== RCS file: /cvs/gnome/beagle/beagled/Filter.cs,v retrieving revision 1.34 diff -u -B -p -r1.34 Filter.cs --- beagled/Filter.cs 2 Sep 2005 19:18:58 -0000 1.34 +++ beagled/Filter.cs 24 Oct 2005 22:59:51 -0000 @@ -373,7 +373,7 @@ namespace Beagle.Daemon { // Make sure the temporary file is only readable by the owner. // FIXME: There is probably a race here. Could some malicious program // do something to the file between creation and the chmod? - Mono.Posix.Syscall.chmod (tempFile, (Mono.Posix.FileMode) 256); + Mono.Unix.Syscall.chmod (tempFile, (Mono.Unix.FilePermissions) 256); BufferedStream buffered_stream = new BufferedStream (file_stream); StreamWriter writer = new StreamWriter (buffered_stream); @@ -407,7 +407,7 @@ namespace Beagle.Daemon { // Make sure the temporary file is only readable by the owner. // FIXME: There is probably a race here. Could some malicious program // do something to the file between creation and the chmod? - Mono.Posix.Syscall.chmod (tempFile, (Mono.Posix.FileMode) 256); + Mono.Unix.Syscall.chmod (tempFile, (Mono.Unix.FilePermissions) 256); BufferedStream buffered_stream = new BufferedStream (file_stream); Index: beagled/AkregatorQueryable/AkregatorQueryable.cs =================================================================== RCS file: /cvs/gnome/beagle/beagled/AkregatorQueryable/AkregatorQueryable.cs,v retrieving revision 1.4 diff -u -B -p -r1.4 AkregatorQueryable.cs --- beagled/AkregatorQueryable/AkregatorQueryable.cs 21 Oct 2005 01:23:56 -0000 1.4 +++ beagled/AkregatorQueryable/AkregatorQueryable.cs 24 Oct 2005 22:59:51 -0000 @@ -34,8 +34,6 @@ using System.Xml.Serialization; using Beagle.Daemon; using Beagle.Util; -using Mono.Posix; - namespace Beagle.Daemon.AkregatorQueryable { [QueryableFlavor (Name="Akregator", Domain=QueryDomain.Local, RequireInotify=false)] Index: beagled/EvolutionMailDriver/EvolutionMailIndexableGenerator.cs =================================================================== RCS file: /cvs/gnome/beagle/beagled/EvolutionMailDriver/EvolutionMailIndexableGenerator.cs,v retrieving revision 1.55 diff -u -B -p -r1.55 EvolutionMailIndexableGenerator.cs --- beagled/EvolutionMailDriver/EvolutionMailIndexableGenerator.cs 7 Sep 2005 19:59:43 -0000 1.55 +++ beagled/EvolutionMailDriver/EvolutionMailIndexableGenerator.cs 24 Oct 2005 22:59:51 -0000 @@ -36,7 +36,6 @@ using Beagle.Util; using Beagle.Daemon; using Camel = Beagle.Util.Camel; -using Mono.Posix; namespace Beagle.Daemon.EvolutionMailDriver { @@ -214,7 +213,7 @@ namespace Beagle.Daemon.EvolutionMailDri return false; } - this.mbox_fd = Syscall.open (this.mbox_info.FullName, OpenFlags.O_RDONLY); + this.mbox_fd = Mono.Unix.Syscall.open (this.mbox_info.FullName, Mono.Unix.OpenFlags.O_RDONLY); this.mbox_stream = new GMime.StreamFs (this.mbox_fd); this.mbox_stream.Seek ((int) this.MboxLastOffset); this.mbox_parser = new GMime.Parser (this.mbox_stream); Index: beagled/FileSystemQueryable/FileSystemQueryable.cs =================================================================== RCS file: /cvs/gnome/beagle/beagled/FileSystemQueryable/FileSystemQueryable.cs,v retrieving revision 1.87 diff -u -B -p -r1.87 FileSystemQueryable.cs --- beagled/FileSystemQueryable/FileSystemQueryable.cs 15 Sep 2005 21:43:41 -0000 1.87 +++ beagled/FileSystemQueryable/FileSystemQueryable.cs 24 Oct 2005 22:59:51 -0000 @@ -805,11 +805,9 @@ namespace Beagle.Daemon.FileSystemQuerya private RequiredAction DetermineRequiredAction (DirectoryModel dir, string name, FileAttributes attr, - out string last_known_path, - out DateTime mtime) + out string last_known_path) { last_known_path = null; - mtime = DateTime.MinValue; string path; path = Path.Combine (dir.FullName, name); @@ -850,17 +848,16 @@ namespace Beagle.Daemon.FileSystemQuerya } } - Mono.Posix.Stat stat; + Mono.Unix.Stat stat; try { - Mono.Posix.Syscall.stat (path, out stat); + Mono.Unix.Syscall.stat (path, out stat); } catch (Exception ex) { Logger.Log.Debug ("Caught exception stat-ing {0}", path); Logger.Log.Debug (ex); return RequiredAction.None; } - mtime = stat.MTime; - if (! DatesAreTheSame (attr.LastWriteTime, mtime)) { + if (! DatesAreTheSame (attr.LastWriteTime, stat.st_mtime)) { if (Debug) Logger.Log.Debug ("*** Index it: MTime has changed"); @@ -883,7 +880,7 @@ namespace Beagle.Daemon.FileSystemQuerya // If the inode ctime is different that the time we last // set file attributes, we might have been moved or copied. - if (! DatesAreTheSame (attr.LastAttrTime, stat.CTime)) { + if (! DatesAreTheSame (attr.LastAttrTime, stat.st_ctime)) { if (Debug) Logger.Log.Debug ("*** CTime has changed, checking last known path"); @@ -911,16 +908,10 @@ namespace Beagle.Daemon.FileSystemQuerya return RequiredAction.None; } - // This works around a mono bug: the DateTimes that we get out of stat - // don't correctly account for daylight savings time. We declare the two - // dates to be equal if: - // (1) They actually are equal - // (2) The first date is exactly one hour ahead of the second - static private bool DatesAreTheSame (DateTime system_io_datetime, DateTime stat_datetime) + static private bool DatesAreTheSame (DateTime system_io_datetime, long stat_datetime) { - const double epsilon = 1e-5; - double t = (system_io_datetime - stat_datetime).TotalSeconds; - return Math.Abs (t) < epsilon || Math.Abs (t-3600) < epsilon; + long system_epoch_time = Mono.Unix.UnixConvert.FromDateTime (system_io_datetime.ToUniversalTime ()); + return system_epoch_time == stat_datetime; } // Return an indexable that will do the right thing with a file @@ -935,8 +926,7 @@ namespace Beagle.Daemon.FileSystemQuerya RequiredAction action; string last_known_path; - DateTime mtime; - action = DetermineRequiredAction (dir, name, attr, out last_known_path, out mtime); + action = DetermineRequiredAction (dir, name, attr, out last_known_path); if (action == RequiredAction.None) return null; @@ -953,8 +943,6 @@ namespace Beagle.Daemon.FileSystemQuerya case RequiredAction.Index: indexable = FileToIndexable (path, unique_id, dir, true); - if (mtime == DateTime.MinValue) - mtime = File.GetLastWriteTime (path); break; case RequiredAction.Rename: Index: beagled/IndexHelper/IndexHelper.cs =================================================================== RCS file: /cvs/gnome/beagle/beagled/IndexHelper/IndexHelper.cs,v retrieving revision 1.19 diff -u -B -p -r1.19 IndexHelper.cs --- beagled/IndexHelper/IndexHelper.cs 18 Oct 2005 15:37:38 -0000 1.19 +++ beagled/IndexHelper/IndexHelper.cs 24 Oct 2005 22:59:51 -0000 @@ -31,8 +31,6 @@ using System.IO; using SNS = System.Net.Sockets; using System.Threading; -using Mono.Posix; - using Gtk; using Beagle.Daemon; @@ -172,7 +170,7 @@ namespace Beagle.IndexHelper { try { SNS.Socket socket; socket = new SNS.Socket (SNS.AddressFamily.Unix, SNS.SocketType.Stream, 0); - socket.Connect (new UnixEndPoint (socket_name)); + socket.Connect (new Mono.Unix.UnixEndPoint (socket_name)); ArrayList socket_list = new ArrayList (); @@ -194,25 +192,16 @@ namespace Beagle.IndexHelper { ///////////////////////////////////////////////////////////////////////////// - // The integer values of the Mono.Posix.Signal enumeration don't actually - // match the Linux signal numbers of Linux. Oops! - // This is fixed in Mono.Unix, but for the moment we want to maintain - // compatibility with mono 1.0.x. - const int ACTUAL_LINUX_SIGINT = 2; - const int ACTUAL_LINUX_SIGQUIT = 3; - const int ACTUAL_LINUX_SIGTERM = 15; - static void SetupSignalHandlers () { // Force OurSignalHandler to be JITed OurSignalHandler (-1); // Set up our signal handler - Mono.Posix.Syscall.sighandler_t sig_handler; - sig_handler = new Mono.Posix.Syscall.sighandler_t (OurSignalHandler); - Mono.Posix.Syscall.signal (ACTUAL_LINUX_SIGINT, sig_handler); - Mono.Posix.Syscall.signal (ACTUAL_LINUX_SIGQUIT, sig_handler); - Mono.Posix.Syscall.signal (ACTUAL_LINUX_SIGTERM, sig_handler); + Mono.Unix.Stdlib.signal (Mono.Unix.Signum.SIGINT, OurSignalHandler); + Mono.Unix.Stdlib.signal (Mono.Unix.Signum.SIGTERM, OurSignalHandler); + if (Environment.GetEnvironmentVariable("BEAGLE_THERE_BE_NO_QUITTIN") == null) + Mono.Unix.Stdlib.signal (Mono.Unix.Signum.SIGQUIT, OurSignalHandler); } // Our handler triggers an orderly shutdown when it receives a signal. Index: beagled/KMailQueryable/KMailIndexableGenerator.cs =================================================================== RCS file: /cvs/gnome/beagle/beagled/KMailQueryable/KMailIndexableGenerator.cs,v retrieving revision 1.1 diff -u -B -p -r1.1 KMailIndexableGenerator.cs --- beagled/KMailQueryable/KMailIndexableGenerator.cs 25 Sep 2005 23:19:29 -0000 1.1 +++ beagled/KMailQueryable/KMailIndexableGenerator.cs 24 Oct 2005 22:59:51 -0000 @@ -35,8 +35,6 @@ using System.Xml; using Beagle.Util; using Beagle.Daemon; -using Mono.Posix; - namespace Beagle.Daemon.KMailQueryable { /** @@ -218,7 +216,7 @@ namespace Beagle.Daemon.KMailQueryable { try { // POSIX rules! once we have the fd, nobody can delete the file... bwahahaha - mbox_fd = Syscall.open (mbox_file, OpenFlags.O_RDONLY); + mbox_fd = Mono.Unix.Syscall.open (mbox_file, Mono.Unix.OpenFlags.O_RDONLY); } catch (System.IO.FileNotFoundException e) { Logger.Log.Warn ("mbox " + mbox_file + " deleted while indexing."); return false; Index: beagled/KMailQueryable/KMailIndexer.cs =================================================================== RCS file: /cvs/gnome/beagle/beagled/KMailQueryable/KMailIndexer.cs,v retrieving revision 1.1 diff -u -B -p -r1.1 KMailIndexer.cs --- beagled/KMailQueryable/KMailIndexer.cs 25 Sep 2005 23:19:29 -0000 1.1 +++ beagled/KMailQueryable/KMailIndexer.cs 24 Oct 2005 22:59:51 -0000 @@ -32,8 +32,6 @@ using System.IO; using Beagle.Util; using Beagle.Daemon; -using Mono.Posix; - namespace Beagle.Daemon.KMailQueryable { /** Index: doc/I18N =================================================================== RCS file: /cvs/gnome/beagle/doc/I18N,v retrieving revision 1.1 diff -u -B -p -r1.1 I18N --- doc/I18N 4 Apr 2005 16:47:43 -0000 1.1 +++ doc/I18N 24 Oct 2005 22:59:51 -0000 @@ -5,7 +5,7 @@ Developers: I18N support is provided with the use of good old gettext/intltool and is very straight forward. In code (C#) you can fetch translated strings with -Mono.Posix.Catalog.GetString ("Text to be translated") and in the templates' +Mono.Unix.Catalog.GetString ("Text to be translated") and in the templates' HTML files with the new text macro, eg. simply writing @text%Text to be translated@. Translators: @@ -13,4 +13,4 @@ Translators: You can extract translatable strings from the source files listed in po/POTFILES.in with standard xgettext with the C# language mode. Translatable strings are also found in the Tiles/template-*.html files with prefix "@text%" -and suffix "@". \ No newline at end of file +and suffix "@". Index: tools/Settings.cs =================================================================== RCS file: /cvs/gnome/beagle/tools/Settings.cs,v retrieving revision 1.9 diff -u -B -p -r1.9 Settings.cs --- tools/Settings.cs 12 Aug 2005 14:32:19 -0000 1.9 +++ tools/Settings.cs 24 Oct 2005 22:59:52 -0000 @@ -33,7 +33,7 @@ using Gtk; using Gdk; using GConf; using Glade; -using Mono.Posix; +using Mono.Unix; using Beagle; using Beagle.Util;