reworked handle structure initialization
This commit is contained in:
parent
89f0ccc3cc
commit
43ea74cce6
1 changed files with 2 additions and 14 deletions
|
@ -49,6 +49,8 @@ pmhandle_t *handle_new()
|
||||||
RET_ERR(PM_ERR_MEMORY, NULL);
|
RET_ERR(PM_ERR_MEMORY, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
memset(handle, 0, sizeof(pmhandle_t));
|
||||||
|
|
||||||
/* see if we're root or not */
|
/* see if we're root or not */
|
||||||
handle->uid = geteuid();
|
handle->uid = geteuid();
|
||||||
if(!handle->uid && getenv("FAKEROOTKEY")) {
|
if(!handle->uid && getenv("FAKEROOTKEY")) {
|
||||||
|
@ -63,20 +65,6 @@ pmhandle_t *handle_new()
|
||||||
handle->access = PM_ACCESS_RO;
|
handle->access = PM_ACCESS_RO;
|
||||||
}
|
}
|
||||||
|
|
||||||
handle->trans = NULL;
|
|
||||||
|
|
||||||
handle->db_local = NULL;
|
|
||||||
handle->dbs_sync = NULL;
|
|
||||||
|
|
||||||
handle->logfd = NULL;
|
|
||||||
|
|
||||||
handle->root = NULL;
|
|
||||||
handle->dbpath = NULL;
|
|
||||||
handle->logfile = NULL;
|
|
||||||
handle->noupgrade = NULL;
|
|
||||||
handle->ignorepkg = NULL;
|
|
||||||
handle->usesyslog = 0;
|
|
||||||
|
|
||||||
return(handle);
|
return(handle);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue