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

Side by Side Diff: src/tcs/log.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/tcs/Makefile.am ('k') | src/tcs/ps/ps_utils.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-2006 7 * (C) Copyright International Business Machines Corp. 2004-2006
8 * 8 *
9 */ 9 */
10 10
(...skipping 27 matching lines...) Expand all
38 38
39 if (getenv("TCSD_FOREGROUND") == NULL) 39 if (getenv("TCSD_FOREGROUND") == NULL)
40 openlog(szDescriptor, LOG_NDELAY|LOG_PID, TSS_SYSLOG_LVL); 40 openlog(szDescriptor, LOG_NDELAY|LOG_PID, TSS_SYSLOG_LVL);
41 memset(temp, 0, sizeof(temp)); 41 memset(temp, 0, sizeof(temp));
42 42
43 for (i = 0; (unsigned long)i < sizeOfBlob; i++) { 43 for (i = 0; (unsigned long)i < sizeOfBlob; i++) {
44 if ((i > 0) && ((i % 16) == 0)) { 44 if ((i > 0) && ((i % 16) == 0)) {
45 if (getenv("TCSD_FOREGROUND") != NULL) 45 if (getenv("TCSD_FOREGROUND") != NULL)
46 fprintf(stdout, "%s %s\n", szDescriptor, temp); 46 fprintf(stdout, "%s %s\n", szDescriptor, temp);
47 else 47 else
48 » » » » syslog(LOG_DEBUG, temp); 48 » » » » syslog(LOG_DEBUG, "%s", temp);
49 memset(temp, 0, sizeof(temp)); 49 memset(temp, 0, sizeof(temp));
50 } 50 }
51 snprintf(&temp[(i%16)*3], 4, "%.2X ", blob[i]); 51 snprintf(&temp[(i%16)*3], 4, "%.2X ", blob[i]);
52 } 52 }
53 53
54 if (i == sizeOfBlob) { 54 if (i == sizeOfBlob) {
55 if (getenv("TCSD_FOREGROUND") != NULL) 55 if (getenv("TCSD_FOREGROUND") != NULL)
56 fprintf(stdout, "%s %s\n", szDescriptor, temp); 56 fprintf(stdout, "%s %s\n", szDescriptor, temp);
57 else 57 else
58 » » » syslog(LOG_DEBUG, temp); 58 » » » syslog(LOG_DEBUG, "%s", temp);
59 } 59 }
60 } 60 }
61 61
62 void 62 void
63 LogTPMERR(TSS_RESULT result, char *file, int line) 63 LogTPMERR(TSS_RESULT result, char *file, int line)
64 { 64 {
65 if (getenv("TSS_DEBUG_OFF") == NULL) 65 if (getenv("TSS_DEBUG_OFF") == NULL)
66 fprintf(stderr, "%s %s %s:%d: 0x%x\n", "LOG_RETERR", "TPM", file , line, result); 66 fprintf(stderr, "%s %s %s:%d: 0x%x\n", "LOG_RETERR", "TPM", file , line, result);
67 } 67 }
68 68
69 TSS_RESULT 69 TSS_RESULT
70 LogTDDLERR(TSS_RESULT result, char *file, int line) 70 LogTDDLERR(TSS_RESULT result, char *file, int line)
71 { 71 {
72 if (getenv("TSS_DEBUG_OFF") == NULL) 72 if (getenv("TSS_DEBUG_OFF") == NULL)
73 fprintf(stderr, "%s %s %s:%d: 0x%x\n", "LOG_RETERR", APPID, file , line, result); 73 fprintf(stderr, "%s %s %s:%d: 0x%x\n", "LOG_RETERR", APPID, file , line, result);
74 74
75 return (result | TSS_LAYER_TDDL); 75 return (result | TSS_LAYER_TDDL);
76 } 76 }
77 77
78 TSS_RESULT 78 TSS_RESULT
79 LogTCSERR(TSS_RESULT result, char *file, int line) 79 LogTCSERR(TSS_RESULT result, char *file, int line)
80 { 80 {
81 if (getenv("TSS_DEBUG_OFF") == NULL) 81 if (getenv("TSS_DEBUG_OFF") == NULL)
82 fprintf(stderr, "%s %s %s:%d: 0x%x\n", "LOG_RETERR", APPID, file , line, result); 82 fprintf(stderr, "%s %s %s:%d: 0x%x\n", "LOG_RETERR", APPID, file , line, result);
83 83
84 return (result | TSS_LAYER_TCS); 84 return (result | TSS_LAYER_TCS);
85 } 85 }
86 86
87 #endif 87 #endif
OLDNEW
« no previous file with comments | « src/tcs/Makefile.am ('k') | src/tcs/ps/ps_utils.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698