myserver-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[myserver-commit] [SCM] GNU MyServer branch, master, updated. 0_9_1-61-g


From: Giuseppe Scrivano
Subject: [myserver-commit] [SCM] GNU MyServer branch, master, updated. 0_9_1-61-g2148d40
Date: Wed, 10 Feb 2010 22:49:24 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU MyServer".

The branch, master has been updated
       via  2148d400ca19fc5db7f71ddc3876cbe9b5a80774 (commit)
       via  494b37b8e113e4f848cfd2329a03516810b6a604 (commit)
       via  e4d4e6b0d06a6427d42ecade59cc807747a38f7f (commit)
       via  9e3b8dec0ca55ede7737acf090ebf4b903b140b7 (commit)
      from  c52b13aca2ca45c61144b3aa3b58587838496118 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------


commit 2148d400ca19fc5db7f71ddc3876cbe9b5a80774
Author: Giuseppe Scrivano <address@hidden>
Date:   Wed Feb 10 23:32:15 2010 +0100

    Specify the gettext library to the linker.

diff --git a/myserver/binaries/web/cgi-src/math_sum/Makefile.am 
b/myserver/binaries/web/cgi-src/math_sum/Makefile.am
index 307a8f2..e29729d 100644
--- a/myserver/binaries/web/cgi-src/math_sum/Makefile.am
+++ b/myserver/binaries/web/cgi-src/math_sum/Makefile.am
@@ -10,7 +10,7 @@ math_sum.mscgi : $(libmath_sum_a_OBJECTS) 
$(libmath_sum_a_DEPENDENCIES)
        -rm -f math_sum.mscgi
        $(CXX) $(libmath_sum_a_OBJECTS) ../../../../src/libmyserver.a  
../../../../lib/libgnu.a \
         $(libmath_sum_a_LIBADD) $(PTHREAD_LIB) $(IDN_LIB) $(XNET_LIB) 
$(DL_LIB) $(ZLIB_LIB)\
-        $(XML_LIBS) $(LDFLAGS) -o math_sum.mscgi -shared $(CXXFLAGS) 
$(XML_CFLAGS)
+        $(XML_LIBS) $(INTLLIBS) $(LDFLAGS) -o math_sum.mscgi -shared 
$(CXXFLAGS) $(XML_CFLAGS)
 
 install : math_sum.mscgi
        $(INSTALL) -D 'math_sum.mscgi' 
'$(DESTDIR)$(prefix)/var/web/cgi-bin/math_sum.mscgi'
diff --git a/myserver/binaries/web/cgi-src/post/Makefile.am 
b/myserver/binaries/web/cgi-src/post/Makefile.am
index 9821de1..ee1f50b 100644
--- a/myserver/binaries/web/cgi-src/post/Makefile.am
+++ b/myserver/binaries/web/cgi-src/post/Makefile.am
@@ -10,7 +10,7 @@ post.mscgi : $(libpost_a_OBJECTS) $(libpost_a_DEPENDENCIES)
        -rm -f post.mscgi
        $(CXX) $(libpost_a_OBJECTS) ../../../../src/libmyserver.a  
../../../../lib/libgnu.a \
         $(libpost_a_LIBADD) $(PTHREAD_LIB) $(IDN_LIB) $(XNET_LIB) $(DL_LIB) 
$(ZLIB_LIB)\
-        $(XML_LIBS) $(LDFLAGS) -o post.mscgi -shared $(CXXFLAGS) $(XML_CFLAGS)
+        $(XML_LIBS) $(INTLLIBS) $(LDFLAGS) -o post.mscgi -shared $(CXXFLAGS) 
$(XML_CFLAGS)
 
 install : post.mscgi
        $(INSTALL) -D 'post.mscgi' 
'$(DESTDIR)$(prefix)/var/web/cgi-bin/post.mscgi'
diff --git a/myserver/lib/Makefile.am b/myserver/lib/Makefile.am
index 03c83fb..4063aae 100644
--- a/myserver/lib/Makefile.am
+++ b/myserver/lib/Makefile.am
@@ -33,7 +33,3 @@ GNULIB_SHUTDOWN=1
 GNULIB_ACCEPT4=1
 
 include gnulib.mk
