~ubuntu-branches/ubuntu/quantal/virtualbox/quantal

« back to all changes in this revision

Viewing changes to src/VBox/Main/src-client/GuestCtrlImplFile.cpp

  • Committer: Package Import Robot
  • Author(s): Felix Geyer
  • Date: 2012-04-05 12:41:55 UTC
  • mfrom: (3.1.12 sid)
  • Revision ID: package-import@ubuntu.com-20120405124155-i7b39tv5ddwhubbe
Tags: 4.1.12-dfsg-2
* Upstream has replaced the 4.1.12 tarball with a new one that fixes a
  crash when creating host only interfaces. (Closes: #667460)
  - Add 36-tarball-respin.patch which contains the diff between the old
    and the new tarball.

Show diffs side-by-side

added added

removed removed

Lines of Context:
131
131
         */
132
132
        ULONG uPID;
133
133
        GuestCtrlStreamObjects stdOut;
 
134
        ComPtr<IProgress> pProgress;
134
135
        hr = executeAndWaitForTool(Bstr(VBOXSERVICE_TOOL_STAT).raw(), Bstr("Querying file information").raw(),
135
136
                                   ComSafeArrayAsInParam(args),
136
137
                                   ComSafeArrayAsInParam(env),
137
138
                                   aUsername, aPassword,
138
139
                                   ExecuteProcessFlag_WaitForStdOut,
139
140
                                   &stdOut, NULL,
140
 
                                   NULL /* Progress */, &uPID);
 
141
                                   pProgress.asOutParam(), &uPID);
141
142
        if (SUCCEEDED(hr))
142
143
        {
143
 
            int rc = VINF_SUCCESS;
144
 
            if (stdOut.size())
 
144
            hr = setErrorFromProgress(pProgress);
 
145
            if (SUCCEEDED(hr))
145
146
            {
 
147
                int rc = VINF_SUCCESS;
 
148
                if (stdOut.size())
 
149
                {
146
150
#if 0
147
 
                /* Dump the parsed stream contents to Log(). */
148
 
                stdOut[0].Dump();
 
151
                    /* Dump the parsed stream contents to Log(). */
 
152
                    stdOut[0].Dump();
149
153
#endif
150
 
                const char *pszFsType = stdOut[0].GetString("ftype");
151
 
                if (!pszFsType) /* Was an object found at all? */
152
 
                    rc = VERR_FILE_NOT_FOUND;
153
 
                if (   RT_SUCCESS(rc)
154
 
                    && strcmp(pszFsType, "-")) /* Regular file? */
155
 
                {
156
 
                    rc = VERR_FILE_NOT_FOUND;
157
 
                    /* This is not critical for Main, so don't set hr --
158
 
                     * we will take care of rc then. */
159
 
                }
160
 
                if (   RT_SUCCESS(rc)
161
 
                    && aObjInfo) /* Do we want object details? */
162
 
                {
163
 
                    rc = executeStreamQueryFsObjInfo(aFile, stdOut[0],
164
 
                                                     aObjInfo, enmAddAttribs);
165
 
                }
 
154
                    const char *pszFsType = stdOut[0].GetString("ftype");
 
155
                    if (!pszFsType) /* Was an object found at all? */
 
156
                        rc = VERR_FILE_NOT_FOUND;
 
157
                    if (   RT_SUCCESS(rc)
 
158
                        && strcmp(pszFsType, "-")) /* Regular file? */
 
159
                    {
 
160
                        rc = VERR_FILE_NOT_FOUND;
 
161
                        /* This is not critical for Main, so don't set hr --
 
162
                         * we will take care of rc then. */
 
163
                    }
 
164
                    if (   RT_SUCCESS(rc)
 
165
                        && aObjInfo) /* Do we want object details? */
 
166
                    {
 
167
                        rc = executeStreamQueryFsObjInfo(aFile, stdOut[0],
 
168
                                                         aObjInfo, enmAddAttribs);
 
169
                    }
 
170
                }
 
171
                else
 
172
                    rc = VERR_NO_DATA;
 
173
 
 
174
                if (pRC)
 
175
                    *pRC = rc;
166
176
            }
167
 
            else
168
 
                rc = VERR_NO_DATA;
169
177
 
170
 
            if (pRC)
171
 
                *pRC = rc;
 
178
            pProgress.setNull();
172
179
        }
173
180
    }
174
181
    catch (std::bad_alloc &)