From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12592 invoked by alias); 18 Dec 2011 15:50:39 -0000 Received: (qmail 12583 invoked by uid 22791); 18 Dec 2011 15:50:38 -0000 X-SWARE-Spam-Status: No, hits=-1.8 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM X-Spam-Check-By: sourceware.org Received: from mail-wi0-f169.google.com (HELO mail-wi0-f169.google.com) (209.85.212.169) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sun, 18 Dec 2011 15:50:25 +0000 Received: by wibhq12 with SMTP id hq12so816817wib.0 for ; Sun, 18 Dec 2011 07:50:24 -0800 (PST) Received: by 10.180.99.66 with SMTP id eo2mr5814788wib.36.1324223424261; Sun, 18 Dec 2011 07:50:24 -0800 (PST) MIME-Version: 1.0 Received: by 10.223.151.11 with HTTP; Sun, 18 Dec 2011 07:49:43 -0800 (PST) From: Hui Zhu Date: Sun, 18 Dec 2011 16:05:00 -0000 Message-ID: Subject: [OB] Fix linux-low.c build error To: gdb-patches ml Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2011-12/txt/msg00602.txt.bz2 Got: gcc -c -g -O2 -I. -I../../../src/gdb/gdbserver -I../../../src/gdb/gdbserver/../common -I../../../src/gdb/gdbserver/../regformats -I../../../src/gdb/gdbserver/../../include -Wall -Wdeclaration-after-statement -Wpointer-arith -Wformat-nonliteral -Wno-char-subscripts -Werror ../../../src/gdb/gdbserver/linux-low.c -DUSE_THREAD_DB cc1: warnings being treated as errors ../../../src/gdb/gdbserver/linux-low.c: In function =91linux_create_inferio= r=92: ../../../src/gdb/gdbserver/linux-low.c:580:10: error: ignoring return value of =91write=92, declared with attribute warn_unused_result 2011-12-18 Hui Zhu * linux-low.c (linux_create_inferior): Save return value to ret. =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /cvs/src/src/gdb/gdbserver/linux-low.c,v retrieving revision 1.185 retrieving revision 1.186 diff -u -r1.185 -r1.186 --- src/gdb/gdbserver/linux-low.c 2011/12/16 19:06:37 1.185 +++ src/gdb/gdbserver/linux-low.c 2011/12/18 15:49:04 1.186 @@ -574,11 +574,12 @@ Also, redirect stdin to /dev/null. */ if (remote_connection_is_stdio ()) { + int ret; close (0); open ("/dev/null", O_RDONLY); dup2 (2, 1); - write (2, "stdin/stdout redirected\n", - sizeof ("stdin/stdout redirected\n") - 1); + ret =3D write (2, "stdin/stdout redirected\n", + sizeof ("stdin/stdout redirected\n") - 1); } execv (program, allargs);