-
-# Dirty hack.  FIXME!
-all-local: libgnu.la
-       cp .libs/libgnu.a .
diff --git a/myserver/src/Makefile.am b/myserver/src/Makefile.am
index 10ae987..3287ef7 100644
--- a/myserver/src/Makefile.am
+++ b/myserver/src/Makefile.am
@@ -8,7 +8,7 @@ myserver_CXXFLAGS = $(CXXFLAGS) -DHOST_STR=\"$(build)\" 
-DPREFIX=\"$(prefix)\"
 myserver_LDFLAGS =  -rdynamic
 myserver_LDADD = libmyserver.a $(PTHREAD_LIB) $(IDN_LIB) \
        $(XNET_LIB) $(DL_LIB) $(ZLIB_LIB) \
-       $(XML_LIBS)  ../lib/libgnu.a $(LDFLAGS)
+       $(XML_LIBS)  ../lib/libgnu.a $(INTLLIBS) $(LDFLAGS)
 
 clean-libmyserver.a:
        rm -f libmyserver.a
diff --git a/myserver/tests/Makefile.am b/myserver/tests/Makefile.am
index 98f7ad3..31ac38e 100644
--- a/myserver/tests/Makefile.am
+++ b/myserver/tests/Makefile.am
@@ -66,7 +66,7 @@ test_suite_SOURCES =          main.cpp                        
        \
 
 test_suite_LDADD = ../src/libmyserver.a  ../lib/libgnu.a $(CPPUNIT_LDFLAGS) \
        $(PTHREAD_LIB)  $(IDN_LIB) $(XNET_LIB) $(DL_LIB) $(ZLIB_LIB) \
-       $(XML_LIBS)  $(LDFLAGS)
+       $(XML_LIBS) $(INTLLIBS) $(LDFLAGS)
 
 install:
 



commit 494b37b8e113e4f848cfd2329a03516810b6a604
Merge: e4d4e6b c52b13a
Author: Giuseppe Scrivano <address@hidden>
Date:   Wed Feb 10 19:21:10 2010 +0100

    Merge branch 'master' of file:///home/gscrivano/myserver/myserver




commit e4d4e6b0d06a6427d42ecade59cc807747a38f7f
Merge: 9e3b8de 43a210f
Author: Giuseppe Scrivano <address@hidden>
Date:   Wed Feb 10 19:20:25 2010 +0100

    Merge branch 'master' of file:///home/gscrivano/myserver/myserver




commit 9e3b8dec0ca55ede7737acf090ebf4b903b140b7
Author: Giuseppe Scrivano <address@hidden>
Date:   Wed Feb 10 01:00:19 2010 +0100

    Remove legacy code for files handling.  Use new gnulib modules.

diff --git a/myserver/bootstrap.conf b/myserver/bootstrap.conf
index 9741cc5..02a2797 100644
--- a/myserver/bootstrap.conf
+++ b/myserver/bootstrap.conf
@@ -27,9 +27,11 @@ accept
 argp
 bind
 chdir-long
+close
 crypto/md5
 crypto/sha1
 connect
+fsync
 getcwd
 gethostname
 getsockname
@@ -40,9 +42,14 @@ listen
 malloc
 mktime
 nproc
+open
 pipe
+read-file
+readlink
 recv
 regex
+remove
+rename
 select
 send
 setsockopt
@@ -51,6 +58,7 @@ snprintf
 socket
 sysexits
 unlink
+write
 "
 
 gnulib_extra_files="
diff --git a/myserver/include/base/hash_map/hash_map.h 
b/myserver/include/base/hash_map/hash_map.h
index ddecd19..cac8a13 100644
--- a/myserver/include/base/hash_map/hash_map.h
+++ b/myserver/include/base/hash_map/hash_map.h
@@ -30,6 +30,8 @@
 # include <vector>
 # include <string>
 
+# undef remove
+
 using namespace std;
 
 //hashmap Hash-Key-Value Struct
diff --git a/myserver/include/connections_scheduler/connections_scheduler.h 
b/myserver/include/connections_scheduler/connections_scheduler.h
index fb900cd..6e79569 100644
--- a/myserver/include/connections_scheduler/connections_scheduler.h
+++ b/myserver/include/connections_scheduler/connections_scheduler.h
@@ -29,6 +29,8 @@
 # include <include/base/thread/thread.h>
 # include <include/base/socket_pair/socket_pair.h>
 
+# undef remove
+
 # include <list>
 # include <queue>
 
