From: Michael Schroeder Date: Mon, 12 Apr 2010 10:12:46 +0000 (+0200) Subject: Gnu tar sometimes prints a "tar: Record size = 16" message, breaking X-Git-Tag: tznext/4.11.0.1.tizen20130304~2004 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b2efc89d7db4f3a31dfd7f91028c5a9f9643334f;p=tools%2Flibrpm-tizen.git Gnu tar sometimes prints a "tar: Record size = 16" message, breaking rpmbuild -ta. --- diff --git a/build.c b/build.c index 05bafee..501f9d6 100644 --- a/build.c +++ b/build.c @@ -128,7 +128,13 @@ static char * getTarSpec(const char *arg) if (!(fp = popen(cmd, "r"))) { rpmlog(RPMLOG_ERR, _("Failed to open tar pipe: %m\n")); } else { - char *fok = fgets(tarbuf, sizeof(tarbuf) - 1, fp); + char *fok; + for (;;) { + fok = fgets(tarbuf, sizeof(tarbuf) - 1, fp); + /* tar sometimes prints "tar: Record size = 16" messages */ + if (!fok || strncmp(fok, "tar: ", 5) != 0) + break; + } pclose(fp); gotspec = (fok != NULL) && isSpecFile(tmpSpecFile); }