~ubuntu-branches/ubuntu/trusty/virtualbox-ose/trusty

« back to all changes in this revision

Viewing changes to src/VBox/Runtime/generic/env-generic.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Felix Geyer
  • Date: 2009-12-18 16:44:29 UTC
  • mfrom: (0.3.3 upstream) (0.4.6 squeeze)
  • Revision ID: james.westby@ubuntu.com-20091218164429-jd34ccexpv5na11a
Tags: 3.1.2-dfsg-1ubuntu1
* Merge from Debian unstable (LP: #498219), remaining changes:
  - Disable update action
    - debian/patches/u01-disable-update-action.dpatch
  - VirtualBox should go in Accessories, not in System tools (LP: #288590)
    - debian/virtualbox-ose-qt.files/virtualbox-ose.desktop
  - Add Apport hook
    - debian/virtualbox-ose.files/source_virtualbox-ose.py
    - debian/virtualbox-ose.install
  - Add Launchpad integration
    - debian/control
    - debian/lpi-bug.xpm
    - debian/patches/u02-lp-integration.dpatch
* Fixes the following bugs:
  - Kernel module fails to build with Linux >= 2.6.32 (LP: #474625)
  - X.Org drivers need to be rebuilt against X-Server 1.7 (LP: #495935)
  - The *-source packages try to build the kernel modules even though the
    kernel headers aren't available (LP: #473334)
* Replace *-source packages with transitional packages for *-dkms.
* Adapt u01-disable-update-action.dpatch and u02-lp-integration.dpatch for
  new upstream version.

Show diffs side-by-side

added added

removed removed

Lines of Context:
33
33
*   Header Files                                                               *
34
34
*******************************************************************************/
35
35
#include <iprt/env.h>
 
36
#include "internal/iprt.h"
 
37
 
36
38
#include <iprt/assert.h>
37
39
#include <iprt/alloc.h>
38
40
#include <iprt/alloca.h>
53
55
RT_C_DECLS_END
54
56
#endif
55
57
 
 
58
 
56
59
/*******************************************************************************
57
60
*   Defined Constants And Macros                                               *
58
61
*******************************************************************************/
151
154
    AssertPtrReturn(pEnv, VERR_INVALID_POINTER);
152
155
    return rtEnvCreate(pEnv, RTENV_GROW_SIZE);
153
156
}
 
157
RT_EXPORT_SYMBOL(RTEnvCreate);
154
158
 
155
159
 
156
160
RTDECL(int) RTEnvDestroy(RTENV Env)
194
198
 
195
199
    return VINF_SUCCESS;
196
200
}
 
201
RT_EXPORT_SYMBOL(RTEnvDestroy);
197
202
 
198
203
 
199
204
RTDECL(int) RTEnvClone(PRTENV pEnv, RTENV EnvToClone)
239
244
            /* ASSUMES the default environment is in the current codepage. */
240
245
            for (size_t iVar = 0; iVar < cVars; iVar++)
241
246
            {
242
 
                int rc = RTStrCurrentCPToUtf8(&pIntEnv->papszEnv[iVar], papszEnv[iVar]);
243
 
                if (RT_FAILURE(rc))
 
247
                int rc2 = RTStrCurrentCPToUtf8(&pIntEnv->papszEnv[iVar], papszEnv[iVar]);
 
248
                if (RT_FAILURE(rc2))
244
249
                {
245
250
                    pIntEnv->cVars = iVar;
246
251
                    RTEnvDestroy(pIntEnv);
247
 
                    return rc;
 
252
                    return rc2;
248
253
                }
249
254
            }
250
255
        }
259
264
 
260
265
                    pIntEnv->cVars = iVar;
261
266
                    RTEnvDestroy(pIntEnv);
262
 
                    return rc;
 
267
                    return VERR_NO_STR_MEMORY;
263
268
                }
264
269
                pIntEnv->papszEnv[iVar] = pszVar;
265
270
            }
273
278
        RTENV_UNLOCK(pIntEnvToClone);
274
279
    return rc;
275
280
}
 
281
RT_EXPORT_SYMBOL(RTEnvClone);
276
282
 
277
283
 
278
284
RTDECL(int) RTEnvPutEx(RTENV Env, const char *pszVarEqualValue)
300
306
    }
301
307
    return rc;
302
308
}
 
309
RT_EXPORT_SYMBOL(RTEnvPutEx);
303
310
 
304
311
 
305
312
RTDECL(int) RTEnvSetEx(RTENV Env, const char *pszVar, const char *pszValue)
405
412
    }
406
413
    return rc;
407
414
}
 
415
RT_EXPORT_SYMBOL(RTEnvSetEx);
408
416
 
409
417
 
410
418
RTDECL(int) RTEnvUnsetEx(RTENV Env, const char *pszVar)
460
468
    return rc;
461
469
 
462
470
}
 
471
RT_EXPORT_SYMBOL(RTEnvUnsetEx);
463
472
 
464
473
 
465
474
RTDECL(int) RTEnvGetEx(RTENV Env, const char *pszVar, char *pszValue, size_t cbValue, size_t *pcchActual)
546
555
    return rc;
547
556
 
548
557
}
 
558
RT_EXPORT_SYMBOL(RTEnvGetEx);
549
559
 
550
560
 
551
561
RTDECL(bool) RTEnvExistEx(RTENV Env, const char *pszVar)
592
602
    }
593
603
    return fExist;
594
604
}
 
605
RT_EXPORT_SYMBOL(RTEnvExistEx);
595
606
 
596
607
 
597
608
RTDECL(char const * const *) RTEnvGetExecEnvP(RTENV Env)
654
665
    }
655
666
    return papszRet;
656
667
}
 
668
RT_EXPORT_SYMBOL(RTEnvGetExecEnvP);