Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(226)

Side by Side Diff: src/tcsd/platform.c

Issue 3581012: Upgrade from trousers 0.3.3 to 0.3.6 and from testsuite 0.2 to 0.3. (Closed) Base URL: ssh://git@gitrw.chromium.org:9222/trousers.git
Patch Set: git cl push Created 10 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/tcsd/Makefile.am ('k') | src/tcsd/svrside.c » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 1
2 /* 2 /*
3 * Licensed Materials - Property of IBM 3 * Licensed Materials - Property of IBM
4 * 4 *
5 * trousers - An open source TCG Software Stack 5 * trousers - An open source TCG Software Stack
6 * 6 *
7 * (C) Copyright International Business Machines Corp. 2004, 2005 7 * (C) Copyright International Business Machines Corp. 2004, 2005
8 * 8 *
9 */ 9 */
10 10
11 11
12 #if (defined (__FreeBSD__) || defined (__OpenBSD__)) 12 #if (defined (__FreeBSD__) || defined (__OpenBSD__))
13 #include <sys/param.h> 13 #include <sys/param.h>
14 #include <sys/sysctl.h> 14 #include <sys/sysctl.h>
15 #include <err.h> 15 #include <err.h>
16 #elif (defined (__linux) || defined (linux)) 16 #elif (defined (__linux) || defined (linux) || defined(__GLIBC__))
17 #include <utmp.h> 17 #include <utmp.h>
18 #elif (defined (SOLARIS)) 18 #elif (defined (SOLARIS))
19 #include <utmpx.h> 19 #include <utmpx.h>
20 #endif 20 #endif
21 21
22 #include <sys/time.h> 22 #include <sys/time.h>
23 #include <stdlib.h> 23 #include <stdlib.h>
24 #include <stdio.h> 24 #include <stdio.h>
25 #include <string.h> 25 #include <string.h>
26 26
27 #include "trousers/tss.h" 27 #include "trousers/tss.h"
28 #include "trousers_types.h" 28 #include "trousers_types.h"
29 #include "tcs_tsp.h" 29 #include "tcs_tsp.h"
30 #include "tcs_int_literals.h" 30 #include "tcs_int_literals.h"
31 #include "capabilities.h" 31 #include "capabilities.h"
32 #include "tcsps.h" 32 #include "tcsps.h"
33 #include "tcslog.h" 33 #include "tcslog.h"
34 34
35 35
36 #if (defined (__linux) || defined (linux)) 36 #if (defined (__linux) || defined (linux) || defined(__GLIBC__))
37 MUTEX_DECLARE_INIT(utmp_lock); 37 MUTEX_DECLARE_INIT(utmp_lock);
38 38
39 char 39 char
40 platform_get_runlevel() 40 platform_get_runlevel()
41 { 41 {
42 char runlevel; 42 char runlevel;
43 struct utmp ut, save, *next = NULL; 43 struct utmp ut, save, *next = NULL;
44 struct timeval tv; 44 struct timeval tv;
45 int flag = 0, counter = 0; 45 int flag = 0, counter = 0;
46 46
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
125 if (utp->ut_type == RUN_LVL && 125 if (utp->ut_type == RUN_LVL &&
126 sscanf(utp->ut_line, "run-level %c", &runlevel) != 1) 126 sscanf(utp->ut_line, "run-level %c", &runlevel) != 1)
127 runlevel = 'u'; 127 runlevel = 'u';
128 endutxent(); 128 endutxent();
129 129
130 MUTEX_UNLOCK(utmp_lock); 130 MUTEX_UNLOCK(utmp_lock);
131 131
132 return runlevel; 132 return runlevel;
133 } 133 }
134 #endif 134 #endif
OLDNEW
« no previous file with comments | « src/tcsd/Makefile.am ('k') | src/tcsd/svrside.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698