Changeset 39385 in vbox for trunk/src/VBox/Additions
- Timestamp:
- Nov 21, 2011 3:01:15 PM (13 years ago)
- svn:sync-xref-src-repo-rev:
- 74984
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/common/VBoxService/VBoxServiceToolBox.cpp
r39069 r39385 144 144 145 145 /** 146 * Initializes the parseable stream(s). 147 * 148 * @return IPRT status code. 149 */ 150 static int VBoxServiceToolboxStrmInit(void) 151 { 152 /* Set stdout's mode to binary. This is required for outputting all the machine-readable 153 * data correctly. */ 154 int rc = RTStrmSetMode(g_pStdOut, 1 /* Binary mode */, -1 /* Current code set, not changed */); 155 if (RT_FAILURE(rc)) 156 RTMsgError("Unable to set stdout to binary mode, rc=%Rrc\n", rc); 157 158 return rc; 159 } 160 161 162 /** 146 163 * Prints a parseable stream header which contains the actual tool 147 164 * which was called/used along with its stream version. … … 157 174 } 158 175 176 159 177 /** 160 178 * Prints a standardized termination sequence indicating that the … … 166 184 RTPrintf("%c%c%c%c", 0, 0, 0, 0); 167 185 } 186 168 187 169 188 /** … … 833 852 /* Print magic/version. */ 834 853 if (fOutputFlags & VBOXSERVICETOOLBOXOUTPUTFLAG_PARSEABLE) 854 { 855 rc = VBoxServiceToolboxStrmInit(); 856 if (RT_FAILURE(rc)) 857 RTMsgError("Error while initializing parseable streams, rc=%Rrc\n", rc); 835 858 VBoxServiceToolboxPrintStrmHeader("vbt_ls", 1 /* Stream version */); 859 } 836 860 837 861 PVBOXSERVICETOOLBOXPATHENTRY pNodeIt; … … 1068 1092 { 1069 1093 if (fOutputFlags & VBOXSERVICETOOLBOXOUTPUTFLAG_PARSEABLE) /* Output termination. */ 1094 { 1095 rc = VBoxServiceToolboxStrmInit(); 1096 if (RT_FAILURE(rc)) 1097 RTMsgError("Error while initializing parseable streams, rc=%Rrc\n", rc); 1070 1098 VBoxServiceToolboxPrintStrmHeader("vbt_stat", 1 /* Stream version */); 1099 } 1071 1100 1072 1101 PVBOXSERVICETOOLBOXPATHENTRY pNodeIt;
Note:
See TracChangeset
for help on using the changeset viewer.