[ortp] fix another gcc warning and move all fixes to one patch
Dan Horák
sharkcz at fedoraproject.org
Tue Sep 27 10:22:14 UTC 2011
commit 9913a43eeacac8f7988cbef4766b5c177b36eef5
Author: Dan Horák <dan at danny.cz>
Date: Tue Sep 27 12:22:01 2011 +0200
fix another gcc warning and move all fixes to one patch
ortp-0.16.1-retval.patch | 20 ---------
...usedvar.patch => ortp-0.16.5-gcc-warnings.patch | 43 ++++++++++++++-----
ortp.spec | 12 +++--
3 files changed, 38 insertions(+), 37 deletions(-)
---
diff --git a/ortp-0.16.5-unusedvar.patch b/ortp-0.16.5-gcc-warnings.patch
similarity index 59%
rename from ortp-0.16.5-unusedvar.patch
rename to ortp-0.16.5-gcc-warnings.patch
index d168e43..e56b1c0 100644
--- a/ortp-0.16.5-unusedvar.patch
+++ b/ortp-0.16.5-gcc-warnings.patch
@@ -1,8 +1,28 @@
-diff --git a/src/stun.c b/src/stun.c
-index ccac58f..e0d7c80 100644
---- a/src/stun.c
-+++ b/src/stun.c
-@@ -1993,7 +1993,6 @@ stunSendTest( Socket myFd, StunAddress4 *dest,
+diff -up ortp-0.16.5/src/stun.c.gcc-warnings ortp-0.16.5/src/stun.c
+--- ortp-0.16.5/src/stun.c.gcc-warnings 2010-11-19 11:32:47.000000000 +0100
++++ ortp-0.16.5/src/stun.c 2011-09-27 12:07:26.000000000 +0200
+@@ -1196,6 +1196,7 @@ stunRand(void)
+ int maxFd=0;
+ struct timeval tv;
+ int e;
++ int res;
+
+ int fd=open("/dev/random",O_RDONLY);
+
+@@ -1218,7 +1219,11 @@ stunRand(void)
+ closesocket(fd);
+ return random();
+ }
+- read(fd,&tick,sizeof(tick));
++ res = read(fd,&tick,sizeof(tick));
++ if (res == -1)
++ {
++ ortp_error("stun: Failed to get data from random device\n");
++ }
+ closesocket(fd);
+ }
+ #else
+@@ -1993,7 +1998,6 @@ stunSendTest( Socket myFd, StunAddress4
bool_t changePort=FALSE;
bool_t changeIP=FALSE;
@@ -10,7 +30,7 @@ index ccac58f..e0d7c80 100644
StunMessage req;
char buf[STUN_MAX_MESSAGE_SIZE];
-@@ -2015,9 +2014,10 @@ stunSendTest( Socket myFd, StunAddress4 *dest,
+@@ -2015,9 +2019,10 @@ stunSendTest( Socket myFd, StunAddress4
case 4:
changeIP=TRUE;
break;
@@ -22,7 +42,7 @@ index ccac58f..e0d7c80 100644
default:
ortp_error("stun: Test %i is unkown\n", testNum);
return ; /* error */
-@@ -2162,7 +2162,7 @@ stunNatType( StunAddress4 *dest,
+@@ -2162,7 +2167,7 @@ stunNatType( StunAddress4 *dest,
bool_t respTestI=FALSE;
bool_t isNat=TRUE;
@@ -31,7 +51,7 @@ index ccac58f..e0d7c80 100644
StunAddress4 testImappedAddr;
bool_t respTestI2=FALSE;
bool_t mappedIpSame = TRUE;
-@@ -2345,8 +2345,8 @@ stunNatType( StunAddress4 *dest,
+@@ -2345,8 +2350,8 @@ stunNatType( StunAddress4 *dest,
if ( !respTestI )
{
@@ -42,10 +62,9 @@ index ccac58f..e0d7c80 100644
testImappedAddr.addr = resp.mappedAddress.ipv4.addr;
testImappedAddr.port = resp.mappedAddress.ipv4.port;
-diff --git a/src/tests/rtprecv.c b/src/tests/rtprecv.c
-index 1861592..5eee649 100644
---- a/src/tests/rtprecv.c
-+++ b/src/tests/rtprecv.c
+diff -up ortp-0.16.5/src/tests/rtprecv.c.gcc-warnings ortp-0.16.5/src/tests/rtprecv.c
+--- ortp-0.16.5/src/tests/rtprecv.c.gcc-warnings 2011-09-27 12:15:36.000000000 +0200
++++ ortp-0.16.5/src/tests/rtprecv.c 2011-09-27 12:16:35.000000000 +0200
@@ -163,8 +163,12 @@ int main(int argc, char*argv[])
/* this is to avoid to write to disk some silence before the first RTP packet is returned*/
if ((stream_received) && (err>0)) {
diff --git a/ortp.spec b/ortp.spec
index 612f5d2..de69ec9 100644
--- a/ortp.spec
+++ b/ortp.spec
@@ -1,6 +1,6 @@
Name: ortp
Version: 0.16.5
-Release: 1%{?dist}
+Release: 2%{?dist}
Summary: A C library implementing the RTP protocol (RFC3550)
Epoch: 1
@@ -8,8 +8,8 @@ Group: System Environment/Libraries
License: LGPLv2+ and VSL
URL: http://www.linphone.org/eng/documentation/dev/ortp.html
Source: http://download.savannah.gnu.org/releases/linphone/ortp/sources/%{name}-%{version}.tar.gz
-Patch0: %{name}-0.16.1-retval.patch
-Patch1: %{name}-0.16.5-unusedvar.patch
+# fixes for unused var, unused return value
+Patch0: %{name}-0.16.5-gcc-warnings.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
@@ -37,8 +37,7 @@ Libraries and headers required to develop software with ortp.
%prep
%setup0 -q
-%patch0 -p1 -b .retval
-%patch1 -p1 -b .unusedvar
+%patch0 -p1 -b .gcc-warnings
%{__perl} -pi.dot -e 's/^(HAVE_DOT\s+=)\s+NO$/\1 YES/;s/^(CALL_GRAPH\s+=)\s+NO$/\1 YES/;s/^(CALLER_GRAPH\s+=)\s+NO$/\1 YES/' ortp.doxygen.in
@@ -72,6 +71,9 @@ rm -rf $RPM_BUILD_ROOT
%{_libdir}/pkgconfig/ortp.pc
%changelog
+* Tue Sep 27 2011 Dan Horák <dan[at]danny.cz> - 1:0.16.5-2
+- fix another gcc warning and move all fixes to one patch
+
* Fri Sep 2 2011 Alexey Kurov <nucleo at fedoraproject.org> - 0.16.5-1
- ortp-0.16.5
- add BR: libsrtp-devel openssl-devel
More information about the scm-commits
mailing list