r39439 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r39438‎ | r39439 | r39440 >
Date:20:36, 15 August 2008
Author:river
Status:old
Tags:
Comment:
- fix errors with sun c++
- remove unneeded link libraries
Modified paths:
  • /trunk/tools/switchboard2/Makefile (modified) (history)
  • /trunk/tools/switchboard2/main.cc (modified) (history)
  • /trunk/tools/switchboard2/process.cc (modified) (history)
  • /trunk/tools/switchboard2/util.cc (modified) (history)
  • /trunk/tools/switchboard2/version.h (modified) (history)

Diff [purge]

Index: trunk/tools/switchboard2/util.cc
@@ -12,12 +12,15 @@
1313 #include <unistd.h>
1414
1515 #include <cerrno>
 16+#include <cstdlib>
 17+#include <cstring>
1618
1719 #include "util.h"
1820
1921 ssize_t
2022 timed_read(int fd, void *buf, std::size_t nbytes, int timeout)
2123 {
 24+ using std::memset;
2225 if (timeout > -1) {
2326 struct timeval tv;
2427 tv.tv_sec = timeout;
@@ -40,6 +43,7 @@
4144 ssize_t
4245 timed_write(int fd, void const *buf, std::size_t nbytes, int timeout)
4346 {
 47+ using std::memset;
4448 if (timeout > -1) {
4549 struct timeval tv;
4650 tv.tv_sec = timeout;
Index: trunk/tools/switchboard2/process.cc
@@ -113,9 +113,9 @@
114114 {
115115 LOG4CXX_DEBUG(logger, boost::format("connecting to process socket... %s") % bindpath_);
116116 struct sockaddr_un addr;
117 - memset(&addr, 0, sizeof(addr));
 117+ std::memset(&addr, 0, sizeof(addr));
118118 addr.sun_family = AF_UNIX;
119 - strcpy(addr.sun_path, bindpath_.c_str());
 119+ std::strcpy(addr.sun_path, bindpath_.c_str());
120120
121121 return ::connect(socket, (sockaddr *) &addr, sizeof(addr));
122122 }
Index: trunk/tools/switchboard2/main.cc
@@ -42,7 +42,7 @@
4343 #include "version.h"
4444 #include "process_factory.h"
4545
46 - void * acceptor_thread(void *);
 46+ extern "C" void * acceptor_thread(void *);
4747
4848 extern "C" void
4949 sigexit(int)
@@ -118,7 +118,7 @@
119119 struct sockaddr_un addr;
120120 int lsnsock;
121121 std::memset(&addr, 0, sizeof(addr));
122 - strncpy(addr.sun_path, mainconf.listeners[i].host.c_str(), sizeof(addr.sun_path) - 1);
 122+ std::strncpy(addr.sun_path, mainconf.listeners[i].host.c_str(), sizeof(addr.sun_path) - 1);
123123 addr.sun_family = AF_UNIX;
124124
125125 unlink(addr.sun_path);
@@ -353,7 +353,7 @@
354354 process_factory::instance().cleanup_thread();
355355 }
356356
357 -void *
 357+extern "C" void *
358358 acceptor_thread(void *arg)
359359 {
360360 int fd = reinterpret_cast<intptr_t>(arg);
Index: trunk/tools/switchboard2/version.h
@@ -10,6 +10,6 @@
1111 #ifndef VERSION_H
1212 #define VERSION_H
1313
14 -#define SB_VERSION "V-2.0.6"
 14+#define SB_VERSION "V-2.0.7"
1515
1616 #endif /* !VERSION_H */
Index: trunk/tools/switchboard2/Makefile
@@ -5,7 +5,7 @@
66 CFLAGS = $(EXTRA_CFLAGS)
77 CXXFLAGS = $(EXTRA_CXXFLAGS)
88 LDFLAGS = $(EXTRA_LDFLAGS)
9 -LIBS = -llog4cxx -lboost_system$(BOOSTTAG) -lboost_signals$(BOOSTTAG) $(EXTRA_LIBS)
 9+LIBS = -llog4cxx $(EXTRA_LIBS)
1010
1111 CONFIG_FLAGS = \
1212 -DPREFIX=\"$(PREFIX)\" \

Status & tagging log