diff liboctave/file-ops.cc @ 10411:479cc8a0a846

use gnulib namespace
author John W. Eaton <jwe@octave.org>
date Mon, 15 Mar 2010 15:57:23 -0400
parents 323c9cbbd02a
children 12d25a1d84bf
line wrap: on
line diff
--- a/liboctave/file-ops.cc	Fri Mar 12 19:15:39 2010 -0500
+++ b/liboctave/file-ops.cc	Mon Mar 15 15:57:23 2010 -0400
@@ -373,13 +373,10 @@
 
   int status = -1;
 
-  status = mkdir (name.c_str (), mode);
+  status = gnulib::mkdir (name.c_str (), mode);
 
   if (status < 0)
-    {
-      using namespace std;
-      msg = strerror (errno);
-    }
+    msg = gnulib::strerror (errno);
 
   return status;
 }
@@ -402,13 +399,10 @@
   // don't have working mkfifo functions.  On those systems, mkfifo will
   // always return -1 and set errno.
 
-  status = mkfifo (name.c_str (), mode);
+  status = gnulib::mkfifo (name.c_str (), mode);
 
   if (status < 0)
-    {
-      using namespace std;
-      msg = strerror (errno);
-    }
+    msg = gnulib::strerror (errno);
 
   return status;
 }
@@ -428,13 +422,10 @@
 
   int status = -1;
 
-  status = link (old_name.c_str (), new_name.c_str ());
+  status = gnulib::link (old_name.c_str (), new_name.c_str ());
 
   if (status < 0)
-    {
-      using namespace std;
-      msg = strerror (errno);
-    }
+    msg = gnulib::strerror (errno);
 
   return status;
 }
@@ -454,13 +445,10 @@
 
   int status = -1;
 
-  status = symlink (old_name.c_str (), new_name.c_str ());
+  status = gnulib::symlink (old_name.c_str (), new_name.c_str ());
 
   if (status < 0)
-    {
-      using namespace std;
-      msg = strerror (errno);
-    }
+    msg = gnulib::strerror (errno);
 
   return status;
 }
@@ -482,13 +470,10 @@
 
   char buf[MAXPATHLEN+1];
 
-  status = readlink (path.c_str (), buf, MAXPATHLEN);
+  status = gnulib::readlink (path.c_str (), buf, MAXPATHLEN);
 
   if (status < 0)
-    {
-      using namespace std;
-      msg = strerror (errno);
-    }
+    msg = gnulib::strerror (errno);
   else
     {
       buf[status] = '\0';
@@ -514,13 +499,10 @@
 
   msg = std::string ();
 
-  status = rename (from.c_str (), to.c_str ());
+  status = gnulib::rename (from.c_str (), to.c_str ());
 
   if (status < 0)
-    {
-      using namespace std;
-      msg = strerror (errno);
-    }
+    msg = gnulib::strerror (errno);
 
   return status;
 }
@@ -539,13 +521,10 @@
 
   int status = -1;
 
-  status = rmdir (name.c_str ());
+  status = gnulib::rmdir (name.c_str ());
 
   if (status < 0)
-    {
-      using namespace std;
-      msg = strerror (errno);
-    }
+    msg = gnulib::strerror (errno);
 
   return status;
 }
@@ -651,13 +630,10 @@
 
   int status = -1;
 
-  status = unlink (name.c_str ());
+  status = gnulib::unlink (name.c_str ());
 
   if (status < 0)
-    {
-      using namespace std;
-      msg = strerror (errno);
-    }
+    msg = gnulib::strerror (errno);
 
   return status;
 }
@@ -690,10 +666,7 @@
       free (tmp);
     }
   else
-    {
-      using namespace std;
-      msg = strerror (errno);
-    }
+    msg = gnulib::strerror (errno);
 
   return retval;
 }
@@ -714,7 +687,7 @@
 
 #if defined (HAVE_CANONICALIZE_FILE_NAME)
 
-  char *tmp = ::canonicalize_file_name (name.c_str ());
+  char *tmp = gnulib::canonicalize_file_name (name.c_str ());
 
   if (tmp)
     {
@@ -815,10 +788,7 @@
 #endif
 
   if (retval.empty ())
-    {
-      using namespace std;
-      msg = strerror (errno);
-    }
+    msg = gnulib::strerror (errno);
 
   return retval;
 }