summaryrefslogtreecommitdiff
path: root/build.c
diff options
context:
space:
mode:
authorPanu Matilainen <pmatilai@redhat.com>2008-04-04 14:33:45 +0300
committerPanu Matilainen <pmatilai@redhat.com>2008-04-04 14:41:40 +0300
commit6a766c00bfd488bb2c703910efc386bf95e6af05 (patch)
treec27f3e0250b8ce0dc038dff9ea0070a8cf88277e /build.c
parent61c0a71059d5e5a5782018505c70d88299ac3ede (diff)
downloadlibrpm-tizen-6a766c00bfd488bb2c703910efc386bf95e6af05.tar.gz
librpm-tizen-6a766c00bfd488bb2c703910efc386bf95e6af05.tar.bz2
librpm-tizen-6a766c00bfd488bb2c703910efc386bf95e6af05.zip
Wait for popen() to finish before passing to isSpecFile()
Diffstat (limited to 'build.c')
-rw-r--r--build.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/build.c b/build.c
index 179995549..f00e98d26 100644
--- a/build.c
+++ b/build.c
@@ -136,9 +136,9 @@ static char * getTarSpec(const char *arg)
if (!(fp = popen(cmd, "r"))) {
rpmlog(RPMLOG_ERR, _("Failed to open tar pipe: %m\n"));
} else {
- gotspec = fgets(tarbuf, sizeof(tarbuf) - 1, fp) &&
- isSpecFile(tmpSpecFile);
+ char *fok = fgets(tarbuf, sizeof(tarbuf) - 1, fp);
pclose(fp);
+ gotspec = (fok != NULL) && isSpecFile(tmpSpecFile);
}
if (!gotspec)