NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: bin/51808: [PATCH] tests/lib/libc/gen/t_dir: fix various coverity issues



The following reply was made to PR bin/51808; it has been noted by GNATS.

From: "Ngie Cooper (yaneurabeya)" <yaneurabeya%gmail.com@localhost>
To: gnats-bugs%NetBSD.org@localhost
Cc: gnats-admin%netbsd.org@localhost,
 netbsd-bugs%netbsd.org@localhost
Subject: Re: bin/51808: [PATCH] tests/lib/libc/gen/t_dir: fix various coverity
 issues
Date: Wed, 11 Jan 2017 00:35:49 -0800

 --Apple-Mail=_794D7605-18E0-44E5-B0FA-FD8BF22BBD2C
 Content-Transfer-Encoding: quoted-printable
 Content-Type: text/plain;
 	charset=utf-8
 
 	Dangit. I did it properly on FreeBSD, but screwed up when I =
 submitted the patch for NetBSD. The -1 should be outside the parentheses =
 in CREAT :=E2=80=99(.
 I think this is my cue to step away from the keyboard for a bit=E2=80=A6
 -Ngie
 
 -bash-4.4$ cvs diff -u t_dir.c=20
 Index: t_dir.c
 =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: /cvsroot/src/tests/lib/libc/gen/t_dir.c,v
 retrieving revision 1.8
 diff -u -r1.8 t_dir.c
 --- t_dir.c     11 Jan 2017 07:26:17 -0000      1.8
 +++ t_dir.c     11 Jan 2017 08:35:23 -0000
 @@ -57,7 +57,7 @@
 =20
  #define        CREAT(x, m)     do {                                     =
        \
                 int _creat_fd;                                          =
 \
 -               ATF_REQUIRE_MSG((_creat_fd =3D creat((x), (m)) !=3D -1), =
    \
 +               ATF_REQUIRE_MSG((_creat_fd =3D creat((x), (m))) !=3D -1, =
    \
                     "creat(%s, %x) failed: %s", (x), (m),               =
 \
                     strerror(errno));                                   =
 \
                 (void)close(_creat_fd);                                 =
 \=
 
 --Apple-Mail=_794D7605-18E0-44E5-B0FA-FD8BF22BBD2C
 Content-Transfer-Encoding: quoted-printable
 Content-Type: text/html;
 	charset=utf-8
 
 <html><head><meta http-equiv=3D"Content-Type" content=3D"text/html =
 charset=3Dutf-8"></head><body style=3D"word-wrap: break-word; =
 -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" =
 class=3D""><span class=3D"Apple-tab-span" style=3D"white-space:pre">	=
 </span>Dangit. I did it properly on FreeBSD, but screwed up when I =
 submitted the patch for NetBSD. The -1 should be outside the parentheses =
 in CREAT :=E2=80=99(.<div class=3D"">I think this is my cue to step away =
 from the keyboard for a bit=E2=80=A6</div><div class=3D"">-Ngie<br =
 class=3D""><div class=3D""><br class=3D""></div><div class=3D""><div =
 style=3D"margin: 0px; line-height: normal; font-family: 'Andale Mono'; =
 color: rgb(40, 254, 20); background-color: rgba(0, 0, 0, 0.901961);" =
 class=3D""><span style=3D"font-variant-ligatures: no-common-ligatures" =
 class=3D"">-bash-4.4$ cvs diff -u t_dir.c&nbsp;</span></div><div =
 style=3D"margin: 0px; line-height: normal; font-family: 'Andale Mono'; =
 color: rgb(40, 254, 20); background-color: rgba(0, 0, 0, 0.901961);" =
 class=3D""><span style=3D"font-variant-ligatures: no-common-ligatures" =
 class=3D"">Index: t_dir.c</span></div><div style=3D"margin: 0px; =
 line-height: normal; font-family: 'Andale Mono'; color: rgb(40, 254, =
 20); background-color: rgba(0, 0, 0, 0.901961);" class=3D""><span =
 style=3D"font-variant-ligatures: no-common-ligatures" =
 class=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=3D</span></di=
 v><div style=3D"margin: 0px; line-height: normal; font-family: 'Andale =
 Mono'; color: rgb(40, 254, 20); background-color: rgba(0, 0, 0, =
 0.901961);" class=3D""><span style=3D"font-variant-ligatures: =
 no-common-ligatures" class=3D"">RCS file: =
 /cvsroot/src/tests/lib/libc/gen/t_dir.c,v</span></div><div =
 style=3D"margin: 0px; line-height: normal; font-family: 'Andale Mono'; =
 color: rgb(40, 254, 20); background-color: rgba(0, 0, 0, 0.901961);" =
 class=3D""><span style=3D"font-variant-ligatures: no-common-ligatures" =
 class=3D"">retrieving revision 1.8</span></div><div style=3D"margin: =
 0px; line-height: normal; font-family: 'Andale Mono'; color: rgb(40, =
 254, 20); background-color: rgba(0, 0, 0, 0.901961);" class=3D""><span =
 style=3D"font-variant-ligatures: no-common-ligatures" class=3D"">diff -u =
 -r1.8 t_dir.c</span></div><div style=3D"margin: 0px; line-height: =
 normal; font-family: 'Andale Mono'; color: rgb(40, 254, 20); =
 background-color: rgba(0, 0, 0, 0.901961);" class=3D""><span =
 style=3D"font-variant-ligatures: no-common-ligatures" class=3D"">--- =
 t_dir.c &nbsp; &nbsp; 11 Jan 2017 07:26:17 -0000&nbsp; &nbsp; &nbsp; =
 1.8</span></div><div style=3D"margin: 0px; line-height: normal; =
 font-family: 'Andale Mono'; color: rgb(40, 254, 20); background-color: =
 rgba(0, 0, 0, 0.901961);" class=3D""><span =
 style=3D"font-variant-ligatures: no-common-ligatures" class=3D"">+++ =
 t_dir.c &nbsp; &nbsp; 11 Jan 2017 08:35:23 -0000</span></div><div =
 style=3D"margin: 0px; line-height: normal; font-family: 'Andale Mono'; =
 color: rgb(40, 254, 20); background-color: rgba(0, 0, 0, 0.901961);" =
 class=3D""><span style=3D"font-variant-ligatures: no-common-ligatures" =
 class=3D"">@@ -57,7 +57,7 @@</span></div><p style=3D"margin: 0px; =
 line-height: normal; font-family: 'Andale Mono'; color: rgb(40, 254, =
 20); background-color: rgba(0, 0, 0, 0.901961); min-height: 14px;" =
 class=3D""><span style=3D"font-variant-ligatures: no-common-ligatures" =
 class=3D"">&nbsp;</span><br class=3D"webkit-block-placeholder"></p><div =
 style=3D"margin: 0px; line-height: normal; font-family: 'Andale Mono'; =
 color: rgb(40, 254, 20); background-color: rgba(0, 0, 0, 0.901961);" =
 class=3D""><span style=3D"font-variant-ligatures: no-common-ligatures" =
 class=3D"">&nbsp;#define&nbsp; &nbsp; &nbsp; &nbsp; CREAT(x, m) &nbsp; =
 &nbsp; do {&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; =
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; =
 &nbsp; &nbsp; &nbsp; &nbsp; \</span></div><div style=3D"margin: 0px; =
 line-height: normal; font-family: 'Andale Mono'; color: rgb(40, 254, =
 20); background-color: rgba(0, 0, 0, 0.901961);" class=3D""><span =
 style=3D"font-variant-ligatures: no-common-ligatures" class=3D"">&nbsp; =
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; int _creat_fd;&nbsp; =
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; =
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; =
 \</span></div><div style=3D"margin: 0px; line-height: normal; =
 font-family: 'Andale Mono'; color: rgb(40, 254, 20); background-color: =
 rgba(0, 0, 0, 0.901961);" class=3D""><span =
 style=3D"font-variant-ligatures: no-common-ligatures" class=3D"">- =
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; =
 ATF_REQUIRE_MSG((_creat_fd =3D creat((x), (m)) !=3D -1),&nbsp; &nbsp; =
 \</span></div><div style=3D"margin: 0px; line-height: normal; =
 font-family: 'Andale Mono'; color: rgb(40, 254, 20); background-color: =
 rgba(0, 0, 0, 0.901961);" class=3D""><span =
 style=3D"font-variant-ligatures: no-common-ligatures" class=3D"">+ =
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; =
 ATF_REQUIRE_MSG((_creat_fd =3D creat((x), (m))) !=3D -1,&nbsp; &nbsp; =
 \</span></div><div style=3D"margin: 0px; line-height: normal; =
 font-family: 'Andale Mono'; color: rgb(40, 254, 20); background-color: =
 rgba(0, 0, 0, 0.901961);" class=3D""><span =
 style=3D"font-variant-ligatures: no-common-ligatures" class=3D"">&nbsp; =
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; =
 "creat(%s, %x) failed: %s", (x), (m), &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; =
 &nbsp; &nbsp; \</span></div><div style=3D"margin: 0px; line-height: =
 normal; font-family: 'Andale Mono'; color: rgb(40, 254, 20); =
 background-color: rgba(0, 0, 0, 0.901961);" class=3D""><span =
 style=3D"font-variant-ligatures: no-common-ligatures" class=3D"">&nbsp; =
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; =
 strerror(errno)); &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; =
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; =
 \</span></div><div style=3D"margin: 0px; line-height: normal; =
 font-family: 'Andale Mono'; color: rgb(40, 254, 20); background-color: =
 rgba(0, 0, 0, 0.901961);" class=3D""><span =
 style=3D"font-variant-ligatures: no-common-ligatures" class=3D"">&nbsp; =
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; (void)close(_creat_fd); =
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; =
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; =
 \</span></div></div></div></body></html>=
 
 --Apple-Mail=_794D7605-18E0-44E5-B0FA-FD8BF22BBD2C--
 



Home | Main Index | Thread Index | Old Index