reworked handle structure initialization

This commit is contained in:
Aurelien Foret 2005-04-16 16:43:55 +00:00
parent 89f0ccc3cc
commit 43ea74cce6

View file

@ -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);
} }