failures = 0;
- tmp = strdup ("/tmp/opkg.XXXXXX");
+ tmp = xstrdup("/tmp/opkg.XXXXXX");
if (mkdtemp (tmp) == NULL) {
perror ("mkdtemp");
static opkg_intercept_t opkg_prep_intercepts(opkg_conf_t *conf)
{
opkg_intercept_t ctx;
- char *oldpath;
char *newpath;
int gen;
ctx = calloc (1, sizeof (*ctx));
- oldpath = getenv ("PATH");
- if (oldpath) {
- ctx->oldpath = strdup (oldpath);
- } else {
- ctx->oldpath = 0;
- }
-
+ ctx->oldpath = xstrdup(getenv("PATH"));
sprintf_alloc (&newpath, "%s/opkg/intercept:%s", DATADIR, ctx->oldpath);
setenv ("PATH", newpath, 1);
if (ctx->oldpath) {
setenv ("PATH", ctx->oldpath, 1);
free (ctx->oldpath);
- } else {
- unsetenv("PATH");
}
dir = opendir (ctx->statedir);
for (iter = nv_pair_list_first(&pkg->conffiles); iter; iter = nv_pair_list_next(&pkg->conffiles, iter)) {
conffile_t *cf = (conffile_t *)iter->data;
int modified = conffile_has_been_modified(conf, cf);
- opkg_message(conf, OPKG_NOTICE, "conffile=%s md5sum=%s modified=%d\n",
+ if (cf->value)
+ opkg_message(conf, OPKG_NOTICE,
+ "conffile=%s md5sum=%s modified=%d\n",
cf->name, cf->value, modified);
}
}