diff --git a/myserver/include/filter/stream.h b/myserver/include/filter/stream.h
index 3c03800..e56289c 100644
--- a/myserver/include/filter/stream.h
+++ b/myserver/include/filter/stream.h
@@ -28,11 +28,7 @@ typedef u_int Handle;
 typedef int Handle;
 # endif
 
-# ifdef WIN32
-typedef HANDLE FileHandle;
-# else
 typedef int FileHandle;
-# endif
 
 /*!
  *Abstract class to handle virtual data streams.
diff --git a/myserver/include/log/log_manager.h 
b/myserver/include/log/log_manager.h
index a66f807..99cca17 100644
--- a/myserver/include/log/log_manager.h
+++ b/myserver/include/log/log_manager.h
@@ -34,6 +34,8 @@
 
 using namespace std;
 
+# undef remove
+
 class LogManager
 {
 public:
diff --git a/myserver/src/base/file/file.cpp b/myserver/src/base/file/file.cpp
index 3af69b1..53a62ee 100644
--- a/myserver/src/base/file/file.cpp
+++ b/myserver/src/base/file/file.cpp
@@ -22,34 +22,30 @@ along with this program.  If not, see 
<http://www.gnu.org/licenses/>.
 #include <include/base/string/stringutils.h>
 #include <include/base/file/files_utility.h>
 
-#ifndef WIN32
 extern "C"
 {
-# include <fcntl.h>
-# include <unistd.h>
-# include <sys/types.h>
-# include <sys/stat.h>
-# include <errno.h>
-# include <stdio.h>
+#include <fcntl.h>
+#include <unistd.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <errno.h>
+#include <stdio.h>
+#include <fcntl.h>
+#include <stdlib.h>
+#include <string.h>
+#include <math.h>
+#include <time.h>
+
+#ifdef SENDFILE
 # include <fcntl.h>
 # include <stdlib.h>
-# include <string.h>
-# include <math.h>
-# include <time.h>
-
-# ifdef SENDFILE
-#  include <fcntl.h>
-#  include <stdlib.h>
-#  include <stdio.h>
-#  include <sys/sendfile.h>
-#  include <sys/stat.h>
-#  include <sys/types.h>
-#  include <unistd.h>
-# endif
-
-
-}
+# include <stdio.h>
+# include <sys/sendfile.h>
+# include <sys/stat.h>
+# include <sys/types.h>
+# include <unistd.h>
 #endif
+}
 
 #include <string>
 #include <sstream>
@@ -100,13 +96,9 @@ int File::writeToFile (const char* buffer, u_long 
buffersize, u_long* nbw)
     *nbw = 0;
     return 1;
   }
-#ifdef WIN32
-  int ret = WriteFile (handle, buffer, buffersize, nbw, NULL);
-  return (!ret);
-#else
-  *nbw =  ::write (handle, buffer, buffersize);
+
+  *nbw = ::write (handle, buffer, buffersize);
   return (*nbw == buffersize) ? 0 : 1 ;
-#endif
 }
 
 /*!
@@ -115,7 +107,7 @@ int File::writeToFile (const char* buffer, u_long 
buffersize, u_long* nbw)
  *\param opt Specify how open the file.
  */
 File::File (char *nfilename, int opt)
-  : handle ((FileHandle)-1)
+  : handle ((FileHandle) -1)
 {
   openFile (nfilename, opt);
 }
