~ubuntu-branches/ubuntu/karmic/tangerine/karmic

« back to all changes in this revision

Viewing changes to Tangerine.Daemon/src/EntryPoint.cs

  • Committer: Bazaar Package Importer
  • Author(s): Chow Loong Jin
  • Date: 2009-08-18 21:38:02 UTC
  • mfrom: (2.2.2 squeeze)
  • Revision ID: james.westby@ubuntu.com-20090818213802-oqfj7o0bxxu3ti4e
Tags: 0.3.2.2-1
* New upstream release
* debian/watch, debian/control:
  + Update to new homepage
* debian/control:
  + No-change bump to Standards 3.8.3
  + Add myself to Uploaders, and drop some inactive contributors' names
  + Update Vcs-* fields to reflect migration to git
  + Update build depends:
    - Update order to reflect configure.ac order
    - Drop libavahi1.0-cil, libmono-sqlite2.0-cil, cdbs
    - Add banshee, libmono-zeroconf1.0-cil, libndesk-dbus-glib1.0-cil
    - Use DH7
  + Add a debug package, tangerine-dbg
* debian/rules:
  + Rewrite to use DH7
  + Clean up get-orig-source rule
  + Add some custom configure flags
  + Add dh_{,cli}strip overrides to strip into tangerine-dbg
  + Remove /usr/share/doc/tangerine/sample.conf since it's handled by
    dh_installexamples
* debian/compat:
  + Bump to 7
* debian/copyright:
  + Update and use DEP-5
* debian/tangerine*.1, debian/tangerine.manpages:
  + Added manpages for tangerine and tangerine-properties.
* debian/tangerine.examples:
  + Install sample.conf as a sample conf file for ~/.tangerine
* debian/patches:
  + Drop all patches, since they are either applied upstream or no
    longer relevant.
* debian/*.dll.config:
  + Dropped, no longer needed

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
using System;
 
2
using System.IO;
 
3
using System.Runtime.InteropServices;
 
4
using System.Text;
 
5
 
 
6
namespace Tangerine 
 
7
{
 
8
 
 
9
    public class EntryPoint 
 
10
        {
 
11
        [DllImport("libc")]
 
12
        private static extern int prctl(int option, byte [] arg2, ulong arg3,
 
13
                                        ulong arg4, ulong arg5);
 
14
 
 
15
        private static void SetProcessName(string name) {
 
16
            try {
 
17
                prctl(15 /* PR_SET_NAME */, Encoding.ASCII.GetBytes(name + "\0"), 0, 0, 0);
 
18
            } catch {
 
19
            }
 
20
        }
 
21
 
 
22
        public static int Main (string[] args) 
 
23
                {
 
24
            string configFile = null;
 
25
 
 
26
            SetProcessName ("tangerine");
 
27
            
 
28
            if (args.Length > 0) {
 
29
                if (args[0] == "-h" || args[0] == "--help") {
 
30
                    Console.WriteLine ("Usage: tangerine [<config>]");
 
31
                    Console.WriteLine ("If no config file is specified, ~/.tangerine is used");
 
32
                    return 0;
 
33
                } else {
 
34
                    configFile = args[0];
 
35
                }
 
36
            }
 
37
 
 
38
            try {
 
39
                if (configFile != null) {
 
40
                    Daemon.ConfigPath = configFile;
 
41
                }
 
42
 
 
43
                Daemon.ParseConfig ();
 
44
            } catch (Exception e) {
 
45
                Console.Error.WriteLine ("Failed to parse configuration: " + e);
 
46
                return 1;
 
47
            }
 
48
            
 
49
            Daemon.Run ();
 
50
            return 0;
 
51
        }
 
52
    }
 
53
}