summaryrefslogtreecommitdiff
path: root/lib/libalpm/handle.c
diff options
context:
space:
mode:
authorDan McGee <dan@archlinux.org>2007-07-09 15:22:01 -0400
committerDan McGee <dan@archlinux.org>2007-07-09 15:23:26 -0400
commit1480ac29e475e369fb781fe98ac5991e1a67e5e5 (patch)
tree425e59357955f56e2f947bdcc694e4c033460170 /lib/libalpm/handle.c
parent4906e15d0d31bf0442c25af44bcb637b87a7b027 (diff)
downloadpacman-1480ac29e475e369fb781fe98ac5991e1a67e5e5.tar.xz
Clean up the alpm handle
Add some comments in handle.h, and remove the pmaccess_t part that we don't even use. Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'lib/libalpm/handle.c')
-rw-r--r--lib/libalpm/handle.c39
1 files changed, 9 insertions, 30 deletions
diff --git a/lib/libalpm/handle.c b/lib/libalpm/handle.c
index 7cee5020..b1fd45f2 100644
--- a/lib/libalpm/handle.c
+++ b/lib/libalpm/handle.c
@@ -53,31 +53,10 @@ pmhandle_t *_alpm_handle_new()
memset(handle, 0, sizeof(pmhandle_t));
handle->lckfd = -1;
+ handle->logstream = NULL;
-#ifndef CYGWIN
/* see if we're root or not */
handle->uid = geteuid();
-//#ifndef FAKEROOT
-// if(!handle->uid && getenv("FAKEROOTKEY")) {
-// /* fakeroot doesn't count, we're non-root */
-// handle->uid = 99;
-// }
-//#endif
-//
-// /* see if we're root or not (fakeroot does not count) */
-//#ifndef FAKEROOT
-// if(handle->uid == 0 && !getenv("FAKEROOTKEY")) {
-// /* } make vim indent work - stupid ifdef's */
-//#else
-// if(handle->uid == 0) {
-//#endif
-// handle->access = PM_ACCESS_RW;
-// } else {
-// handle->access = PM_ACCESS_RO;
-// }
-//#else
- handle->access = PM_ACCESS_RW;
-#endif
handle->root = NULL;
handle->dbpath = NULL;
handle->cachedirs = NULL;
@@ -95,10 +74,10 @@ void _alpm_handle_free(pmhandle_t *handle)
return;
}
- /* close logfiles */
- if(handle->logfd) {
- fclose(handle->logfd);
- handle->logfd = NULL;
+ /* close logfile */
+ if(handle->logstream) {
+ fclose(handle->logstream);
+ handle->logstream= NULL;
}
if(handle->usesyslog) {
handle->usesyslog = 0;
@@ -231,14 +210,14 @@ void SYMEXPORT alpm_option_set_logfile(const char *logfile)
if(handle->logfile) {
FREE(handle->logfile);
- if(handle->logfd) {
- fclose(handle->logfd);
- handle->logfd = NULL;
+ if(handle->logstream) {
+ fclose(handle->logstream);
+ handle->logstream = NULL;
}
}
if(logfile) {
handle->logfile = strdup(logfile);
- handle->logfd = fopen(logfile, "a");
+ handle->logstream = fopen(logfile, "a");
}
}