summaryrefslogtreecommitdiffstats
path: root/src/opk
diff options
context:
space:
mode:
Diffstat (limited to 'src/opk')
-rw-r--r--src/opk/write.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/opk/write.c b/src/opk/write.c
index 2f2d03e..a00cf77 100644
--- a/src/opk/write.c
+++ b/src/opk/write.c
@@ -52,6 +52,8 @@ opkg_opk_opk_write(struct opkg_opk_opk *opk, const char *file_name)
{
int ret;
uint64_t mtime;
+ char *uname;
+ char *gname;
struct opkg_opk_dirent dirent;
char *buffer;
size_t size;
@@ -90,13 +92,15 @@ opkg_opk_opk_write(struct opkg_opk_opk *opk, const char *file_name)
goto out2;
}
+ uname = getpwuid(0)->pw_name;
+ gname = getgrgid(0)->gr_name;
+
/* Write version file. */
dirent.name = "debian-binary";
dirent.parent = NULL;
if (opkg_opk_ustar_write_header(opk->outer_ustar, &dirent, 0644,
- 0, getpwuid(0)->pw_name,
- 0, getgrgid(0)->gr_name,
- 4, mtime, '-', NULL) != OPKG_OPK_OK) {
+ 0, uname, 0, gname, 4, mtime, '-', NULL) !=
+ OPKG_OPK_OK) {
fputs(_("Error: Failed to write header\n"), stderr);
ret = OPKG_OPK_ERROR;
goto out3;