Login | Register
My pages Projects Community openCollabNet

Discussions > commits > svn commit: r1547 - trunk: . fsvs fsvs/src

fsvs
Discussion topic

Back to topic list

svn commit: r1547 - trunk: . fsvs fsvs/src

Author pmarek
Full name P.Marek
Date 2008-03-16 23:07:08 PDT
Message Author: pmarek
Date: 2008-03-16 23:07:07-0700
New Revision: 1547

Modified:
   trunk/ (props changed)
   trunk/fsvs/CHANGES
   trunk/fsvs/configure.in
   trunk/fsvs/src/checksum.c
   trunk/fsvs/src/ignore.c
   trunk/fsvs/src/url.c
   trunk/fsvs/src/waa.c
   trunk/fsvs/src/waa.h

Log:
waa__open_*() now uses a mode instead of a flag.


Modified: trunk/fsvs/CHANGES
Url: http://fsvs.tigris.o​rg/source/browse/fsv​s/trunk/fsvs/CHANGES​?view=diff&rev=1​547&p1=trunk/fsv​s/CHANGES&p2=tru​nk/fsvs/CHANGES&​r1=1546&r2=1547
====================​====================​====================​==================
--- trunk/fsvs/CHANGES (original)
+++ trunk/fsvs/CHANGES 2008-03-16 23:07:07-0700
@@ -2,7 +2,7 @@
 - New option for conflict handling; allows "stop" (historical default),
     "local", "remote", "both" or "merge".
 - Verbose "urls dump".
-- Small fixes.
+- Small fixes and cleanups.
 - Bugfix - option "filter" wasn't taken from config files.
 - Bugfix for "st -N -N" printing all deleted entries.
 - Fix for "svn log | head -1" sometimes erroring out (EPIPE).

Modified: trunk/fsvs/configure.in
Url: http://fsvs.tigris.o​rg/source/browse/fsv​s/trunk/fsvs/configu​re.in?view=diff&​rev=1547&p1=trun​k/fsvs/configure.in​&p2=trunk/fsvs/co​nfigure.in&r1=15​46&r2=1547
====================​====================​====================​==================
--- trunk/fsvs/configure.in (original)
+++ trunk/fsvs/configure.in 2008-03-16 23:07:07-0700
@@ -152,6 +152,8 @@
     [AC_DEFINE([ENABLE_GCOV])
      ENABLE_GCOV=1],
     [])
