~ubuntu-branches/ubuntu/karmic/trousers/karmic

« back to all changes in this revision

Viewing changes to src/tcsd/platform.c

  • Committer: Bazaar Package Importer
  • Author(s): Daniel Baumann
  • Date: 2008-01-23 22:03:00 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20080123220300-fhtqja3c0oq0gp6z
Tags: 0.3.1-4
* Added patch from Aaron M. Ucko <ucko@debian.org> to allow trousers to
  build successfully on amd64, and presumably also other 64-bit
  architectures (Closes: #457400).
* Including udev rule for /dev/tpm from William Lima
  <wlima.amadeus@gmail.com> as suggested by David Smith <dds@google.com>
  (Closes: #459682).
* Added lintian overrides.

Show diffs side-by-side

added added

removed removed

Lines of Context:
14
14
#include <stdio.h>
15
15
#include <string.h>
16
16
#include <utmp.h>
17
 
#include <pthread.h>
18
17
 
19
18
#include "trousers/tss.h"
20
 
#include "spi_internal_types.h"
21
 
#include "tcs_internal_types.h"
 
19
#include "trousers_types.h"
22
20
#include "tcs_tsp.h"
23
21
#include "tcs_int_literals.h"
24
22
#include "capabilities.h"
25
23
#include "tcsps.h"
26
24
#include "tcslog.h"
27
25
 
28
 
pthread_mutex_t utmp_lock = PTHREAD_MUTEX_INITIALIZER;
 
26
MUTEX_DECLARE_INIT(utmp_lock);
29
27
 
30
28
char
31
29
platform_get_runlevel()
35
33
        struct timeval tv;
36
34
        int flag = 0, counter = 0;
37
35
 
38
 
        pthread_mutex_lock(&utmp_lock);
 
36
        MUTEX_LOCK(utmp_lock);
39
37
 
40
38
        memset(&ut, 0, sizeof(struct utmp));
41
39
        memset(&save, 0, sizeof(struct utmp));
68
66
                runlevel = 'u';
69
67
        }
70
68
 
71
 
        pthread_mutex_unlock(&utmp_lock);
 
69
        MUTEX_UNLOCK(utmp_lock);
72
70
 
73
71
        return runlevel;
74
72
}