Closed Bug 988910 Opened 9 years ago Closed 9 years ago

xpcom/base/nsDumpUtils.cpp:56:52: error: 'write' was not declared in this scope

Categories

(Core :: XPCOM, defect)

31 Branch
x86_64
FreeBSD
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla31

People

(Reporter: jbeich, Assigned: jbeich)

References

Details

Attachments

(2 files)

Attached patch fixSplinter Review
Not sure where the declaration is bootlegged on Linux from.

In file included from xpcom/base/Unified_cpp_xpcom_base0.cpp:106:
xpcom/base/nsDumpUtils.cpp:56:5: error:
      use of undeclared identifier 'write'
    write(sDumpPipeWriteFd, &signum, sizeof(signum));
    ^
xpcom/base/nsDumpUtils.cpp:102:5: error:
      use of undeclared identifier 'close'
    close(mFd);
    ^
xpcom/base/nsDumpUtils.cpp:172:7: error:
      use of undeclared identifier 'pipe'
  if (pipe(pipeFds)) {
      ^
xpcom/base/nsDumpUtils.cpp:200:3: error:
      use of undeclared identifier 'close'
  close(pipeWriteFd);
  ^
xpcom/base/nsDumpUtils.cpp:210:25: error:
      use of undeclared identifier 'read'
  ssize_t numReceived = read(aFd, &signum, sizeof(signum));
                        ^
xpcom/base/nsDumpUtils.cpp:316:7: error:
      use of undeclared identifier 'unlink'; did you mean 'inline'?
  if (unlink(path.get())) {
      ^
xpcom/base/nsDumpUtils.cpp:348:5: error:
      use of undeclared identifier 'close'
    close(fd);
    ^
xpcom/base/nsDumpUtils.cpp:363:13: error:
      use of undeclared identifier 'read'
    nread = read(aFd, buf, sizeof(buf));
            ^
8 errors generated.
gmake[1]: *** [Unified_cpp_xpcom_base0.o] Error 1
Attachment #8397880 - Flags: review?(n.nethercote)
Comment on attachment 8397880 [details] [diff] [review]
fix

Review of attachment 8397880 [details] [diff] [review]:
-----------------------------------------------------------------

Looks fine, but asking the author of the code to review such changes is generally a good idea.
Attachment #8397880 - Flags: review?(n.nethercote) → review+
(In reply to Nicholas Nethercote [:njn] from comment #1)
> Looks fine, but asking the author of the code to review such changes is
> generally a good idea.

Bug 964636 only moved read/write/close calls that originate from bug 788021. However, unistd.h was added before for getpid in bug 791366 and bug 800486. And I'm not sure :alphan can r+ patches for memory reporter code.
Keywords: checkin-needed
Hi Jan,
I have tried to build all version on try server.
https://tbpl.mozilla.org/?tree=Try&rev=2804a404f815
However, I didn't meet this error.
Could you point out where did you meet this problem?
Thanks and sorry about the inconvenience.
Flags: needinfo?(jbeich)
On FreeBSD 11 (trunk) with either clang-3.4 or gcc-4.8. It's one of non-TBPL XP_UNIX and POSIX platforms where read/write/close are declared in unistd.h. FreeBSD supports dumping about:memory upon SIGRTMIN since bug 946560.

http://pubs.opengroup.org/onlinepubs/9699919799/functions/read.html
Flags: needinfo?(jbeich)
https://hg.mozilla.org/mozilla-central/rev/bce5074f6799
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla31
You need to log in before you can comment on or make changes to this bug.