summaryrefslogtreecommitdiffstats
path: root/src/pacman/conf.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/pacman/conf.c')
-rw-r--r--src/pacman/conf.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/src/pacman/conf.c b/src/pacman/conf.c
index a9f0de91..7ba2791c 100644
--- a/src/pacman/conf.c
+++ b/src/pacman/conf.c
@@ -18,8 +18,6 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include "config.h"
-
#include <errno.h>
#include <glob.h>
#include <limits.h>
@@ -203,11 +201,14 @@ static int download_with_xfercommand(const char *url, const char *localpath,
cleanup:
/* restore the old cwd if we have it */
if(cwdfd >= 0) {
+ int ret;
if(fchdir(cwdfd) != 0) {
pm_printf(ALPM_LOG_ERROR, _("could not restore working directory (%s)\n"),
strerror(errno));
}
- close(cwdfd);
+ do {
+ ret = close(cwdfd);
+ } while(ret == -1 && errno == EINTR);
}
if(ret == -1) {
@@ -256,11 +257,11 @@ static int process_siglevel(alpm_list_t *values, alpm_siglevel_t *storage,
const char *original = i->data, *value;
int package = 0, database = 0;
- if (strncmp(original, "Package", strlen("Package")) == 0) {
+ if(strncmp(original, "Package", strlen("Package")) == 0) {
/* only packages are affected, don't flip flags for databases */
value = original + strlen("Package");
package = 1;
- } else if (strncmp(original, "Database", strlen("Database")) == 0) {
+ } else if(strncmp(original, "Database", strlen("Database")) == 0) {
/* only databases are affected, don't flip flags for packages */
value = original + strlen("Database");
database = 1;
@@ -522,7 +523,7 @@ static int _add_mirror(alpm_db_t *db, char *value)
static int setup_libalpm(void)
{
int ret = 0;
- enum _alpm_errno_t err;
+ alpm_errno_t err;
alpm_handle_t *handle;
pm_printf(ALPM_LOG_DEBUG, "setup_libalpm called\n");
@@ -659,7 +660,7 @@ static int finish_section(struct section_t *section, int parse_options)
}
for(i = section->servers; i; i = alpm_list_next(i)) {
- char *value = alpm_list_getdata(i);
+ char *value = i->data;
if(_add_mirror(db, value) != 0) {
pm_printf(ALPM_LOG_ERROR,
_("could not add mirror '%s' to database '%s' (%s)\n"),
@@ -725,8 +726,7 @@ static int _parseconfig(const char *file, struct section_t *section,
*ptr = '\0';
}
- strtrim(line);
- line_len = strlen(line);
+ line_len = strtrim(line);
if(line_len == 0) {
continue;
@@ -822,7 +822,7 @@ static int _parseconfig(const char *file, struct section_t *section,
if((ret = _parse_options(key, value, file, linenum)) != 0) {
goto cleanup;
}
- } else if (!parse_options && !section->is_options) {
+ } else if(!parse_options && !section->is_options) {
/* ... or in a repo section */
if(strcmp(key, "Server") == 0) {
if(value == NULL) {
@@ -859,7 +859,7 @@ static int _parseconfig(const char *file, struct section_t *section,
}
cleanup:
- if (fp) {
+ if(fp) {
fclose(fp);
}
pm_printf(ALPM_LOG_DEBUG, "config: finished parsing %s\n", file);