aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorTimo Teräs <timo.teras@iki.fi>2015-03-10 15:46:05 +0200
committerTimo Teräs <timo.teras@iki.fi>2015-03-10 15:47:13 +0200
commitda6e455f7001def03300a398dbbc02bb03c7f4b9 (patch)
tree192d4250879cfa27645e830c9efd5507e18e51d6 /src
parentbe8e133c0b5ba0980d0debbf26b76a0b866689e7 (diff)
downloadaports-da6e455f7001def03300a398dbbc02bb03c7f4b9.tar.bz2
aports-da6e455f7001def03300a398dbbc02bb03c7f4b9.tar.xz
rename file info related functions for consistency
Diffstat (limited to 'src')
-rw-r--r--src/apk_io.h6
-rw-r--r--src/archive.c4
-rw-r--r--src/audit.c4
-rw-r--r--src/database.c6
-rw-r--r--src/fetch.c2
-rw-r--r--src/index.c4
-rw-r--r--src/io.c6
-rw-r--r--src/package.c2
8 files changed, 17 insertions, 17 deletions
diff --git a/src/apk_io.h b/src/apk_io.h
index 3e5e63f5df..59a5d70902 100644
--- a/src/apk_io.h
+++ b/src/apk_io.h
@@ -148,9 +148,9 @@ apk_blob_t apk_blob_from_file(int atfd, const char *file);
int apk_blob_to_file(int atfd, const char *file, apk_blob_t b, unsigned int flags);
#define APK_FI_NOFOLLOW 0x80000000
-int apk_file_get_info(int atfd, const char *filename, unsigned int flags,
- struct apk_file_info *fi);
-void apk_file_info_free(struct apk_file_info *fi);
+int apk_fileinfo_get(int atfd, const char *filename, unsigned int flags,
+ struct apk_file_info *fi);
+void apk_fileinfo_free(struct apk_file_info *fi);
typedef int apk_dir_file_cb(void *ctx, int dirfd, const char *entry);
int apk_dir_foreach_file(int dirfd, apk_dir_file_cb cb, void *ctx);
diff --git a/src/archive.c b/src/archive.c
index 279ccb95a0..47b798b88b 100644
--- a/src/archive.c
+++ b/src/archive.c
@@ -314,7 +314,7 @@ err:
EVP_MD_CTX_cleanup(&teis.mdctx);
free(pax.ptr);
free(longname.ptr);
- apk_file_info_free(&entry);
+ apk_fileinfo_free(&entry);
return r;
err_nomem:
@@ -480,7 +480,7 @@ int apk_archive_entry_extract(int atfd, const struct apk_file_info *ae,
} else {
r = errno;
}
- if (r < 0) {
+ if (r) {
apk_error("Failed to set xattrs on %s: %s",
fn, strerror(r));
return -r;
diff --git a/src/audit.c b/src/audit.c
index 35f79a650f..3bc525bec7 100644
--- a/src/audit.c
+++ b/src/audit.c
@@ -99,7 +99,7 @@ static int audit_file(struct audit_ctx *actx,
dbf->audited = 1;
- if (apk_file_get_info(dirfd, name, APK_FI_NOFOLLOW | dbf->csum.type, &fi) != 0)
+ if (apk_fileinfo_get(dirfd, name, APK_FI_NOFOLLOW | dbf->csum.type, &fi) != 0)
return -EPERM;
if (dbf->csum.type != APK_CHECKSUM_NONE &&
@@ -175,7 +175,7 @@ static int audit_directory_tree_item(void *ctx, int dirfd, const char *name)
if (bdir.len + bent.len + 1 >= sizeof(atctx->path))
return -ENOMEM;
- if (apk_file_get_info(dirfd, name, APK_FI_NOFOLLOW, &fi) < 0)
+ if (apk_fileinfo_get(dirfd, name, APK_FI_NOFOLLOW, &fi) < 0)
return -EPERM;
memcpy(&atctx->path[atctx->pathlen], bent.ptr, bent.len);
diff --git a/src/database.c b/src/database.c
index 44d0b206d9..bdf6d6b68b 100644
--- a/src/database.c
+++ b/src/database.c
@@ -2425,7 +2425,7 @@ static void apk_db_purge_pkg(struct apk_database *db,
if ((diri->dir->protect_mode == APK_PROTECT_NONE) ||
(apk_flags & APK_PURGE) ||
(file->csum.type != APK_CHECKSUM_NONE &&
- apk_file_get_info(db->root_fd, name, APK_FI_NOFOLLOW | file->csum.type, &fi) == 0 &&
+ apk_fileinfo_get(db->root_fd, name, APK_FI_NOFOLLOW | file->csum.type, &fi) == 0 &&
apk_checksum_compare(&file->csum, &fi.csum) == 0))
unlinkat(db->root_fd, name, 0);
if (apk_verbosity >= 3)
@@ -2483,7 +2483,7 @@ static void apk_db_migrate_files(struct apk_database *db,
cstype = ofile->csum.type;
cstype |= APK_FI_NOFOLLOW;
- r = apk_file_get_info(db->root_fd, name, cstype, &fi);
+ r = apk_fileinfo_get(db->root_fd, name, cstype, &fi);
if (ofile && ofile->diri->pkg->name == NULL) {
/* File was from overlay, delete the
* packages version */
@@ -2500,7 +2500,7 @@ static void apk_db_migrate_files(struct apk_database *db,
* existing file */
if (ofile == NULL ||
ofile->csum.type != file->csum.type)
- apk_file_get_info(db->root_fd, name,
+ apk_fileinfo_get(db->root_fd, name,
APK_FI_NOFOLLOW | file->csum.type, &fi);
if ((apk_flags & APK_CLEAN_PROTECTED) ||
(file->csum.type != APK_CHECKSUM_NONE &&
diff --git a/src/fetch.c b/src/fetch.c
index dc4571bd2a..43e4dbf165 100644
--- a/src/fetch.c
+++ b/src/fetch.c
@@ -138,7 +138,7 @@ static int fetch_package(apk_hash_item item, void *pctx)
}
if (!(ctx->flags & FETCH_STDOUT)) {
- if (apk_file_get_info(ctx->outdir_fd, filename, APK_CHECKSUM_NONE, &fi) == 0 &&
+ if (apk_fileinfo_get(ctx->outdir_fd, filename, APK_CHECKSUM_NONE, &fi) == 0 &&
fi.size == pkg->size)
return 0;
}
diff --git a/src/index.c b/src/index.c
index ccb47135f1..44bbc0dd66 100644
--- a/src/index.c
+++ b/src/index.c
@@ -81,7 +81,7 @@ static int index_read_file(struct apk_database *db, struct index_ctx *ictx)
if (ictx->index == NULL)
return 0;
- if (apk_file_get_info(AT_FDCWD, ictx->index, APK_CHECKSUM_NONE, &fi) < 0)
+ if (apk_fileinfo_get(AT_FDCWD, ictx->index, APK_CHECKSUM_NONE, &fi) < 0)
return -EIO;
ictx->index_mtime = fi.mtime;
@@ -133,7 +133,7 @@ static int index_main(void *ctx, struct apk_database *db, struct apk_string_arra
}
foreach_array_item(parg, args) {
- if (apk_file_get_info(AT_FDCWD, *parg, APK_CHECKSUM_NONE, &fi) < 0) {
+ if (apk_fileinfo_get(AT_FDCWD, *parg, APK_CHECKSUM_NONE, &fi) < 0) {
apk_warning("File '%s' is unaccessible", *parg);
continue;
}
diff --git a/src/io.c b/src/io.c
index 84ecdb482e..2669ac32c1 100644
--- a/src/io.c
+++ b/src/io.c
@@ -529,8 +529,8 @@ int apk_blob_to_file(int atfd, const char *file, apk_blob_t b, unsigned int flag
return r;
}
-int apk_file_get_info(int atfd, const char *filename, unsigned int flags,
- struct apk_file_info *fi)
+int apk_fileinfo_get(int atfd, const char *filename, unsigned int flags,
+ struct apk_file_info *fi)
{
struct stat64 st;
struct apk_bstream *bs;
@@ -586,7 +586,7 @@ int apk_file_get_info(int atfd, const char *filename, unsigned int flags,
return 0;
}
-void apk_file_info_free(struct apk_file_info *fi)
+void apk_fileinfo_free(struct apk_file_info *fi)
{
apk_xattr_array_free(&fi->xattrs);
}
diff --git a/src/package.c b/src/package.c
index 71119684a3..1a13b77178 100644
--- a/src/package.c
+++ b/src/package.c
@@ -892,7 +892,7 @@ int apk_pkg_read(struct apk_database *db, const char *file,
struct apk_istream *tar;
int r;
- r = apk_file_get_info(AT_FDCWD, file, APK_CHECKSUM_NONE, &fi);
+ r = apk_fileinfo_get(AT_FDCWD, file, APK_CHECKSUM_NONE, &fi);
if (r != 0)
return r;