Bug 56725 - [patch, non-maintainer] web/webredirect: Fix build with gcc 2.95.4
Summary: [patch, non-maintainer] web/webredirect: Fix build with gcc 2.95.4
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: Gerald Pfeifer
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-09-12 00:30 UTC by Simon Barner
Modified: 2003-09-22 23:29 UTC (History)
1 user (show)

See Also:


Attachments
file.diff (1.12 KB, patch)
2003-09-12 00:30 UTC, Simon Barner
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Simon Barner 2003-09-12 00:30:16 UTC
This port was broken by the upgrade to the latest release.

Fix: Please apply the following patch (creates 2 new patch files):
How-To-Repeat: 
Build on -stable.
Comment 1 Gerald Pfeifer freebsd_committer freebsd_triage 2003-09-21 13:25:09 UTC
Responsible Changed
From-To: freebsd-ports-bugs->gerald

I'm going to take care of this.
Comment 2 Rasmus Kaj 2003-09-22 18:26:18 UTC
>>>>> "GP" == Gerald Pfeifer <gerald@pfeifer.com> writes:

First of all, sorry for not getting back to you earlier.

 GP> Do you have any objections to me committing this fix, or would you
 GP> prefer a different patch?

No objections.  Allthoug when I got to a FreeBSD 4.7 host to try it,
it complained about my calling accept with a size_t as third arg, so I
changed the webredirect.cc patch as below.

 GP> Simon, in what respect will the output be broken?  [...]

In fact the output (logging, actually) isn't broken at all, since the
problem that the original workaround is for was only a problem on gcc
3.  Happy me.

-- snip -- new version of files/patch-webredirect.cc -- snip --
--- webredirect.cc.orig Fri Sep 12 00:55:12 2003
+++ webredirect.cc      Fri Sep 12 01:04:57 2003
@@ -7,6 +7,7 @@
 #include <iostream>
 #include <stdexcept>
 #include <map>
+#include <memory>
 #include <incu/error.hh>
 #include <incu/log.hh>
 #include <incu/socket.hh>
@@ -62,7 +62,7 @@
 
 int checked_accept(int serv_sock) {
   struct sockaddr_in remote;
-  size_t len = sizeof(remote);
+  socklen_t len = sizeof(remote);
   
   int remote_fd = accept(serv_sock, reinterpret_cast<sockaddr*>(&remote),
                         &len);
-- snip -- end of files/patch-webredirect.cc -- snip --


-- 
Rasmus Kaj ----------------------------------------------- rasmus@kaj.se
 \                                                       E Pluribus Unix
  \------------------------------------- http://www.stacken.kth.se/~kaj/
Comment 3 Gerald Pfeifer freebsd_committer freebsd_triage 2003-09-22 23:29:14 UTC
State Changed
From-To: open->closed

Patch(es) applied, and in time for 4.9-RELEASE. Thanks!