diff options
author | Timo Teras <timo.teras@iki.fi> | 2008-11-11 09:00:10 +0200 |
---|---|---|
committer | Timo Teras <timo.teras@iki.fi> | 2008-11-11 09:00:10 +0200 |
commit | ffa03a21d86f770a526e1d8b9bfa195fe09f344b (patch) | |
tree | 4ad54e620398b9485cf10c76d4c8ac4480a91559 /src/database.c | |
parent | 791cf6f05bc71118925343528edd44fd4a671bb3 (diff) | |
download | aports-ffa03a21d86f770a526e1d8b9bfa195fe09f344b.tar.bz2 aports-ffa03a21d86f770a526e1d8b9bfa195fe09f344b.tar.xz |
db: remember empty .apks
Diffstat (limited to 'src/database.c')
-rw-r--r-- | src/database.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/database.c b/src/database.c index a1c030090a..15757ff1e9 100644 --- a/src/database.c +++ b/src/database.c @@ -323,6 +323,9 @@ static int apk_db_write_fdb(struct apk_database *db, int fd) n += apk_hexdump_format(sizeof(buf)-n, &buf[n], APK_BLOB_BUF(pkg->csum)); buf[n++] = '\n'; + if (write(fd, buf, n) != n) + return -1; + n = 0; dir = NULL; hlist_for_each_entry(file, c2, &pkg->owned_files, pkg_files_list) { @@ -340,7 +343,8 @@ static int apk_db_write_fdb(struct apk_database *db, int fd) "F%s\n", file->filename); - write(fd, buf, n); + if (write(fd, buf, n) != n) + return -1; n = 0; } } @@ -523,8 +527,6 @@ static int apk_db_write_config(struct apk_database *db) void apk_db_close(struct apk_database *db) { - apk_db_write_config(db); - apk_hash_free(&db->available.names); apk_hash_free(&db->available.packages); apk_hash_free(&db->installed.dirs); |