Author: simons
Date: 2010-06-24 17:51:04 +0000 (Thu, 24 Jun 2010)
New Revision: 22403

You can view the changes in this commit at:
   https://svn.nixos.org/viewvc/nix?rev=22403&view=rev

Modified:
   nix/trunk/src/libstore/build.cc
   nix/trunk/src/libstore/remote-store.cc
   nix/trunk/src/nix-worker/nix-worker.cc

Log:
Include <cstring> to ensure that strcpy(), strlen(), and memset() are declared.

An "using namespace std" was added locally in those functions that refer to
names from <cstring>. That is not pretty, but it's a very portable solution,
because strcpy() and friends will be found in both the 'std' and in the global
namespace.

Changes:

Modified: nix/trunk/src/libstore/build.cc
===================================================================
--- nix/trunk/src/libstore/build.cc     2010-06-24 16:43:42 UTC (rev 22402)
+++ nix/trunk/src/libstore/build.cc     2010-06-24 17:51:04 UTC (rev 22403)
@@ -25,6 +25,7 @@
 #include <unistd.h>
 #include <errno.h>
 #include <stdio.h>
+#include <cstring>
 
 #include <pwd.h>
 #include <grp.h>
@@ -2638,6 +2639,7 @@
         timeout.tv_sec = std::max((time_t) 0, lastWokenUp + wakeUpInterval - 
before);
     } else lastWokenUp = 0;
 
+    using namespace std;
     /* Use select() to wait for the input side of any logger pipe to
        become `available'.  Note that `available' (i.e., non-blocking)
        includes EOF. */

Modified: nix/trunk/src/libstore/remote-store.cc
===================================================================
--- nix/trunk/src/libstore/remote-store.cc      2010-06-24 16:43:42 UTC (rev 
22402)
+++ nix/trunk/src/libstore/remote-store.cc      2010-06-24 17:51:04 UTC (rev 
22403)
@@ -13,6 +13,7 @@
 
 #include <iostream>
 #include <unistd.h>
+#include <cstring>
 
 
 namespace nix {
@@ -158,6 +159,7 @@
     addr.sun_family = AF_UNIX;
     if (socketPathRel.size() >= sizeof(addr.sun_path))
         throw Error(format("socket path `%1%' is too long") % socketPathRel);
+    using namespace std;
     strcpy(addr.sun_path, socketPathRel.c_str());
     
     if (connect(fdSocket, (struct sockaddr *) &addr, sizeof(addr)) == -1)

Modified: nix/trunk/src/nix-worker/nix-worker.cc
===================================================================
--- nix/trunk/src/nix-worker/nix-worker.cc      2010-06-24 16:43:42 UTC (rev 
22402)
+++ nix/trunk/src/nix-worker/nix-worker.cc      2010-06-24 17:51:04 UTC (rev 
22403)
@@ -7,6 +7,7 @@
 #include "globals.hh"
 
 #include <iostream>
+#include <cstring>
 #include <unistd.h>
 #include <signal.h>
 #include <sys/types.h>
@@ -111,6 +112,7 @@
    time and wouldn't have to worry about races. */
 static void sigPollHandler(int sigNo)
 {
+    using namespace std;
     try {
         /* Check that the far side actually closed.  We're still
            getting spurious signals every once in a while.  I.e.,

_______________________________________________
nix-commits mailing list
[email protected]
http://mail.cs.uu.nl/mailman/listinfo/nix-commits

Reply via email to