tags 400083 + patch
thanks
I can't reproduce this problem and it seems weird.
I have no idea why P/Invoke of prctl fails on your machine. The strace
shows that the C library is found, and it would be very weird if you
didn't have it.... :)
I googled and it seems like you're not totally alone on having this
problem, even though it seems a bit rare.
The SetProcessName function has probably been cut'n'pasted between most
Mono applications, do you have the same problem in f-spot, banshee, and
so on?
The attached patch should work around the problem by catching the
exceptions in SetProcessName and issue a warning... I don't believe the
failure of setting the process name needs to be a fatal error.
Patch attached.
--
Regards,
Andreas Henriksson
--- last-exit-3.0/src/Driver.cs 2006-08-29 22:15:33.000000000 +0200
+++ last-exit-3.0.fixed/src/Driver.cs 2006-11-26 22:51:42.000000000 +0100
@@ -173,8 +173,12 @@
private static void SetProcessName (string name)
{
- if (prctl (15, Encoding.ASCII.GetBytes (name + "\0"),
0, 0, 0) != 0) {
- throw new ApplicationException ("Error setting
process name: " + Mono.Unix.Native.Stdlib.GetLastError ());
+ try {
+ if (prctl (15, Encoding.ASCII.GetBytes (name +
"\0"), 0, 0, 0) != 0) {
+ throw new ApplicationException ("Error
setting process name: " + Mono.Unix.Native.Stdlib.GetLastError ());
+ }
+ } catch (Exception e) {
+ Console.WriteLine("Warning: " + e.Message);
}
}