From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/6199 Path: news.gmane.org!not-for-mail From: =?GB2312?B?u8a9qNbS?= Newsgroups: gmane.linux.lib.musl.general Subject: fdopen/fflush problem Date: Fri, 26 Sep 2014 14:05:57 +0800 Message-ID: <54250245.2070108@i-soft.com.cn> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=GB2312 Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1411711841 1699 80.91.229.3 (26 Sep 2014 06:10:41 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 26 Sep 2014 06:10:41 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-6212-gllmg-musl=m.gmane.org@lists.openwall.com Fri Sep 26 08:10:36 2014 Return-path: Envelope-to: gllmg-musl@plane.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by plane.gmane.org with smtp (Exim 4.69) (envelope-from ) id 1XXOjj-0005nc-VT for gllmg-musl@plane.gmane.org; Fri, 26 Sep 2014 08:10:36 +0200 Original-Received: (qmail 22211 invoked by uid 550); 26 Sep 2014 06:10:35 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Original-Received: (qmail 19527 invoked from network); 26 Sep 2014 06:06:22 -0000 X-QQ-mid: bizesmtp2t1411711558t538t158 X-QQ-SSF: 01400000000000F0F112000A0000000 X-QQ-FEAT: W0RtvjwZxSCn44mbKe9gnOx3L+UFp1xQUjCGA7fVwyVcO5E+DRGux1FZCnR2z mSts7pVYciFwHpyZi1LF612myNGda/oomiVibk9QxdZ7nhepClgJMvIpVnmxeftVduuFS/p pTXadSjuBfUrn6dE767wnlLnS5VnzHjw4Jy1SfJgiS5aCV9jdtqQfZDU4vn9aNnYyciIAKo EV+PSxmjKPw== X-QQ-GoodBg: 2 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.6.0 X-QQ-SENDSIZE: 520 X-QQ-Bgrelay: 1 Xref: news.gmane.org gmane.linux.lib.musl.general:6199 Archived-At: Hi, there, I encounter a problem about fdopen and fflush with musl, here is the code: #include #include #include int main() { char filename[17] = "/tmp/abcdeXXXXXX"; int fd = mkostemp(filename, O_WRONLY|O_CLOEXEC); printf("filename: %s\n", filename); if(fd < 0) printf("fd error\n"); FILE *f = fdopen(fd, "we"); fputs("test string\n", f); fflush(f); if(ferror(f)) printf("file error\n"); fclose(f); } As expected, the final file should contains one line and no ferror reported. Anybody can help to check it? By the way, I did not subscribe to this mail list with this mail box, please CC to jianzhong.huang AT i-soft.com.cn -- Huang JianZhong