@@ -126,18 +118,11 @@ File::File (char *nfilename, int opt)
  */
 int File::truncate (u_long size)
 {
-#ifdef WIN32
-  if (seek (size))
-    return 1;
-
-  return !SetEndOfFile (handle);
-#else
   int err = ftruncate (handle, size);
   if (err)
     return err;
 
   return seek (size);
-#endif
 }
 
 /*!
@@ -150,72 +135,12 @@ int File::truncate (u_long size)
 int File::openFile (const char* nfilename,u_long opt)
 {
   long ret = 0;
-
-  filename.assign (nfilename);
-#ifdef WIN32
-  u_long creationFlag = 0;
-  u_long openFlag = 0;
-  u_long attributeFlag = 0;
-  SECURITY_ATTRIBUTES sa = {0};
-  sa.nLength = sizeof (sa);
-
-  if (opt & File::NO_INHERIT)
-    sa.bInheritHandle = FALSE;
-  else
-    sa.bInheritHandle = TRUE;
-
-  sa.lpSecurityDescriptor = NULL;
-
-  if (opt & File::FILE_OPEN_ALWAYS)
-    creationFlag |= OPEN_ALWAYS;
-  if (opt & File::OPEN_IF_EXISTS)
-    creationFlag |= OPEN_EXISTING;
-  if (opt & File::FILE_CREATE_ALWAYS)
-    creationFlag |= CREATE_ALWAYS;
-
-  if (opt & File::READ)
-    openFlag |= GENERIC_READ;
-  if (opt & File::WRITE)
-    openFlag |= GENERIC_WRITE;
-
-  if (opt & File::TEMPORARY)
-  {
-    openFlag |= FILE_ATTRIBUTE_TEMPORARY;
-    attributeFlag |= FILE_FLAG_DELETE_ON_CLOSE;
-  }
-  if (opt & File::HIDDEN)
-    openFlag|= FILE_ATTRIBUTE_HIDDEN;
-
-  if (attributeFlag == 0)
-    attributeFlag = FILE_ATTRIBUTE_NORMAL;
-
-  handle = CreateFile (filename.c_str (), openFlag,
-                       FILE_SHARE_READ|FILE_SHARE_WRITE,
-                       &sa, creationFlag, attributeFlag, NULL);
-
-  if (handle == INVALID_HANDLE_VALUE)
-    {
-      filename.clear ();
-      return 1;
-    }
-  else
-    {
-      if (opt & File::APPEND)
-        ret = seek (getFileSize ());
-      else
-        ret = seek (0);
-
-      if (ret)
-        {
-          close ();
-          filename.clear ();
-          return 1;
-        }
-    }
-#else
   struct stat fStats;
   int flags;
 
+
+  filename.assign (nfilename);
+
   if ((opt & File::READ) && (opt & File::WRITE))
     flags = O_RDWR;
   else if (opt & File::READ)
@@ -244,9 +169,6 @@ int File::openFile (const char* nfilename,u_long opt)
     unlink (filename.c_str ()); /* It will be removed on close.  */
 
   return handle < 0;
