~dobey/ubuntu/precise/avahi/bring-back-gir

« back to all changes in this revision

Viewing changes to avahi-daemon/setproctitle.c

  • Committer: Bazaar Package Importer
  • Author(s): Robert Ancell
  • Date: 2009-05-06 14:04:57 UTC
  • mfrom: (4.1.13 sid)
  • Revision ID: james.westby@ubuntu.com-20090506140457-72h3msg32nuc4j7v
Tags: 0.6.27-2ubuntu1
* Merge from Debian unstable, remaining Ubuntu changes:
* debian/control:
  - Remove linux-any as it is not yet supported by Soyuz
  - Add versioned dependency on the dbus that satisfies our upstart job
    dependency.
  - Add udebs corresponding to libavahi-common3 and libavahi-core6, so that
    we can use them for Eucalyptus integration in the installer.
  - Recommend dhcp3-client instead of isc-dhcp-client (not yet available in
    Ubuntu)
* debian/rules:
* debian/avahi-daemon.init:
* debian/avahi-dnsconfd.init:
  - Avahi init scripts (daemon or dnsconfd) do not need to
    be started before gdm, and do not need to be stopped specially on
    shutdown.
* debian/avahi-daemon.postinst:
* debian/avahi-dnsconfd.postinst:
  - Use Ubuntu versions for migration scripts
* debian/avahi-autoipd.preinst:
* debian/avahi-autoipd.install:
* debian/avahi-autoipd.postinst:
* debian/avahi-autoipd.postrm:
  - Disable DHCP 3 to 4 migration (not yet in Ubuntu)
* debian/avahi-daemon.upstart:
* debian/avahi-dnsconfd.upstart:
  - Add Upstart config
* debian/patches/03_gir_1.1.patch:
  - Compile with the latest Gobject introspection

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* $Id$ */
2
 
 
3
1
/***
4
2
  This file is part of avahi.
5
 
 
 
3
 
6
4
  avahi is free software; you can redistribute it and/or modify it
7
5
  under the terms of the GNU Lesser General Public License as
8
6
  published by the Free Software Foundation; either version 2.1 of the
9
7
  License, or (at your option) any later version.
10
 
 
 
8
 
11
9
  avahi is distributed in the hope that it will be useful, but WITHOUT
12
10
  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
13
11
  or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
14
12
  Public License for more details.
15
 
 
 
13
 
16
14
  You should have received a copy of the GNU Lesser General Public
17
15
  License along with avahi; if not, write to the Free Software
18
16
  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
66
64
    argv_size = endptr - argv_buffer[0];
67
65
 
68
66
    /* Make a copy of environ */
69
 
    
 
67
 
70
68
    new_environ = avahi_malloc(sizeof(char*) * (i + 1));
71
69
    for (i = 0; environ[i]; i++)
72
70
        new_environ[i] = avahi_strdup(environ[i]);
75
73
    environ = new_environ;
76
74
 
77
75
#endif
78
 
}       
 
76
}
79
77
 
80
78
void avahi_set_proc_title(const char *name, const char *fmt,...) {
81
79
#ifdef HAVE_SETPROCTITLE
90
88
#elif __linux__
91
89
    size_t l;
92
90
    va_list ap;
93
 
    
 
91
 
94
92
    if (!argv_buffer)
95
93
        return;
96
 
    
 
94
 
97
95
    va_start(ap, fmt);
98
96
    vsnprintf(argv_buffer[0], argv_size, fmt, ap);
99
97
    va_end(ap);
100
98
 
101
99
    l = strlen(argv_buffer[0]);
102
 
    
 
100
 
103
101
    memset(argv_buffer[0] + l, 0, argv_size - l);
104
102
    argv_buffer[1] = NULL;
105
103
#endif
108
106
 
109
107
    if (name)
110
108
        prctl(PR_SET_NAME, (unsigned long) name, 0, 0, 0);
111
 
    
 
109
 
112
110
#endif
113
111
}