ericmckean / mozc

Automatically exported from code.google.com/p/mozc
0 stars 0 forks source link

build fail of ipc/unix_ipc.cc, FreeBSD #39

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
version: mozc-0.13.464.102
target file: ipc/unix_ipc.cc
category: build fail
OS: FreeBSD 9-CURRENT / 8.1-RELEASE
CC: gcc 4.2.1 (FreeBSD default compiler)

1)

  FreeBSD needs "sys/ucred.h". Please add it.

2)

  In socket, FreeBSD uses the same way of MacOSX. Please add FreeBSD
  as the same as OSX.

3) 

  Follow lines look strange.

----
   if (!IsAbstractSocket(server_address_)) {
     // Linux does not use files for IPC.
     ::chmod(server_address_.c_str(), 0600);
   }
   if (::bind(socket_, reinterpret_cast<sockaddr *>(&addr), sun_len) != 0) {
     // The UNIX domain socket file (server_address_) already exists?
     LOG(FATAL) << "bind() failed: " << strerror(errno);
     return;
   }
----

    Is it should be as follow?

----
   if (::bind(socket_, reinterpret_cast<sockaddr *>(&addr), sun_len) != 0) {
     // The UNIX domain socket file (server_address_) already exists?
     LOG(FATAL) << "bind() failed: " << strerror(errno);
     return;
   }
   if (!IsAbstractSocket(server_address_)) {
     // Linux does not use files for IPC.
     ::chmod(server_address_.c_str(), 0600);
   }
----

    At least in FreeBSD, this code change is needed.

Original issue reported on code.google.com by daichig...@gmail.com on 20 Sep 2010 at 3:43

GoogleCodeExporter commented 9 years ago

Original comment by yukawa@google.com on 1 Apr 2012 at 2:16