Ignore:
Timestamp:
Feb 12, 2007, 11:49:41 PM (14 years ago)
Author:
Bruno Cornec
Message:

More memory updates around mondoarchive (addition of mr_setenv) (based on ideas sent as patches by Michel)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/stable/mondo/src/common/libmondo-archive.c

    r1147 r1152  
    1414#include <sys/ipc.h>
    1515#include <stdarg.h>
     16#include <stdlib.h>
    1617#include <unistd.h>
    1718
     
    39393940/* @} - end of utilityGroup */
    39403941
    3941 void setenv_mondo_share(void) {
    3942 
    3943 setenv("MONDO_SHARE", MONDO_SHARE, 1);
    3944 setenv("MONDORESTORECFG", MONDORESTORECFG, 1);
    3945 setenv("MONDO_CACHE", MONDO_CACHE, 1);
     3942void setenv_mondo_var(void) {
     3943
     3944    char *tmp = NULL;
     3945    char *p = NULL;
     3946    char *path_min = "/bin:/usr/bin:/sbin:/usr/sbin:/usr/local/sbin:/usr/local/bin";
     3947
     3948    mr_setenv("MONDO_SHARE",MONDO_SHARE);
     3949    mr_setenv("MONDORESTORECFG",MONDORESTORECFG);
     3950    mr_setenv("MONDO_CACHE",MONDO_CACHE);
     3951
     3952    if ((p = getenv("PATH")) == NULL) {
     3953        mr_asprintf(&p,path_min);
     3954    }
     3955    mr_asprintf(&tmp, "%s:%s",p, path_min);
     3956    mr_free(p);
     3957    mr_setenv("PATH",tmp);
     3958    mr_free(tmp);
    39463959}
Note: See TracChangeset for help on using the changeset viewer.