-#endif
-
-  return 0;
 }
 
 /*!
@@ -320,18 +242,13 @@ int File::createTemporaryFile (const char* filename)
 int File::close ()
 {
   int ret = 0;
-  if (handle != (FileHandle) -1)
+  if (handle != -1)
     {
-#ifdef WIN32
-      ret = !FlushFileBuffers (handle);
-      ret |= !CloseHandle (handle);
-#else
       ret = fsync (handle);
       ret |= ::close (handle);
-#endif
-  }
+    }
   filename.clear ();
-  handle = (FileHandle) -1;
+  handle = -1;
   return ret;
 }
 
@@ -342,20 +259,12 @@ int File::close ()
 u_long File::getFileSize ()
 {
   u_long ret;
-#ifdef WIN32
-  ret = GetFileSize (handle, NULL);
-  if (ret != INVALID_FILE_SIZE)
-    return ret;
-  else
-    return (u_long)-1;
-#else
   struct stat fStats;
   ret = fstat (handle, &fStats);
   if (ret)
     return (u_long)(-1);
   else
     return fStats.st_size;
-#endif
 }
 
 /*!
@@ -365,13 +274,8 @@ u_long File::getFileSize ()
 int File::seek (u_long initialByte)
 {
   u_long ret;
-#ifdef WIN32
-  ret = SetFilePointer (handle, initialByte, NULL, FILE_BEGIN);
-  return (ret == INVALID_SET_FILE_POINTER) ? 1 : 0;
-#else
   ret = lseek (handle, initialByte, SEEK_SET);
   return (ret != initialByte ) ? 1 : 0;
-#endif
 }
 
 /*!
@@ -381,11 +285,7 @@ int File::seek (u_long initialByte)
  */
 u_long File::getSeek ()
 {
-#ifdef WIN32
-  return SetFilePointer (handle, 0, NULL, FILE_CURRENT);
-#else
   return lseek (handle, 0, SEEK_CUR);
-#endif
 }
 
 /*!
@@ -430,13 +330,9 @@ int File::write (const char* buffer, u_long len, u_long 
*nbw)
  */
 int File::read (char* buffer, u_long buffersize, u_long* nbr)
 {
-#ifdef WIN32
-  return !ReadFile (handle, buffer, buffersize, nbr, NULL);
-#else
   int ret  = ::read (handle, buffer, buffersize);
   *nbr = (u_long) ret;
   return (ret == -1);
-#endif
 }
 
 /*!
diff --git a/myserver/src/base/file/files_utility.cpp 
b/myserver/src/base/file/files_utility.cpp
index 58c8d67..ca18a92 100644
--- a/myserver/src/base/file/files_utility.cpp
+++ b/myserver/src/base/file/files_utility.cpp
@@ -142,11 +142,7 @@ int FilesUtility::getPathRecursionLevel (const char* path)
  */
 int FilesUtility::renameFile (const char* before, const char* after)
 {
-#ifdef WIN32
-  return MoveFile (before, after) ? 0 : 1;
-#else
   return rename (before, after);
-#endif
 }
 
 /*!
@@ -157,9 +153,6 @@ int FilesUtility::renameFile (const char* before, const 
char* after)
  */
 int FilesUtility::copyFile (const char* src, const char* dest, int overwrite)
 {
-#ifdef WIN32
-  return CopyFile (src, dest, overwrite ? FALSE : TRUE) ? 0 : 1;
-#else
   File srcFile;
   File destFile;
   char buffer[4096];
@@ -181,7 +174,6 @@ int FilesUtility::copyFile (const char* src, const char* 
dest, int overwrite)
   destFile.close ();
 
   return ret;
-#endif
 }
 
 /*!
@@ -225,16 +217,11 @@ int FilesUtility::copyFile (File& src, File& dest)
 int FilesUtility::deleteFile (const char *filename)
 {
   int ret;
-#ifdef WIN32
-  ret = DeleteFile (filename);
-  if (ret)
-    return 0;
-#else
   ret = remove (filename);
 
   if (ret && errno == ENOENT)
     ret = 0;
-#endif
+
   return ret;
 }
 
diff --git a/myserver/src/connections_scheduler/connections_scheduler.cpp 
b/myserver/src/connections_scheduler/connections_scheduler.cpp
index aeed1fd..d360185 100644
--- a/myserver/src/connections_scheduler/connections_scheduler.cpp
+++ b/myserver/src/connections_scheduler/connections_scheduler.cpp
@@ -17,6 +17,8 @@
 
 #include "myserver.h"
 
+#undef remove
+
 #include <include/connections_scheduler/connections_scheduler.h>
 #include <include/server/server.h>
 
diff --git a/myserver/src/log/log_manager.cpp b/myserver/src/log/log_manager.cpp
index 104a389..e47baf1 100644
--- a/myserver/src/log/log_manager.cpp
+++ b/myserver/src/log/log_manager.cpp
@@ -16,6 +16,9 @@
 */
 
 #include "myserver.h"
+
+#undef remove
+
 #include <include/log/log_manager.h>
 #include <include/server/server.h>
 
diff --git a/myserver/tests/test_hashmap.cpp b/myserver/tests/test_hashmap.cpp
index c21c07e..ee17730 100644
--- a/myserver/tests/test_hashmap.cpp
+++ b/myserver/tests/test_hashmap.cpp
@@ -16,7 +16,11 @@
  */
 
 #include "myserver.h"
+
+#undef remove
+
 #include <include/base/hash_map/hash_map.h>
+
 #include <cppunit/CompilerOutputter.h>
 #include <cppunit/extensions/TestFactoryRegistry.h>
 #include <cppunit/ui/text/TestRunner.h>
@@ -78,10 +82,8 @@ public:
     CPPUNIT_ASSERT_EQUAL (map->empty (), true);
     map->put ((char*)"key", 0);
     CPPUNIT_ASSERT_EQUAL (map->empty (), false);
-
   }
 
-
   void testPut ()
   {
     map->put ((char*)"one", 1);

-----------------------------------------------------------------------

Summary of changes:
 myserver/binaries/web/cgi-src/math_sum/Makefile.am |    2 +-
 myserver/binaries/web/cgi-src/post/Makefile.am     |    2 +-
 myserver/lib/Makefile.am                           |    4 ----
 myserver/src/Makefile.am                           |    2 +-
 myserver/tests/Makefile.am                         |    2 +-
 5 files changed, 4 insertions(+), 8 deletions(-)


hooks/post-receive
-- 
GNU MyServer




reply via email to

[Prev in Thread] Current Thread [Next in Thread]