Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 30 Sep 2006 14:32:44 +0200
From:      Matteo Riondato <matteo@freebsd.org>
To:        freebsd-acpi@freebsd.org
Subject:   Powerd patch review
Message-ID:  <20060930123244.GA29307@kaiser.sig11.org>

next in thread | raw e-mail | index | archive | help

--Bu8it7iiRSEf40bY
Content-Type: multipart/mixed; boundary="JP+T4n/bALQSJXh8"
Content-Disposition: inline


--JP+T4n/bALQSJXh8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

Hi folks,
   I'm writing you to ask if you could be so kind to review the
attached patch to src/usr.sbin/powerd/powerd.c . It should fix the
problem descripted in PR bin/97198. I haven't a broken BIOS to test if
it really works, but it should.=20
Thanks
Best regards
P.s. I'm not subscribed to the list, so please CC me.
--=20
Matteo Riondato
FreeBSD Committer (http://www.freebsd.org)
G.U.F.I. Staff Member (http://www.gufi.org)
FreeSBIE Developer (http://www.freesbie.org)

--JP+T4n/bALQSJXh8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="powerd.c.diff"
Content-Transfer-Encoding: quoted-printable

Index: powerd.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: /home/rionda/branch/ncvs/src/usr.sbin/powerd/powerd.c,v
retrieving revision 1.20
diff -u -r1.20 powerd.c
--- powerd.c	19 Feb 2006 00:40:28 -0000	1.20
+++ powerd.c	29 Sep 2006 15:55:47 -0000
@@ -182,9 +182,22 @@
 			free(*power);
 			return (-1);
 		}
+		if (i > 0) {
+			if ((*freqs)[i] =3D=3D (*freqs)[i-1]) {
+				i--;
+				(*numfreqs)--;
+			}
+		}
 		p =3D q + 1;
 	}
=20
+	if ((*freqs =3D reallocf(*freqs, *numfreqs * sizeof(int))) =3D=3D
+				NULL) {
+		free(freqstr);
+		free(*power);
+		return (-1);
+	}
+
 	free(freqstr);
 	return (0);
 }

--JP+T4n/bALQSJXh8--

--Bu8it7iiRSEf40bY
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (FreeBSD)

iD8DBQFFHmPs2Mp4pR7Fa+wRAvPQAJ99PaUkoaMgut85LV+kUDAvtDg5ZgCeNGSe
8DmQaRpiZF462VbyHRs3eTM=
=bpP5
-----END PGP SIGNATURE-----

--Bu8it7iiRSEf40bY--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20060930123244.GA29307>