+ENABLE_GCOV=1
+AC_DEFINE([ENABLE_GCOV])
 AC_SUBST(ENABLE_GCOV)
 
 AC_COMPILE_IFELSE(

Modified: trunk/fsvs/src/checksum.c
Url: http://fsvs.tigris.o​rg/source/browse/fsv​s/trunk/fsvs/src/che​cksum.c?view=diff​&rev=1547&p1=tr​unk/fsvs/src/checksu​m.c&p2=trunk/fsv​s/src/checksum.c​&r1=1546&r2=1547​
====================​====================​====================​==================
--- trunk/fsvs/src/checksum.c (original)
+++ trunk/fsvs/src/checksum.c 2008-03-16 23:07:07-0700
@@ -678,7 +678,7 @@
              * Do it now.
              * */
             STOPIF( ops__build_path(&filename, mb_f->sts), NULL);
- STOPIF( waa__open_byext(filename, WAA__FILE_MD5s_EXT, 1,
+ STOPIF( waa__open_byext(filename, WAA__FILE_MD5s_EXT, WAA__WRITE,
                         & cs___manber.manber_fd), NULL );
             DEBUGP("now doing manber-hashing for %s...", filename);
         }
@@ -928,7 +928,7 @@
 
     STOPIF( ops__build_path(&filename, sts), NULL);
     /* It's ok if there's no md5s file. simply return ENOENT. */
- status=waa__open_bye​xt(filename, WAA__FILE_MD5s_EXT, 0, &fh);
+ status=waa__open_bye​xt(filename, WAA__FILE_MD5s_EXT, WAA__READ, &fh);
     if (status == ENOENT) goto ex;
     STOPIF( status, "reading md5s-file for %s", filename);
 

Modified: trunk/fsvs/src/ignore.c
Url: http://fsvs.tigris.o​rg/source/browse/fsv​s/trunk/fsvs/src/ign​ore.c?view=diff&​rev=1547&p1=trun​k/fsvs/src/ignore.c​&p2=trunk/fsvs/sr​c/ignore.c&r1=15​46&r2=1547
====================​====================​====================​==================
--- trunk/fsvs/src/ignore.c (original)
+++ trunk/fsvs/src/ignore.c 2008-03-16 23:07:07-0700
@@ -884,7 +884,7 @@
 
 
     fh=-1;
- status=waa__open_byext(dir, WAA__IGNORE_EXT, 0, &fh);
+ status=waa__open_byext(dir, WAA__IGNORE_EXT, WAA__READ, &fh);
     if (status == ENOENT)
     {
         DEBUGP("no ignore list found");
@@ -1165,7 +1165,7 @@
 
     DEBUGP("saving ignore list");
     fh=-1;
- STOPIF( waa__open_byext(basedir, WAA__IGNORE_EXT, 1, &fh), NULL);
+ STOPIF( waa__open_byext(basedir, WAA__IGNORE_EXT, WAA__WRITE, &fh), NULL);
 
     /* do header */
     for(i=l=0; i<used_ignore_entries; i++)

Modified: trunk/fsvs/src/url.c
Url: http://fsvs.tigris.o​rg/source/browse/fsv​s/trunk/fsvs/src/url​.c?view=diff&rev​=1547&p1=trunk/f​svs/src/url.c&p2​=trunk/fsvs/src/url.​c&r1=1546&r2​=1547
====================​====================​====================​==================
--- trunk/fsvs/src/url.c (original)
+++ trunk/fsvs/src/url.c 2008-03-16 23:07:07-0700
@@ -699,7 +699,7 @@
 
     /* ENOENT must be possible without an error message.
      * The space must always be allocated. */
- status=waa__open_byext(dir, WAA__URLLIST_EXT, 0, &fh);
+ status=waa__open_byext(dir, WAA__URLLIST_EXT, WAA__READ, &fh);
     if (status==ENOENT)
     {
         STOPIF( url__allocate(reserve_space), NULL);
@@ -814,8 +814,7 @@
     STOPIF( url___set_internal_nums(),
             "Setting the internal numbers failed.");
 
- /* Open for writing. */
- STOPIF( waa__open_byext(NULL, WAA__URLLIST_EXT, 1, &fh), NULL);
+ STOPIF( waa__open_byext(NULL, WAA__URLLIST_EXT, WAA__WRITE, &fh), NULL);
     for(i=0; i<urllist_count; i++)
     {
         url=urllist[i];

Modified: trunk/fsvs/src/waa.c
Url: http://fsvs.tigris.o​rg/source/browse/fsv​s/trunk/fsvs/src/waa​.c?view=diff&rev​=1547&p1=trunk/f​svs/src/waa.c&p2​=trunk/fsvs/src/waa.​c&r1=1546&r2​=1547
====================​====================​====================​==================
--- trunk/fsvs/src/waa.c (original)
+++ trunk/fsvs/src/waa.c 2008-03-16 23:07:07-0700
@@ -754,13 +754,13 @@
  *
  * The \a directory may be \c NULL; then the current working directory
  * is taken.
- * \a write is just a flag; if set, <tt>O_CREAT | O_WRONLY | O_TRUNC</tt>
- * is given to \c waa__open().
+ * \a write is open mode, like used for \c open(2) (<tt>O_CREAT | O_WRONLY
+ * | O_TRUNC</tt>) and is given to \c waa__open().
  *
  * \c ENOENT is returned without giving an error message. */
 int waa__open_byext(char *directory,
         char *extension,
- int write,
+ int mode,
         int *fh)
 {
     int status;
@@ -770,9 +770,7 @@
     status=0;
     STOPIF( waa__given_or_curren​t_wd(directory, &dir), NULL );
 
- status=waa__open(dir, extension,
- write ? (O_CREAT | O_WRONLY | O_TRUNC) : O_RDONLY,
- fh);
+ status=waa__open(dir, extension, mode, fh);
     if (status == ENOENT) goto ex;
     STOPIF(status, NULL);
 
@@ -1084,7 +1082,7 @@
 
 
     directory=NULL;
- STOPIF( waa__open_dir(NULL, 1, &waa_info_hdl), NULL);
+ STOPIF( waa__open_dir(NULL, WAA__WRITE, &waa_info_hdl), NULL);
 
     /* allocate space for later use - entry count and similar. */
     status=strlen(header);
@@ -1503,7 +1501,7 @@
 
     length=0;
     dir_mmap=NULL;
- status=waa__open_dir(NULL, 0, &waa_info_hdl);
+ status=waa__open_dir(NULL, WAA__READ, &waa_info_hdl);
     if (status == ENOENT)
     {
         status=-ENOENT;

Modified: trunk/fsvs/src/waa.h
Url: http://fsvs.tigris.o​rg/source/browse/fsv​s/trunk/fsvs/src/waa​.h?view=diff&rev​=1547&p1=trunk/f​svs/src/waa.h&p2​=trunk/fsvs/src/waa.​h&r1=1546&r2​=1547
====================​====================​====================​==================
--- trunk/fsvs/src/waa.h (original)
+++ trunk/fsvs/src/waa.h 2008-03-16 23:07:07-0700
@@ -10,6 +10,7 @@
 #define __WAA_H__
 
 #include <ctype.h>
+#include <fcntl.h>
 
 #include "global.h"
 #include "actions.h"
@@ -162,6 +163,11 @@
 #define WAA__DIR_NAME_EXT "dname"
 /** @} */
 
+/** \name Short names for the open modes.
+ * @{ */
+#define WAA__WRITE (O_WRONLY | O_CREAT | O_TRUNC)
+#define WAA__READ (O_RDONLY)
+/** @} */
 /** @} */

« Previous message in topic | 1 of 1 | Next message in topic »

Messages

Show all messages in topic

svn commit: r1547 - trunk: . fsvs fsvs/src pmarek P.Marek 2008-03-16 23:07:08 PDT
Messages per page: