Login | Register
My pages Projects Community openCollabNet

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

fsvs
Discussion topic

Back to topic list

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

Author pmarek
Full name P.Marek
Date 2008-04-01 22:25:14 PDT
Message Author: pmarek
Date: 2008-04-01 22:25:13-0700
New Revision: 1578

Modified:
   trunk/ (props changed)
   trunk/fsvs/CHANGES
   trunk/fsvs/configure.in
   trunk/fsvs/src/config.h.in
   trunk/fsvs/src/est_ops.c
   trunk/fsvs/src/fsvs.c
   trunk/fsvs/src/global.h
   trunk/fsvs/src/ignore.c
   trunk/fsvs/src/status.c

Log:
Solaris compatibility:
- "environ" defined
- disable device compares, or
- if --enable-fake-dev was used, fake definitions as done long ago.




Modified: trunk/fsvs/CHANGES
Url: http://fsvs.tigris.o​rg/source/browse/fsv​s/trunk/fsvs/CHANGES​?view=diff&rev=1​578&p1=trunk/fsv​s/CHANGES&p2=tru​nk/fsvs/CHANGES&​r1=1577&r2=1578
====================​====================​====================​==================
--- trunk/fsvs/CHANGES (original)
+++ trunk/fsvs/CHANGES 2008-04-01 22:25:13-0700
@@ -15,6 +15,8 @@
     wrong options.
 - Bugfix for revert - would save the dir-list, even when an error occurs.
 - update can now be restricted to an arbitrary subset of URLs.
+- Tried to get compatibility with systems that don't expose MAJOR, MINOR
+ and MKDEV (eg. Solaris).
 
 Changes since 1.1.12
 - Small changes, cleanups and optimizations

Modified: trunk/fsvs/configure.in
Url: http://fsvs.tigris.o​rg/source/browse/fsv​s/trunk/fsvs/configu​re.in?view=diff&​rev=1578&p1=trun​k/fsvs/configure.in​&p2=trunk/fsvs/co​nfigure.in&r1=15​77&r2=1578
====================​====================​====================​==================
--- trunk/fsvs/configure.in (original)
+++ trunk/fsvs/configure.in 2008-04-01 22:25:13-0700
@@ -127,15 +127,16 @@
   AC_MSG_NOTICE([No compatible valgrind version.])
 fi
 
-AC_CHECK_HEADERS([l​inux/kdev_t.h],
- [],
- [AC_MSG_FAILURE([
-*** MAJOR(), MINOR() and MAKEDEV() definitions not found.
-*** I'll fake a definition, but that could make problems for ignore patterns
-*** and commits/updates of device nodes.
-*** Please contact dev at fsvs dot tigris dot org for help, or, if you know your
-*** systems' way, to report the correct header name.])])
-
+AC_CHECK_HEADERS([l​inux/kdev_t.h])
+
+AC_ARG_ENABLE(dev-fake,
+ AC_HELP_STRING([--en​able-dev-fake],
+ [Include fake definitions for MAJOR(), MINOR() and MKDEV(). Needed if none found.]),
+ [AC_DEFINE([ENABLE_DEV_FAKE])
+ ENABLE_DEV_FAKE=1],
+ [])
+AC_SUBST(ENABLE_DEV_FAKE)
+
 
 AC_ARG_ENABLE(debug,
     AC_HELP_STRING([--en​able-debug],
@@ -264,4 +265,17 @@
 # Cause a recompile
 touch src/config.h
 
+if [[ "$ac_cv_header_linux_kdev_t_h" == "no" ]]
+then
+ AC_MSG_WARN([
+ * MAJOR(), MINOR() and MAKEDEV() definitions not found.
+ * Fake a definition, but that could make problems for ignore patterns
+ * and commits/updates of device nodes, so these will be disabled.
+ * Please contact dev at fsvs dot tigris dot org for help, or, if you know your
+ * systems' way, to report the correct header name.
+ *
+ * If you *really* need to use device compares, and have *no* other way,
+ * you could try using the --enable-dev-fake option on ./configure.])
+fi
+
 # vi: ts=3 sw=3

Modified: trunk/fsvs/src/config.h.in
Url: http://fsvs.tigris.o​rg/source/browse/fsv​s/trunk/fsvs/src/con​fig.h.in?view=diff​&rev=1578&p1=t​runk/fsvs/src/config​.h.in&p2=trunk/f​svs/src/config.h.in​&r1=1577&r2=1​578
====================​====================​====================​==================
--- trunk/fsvs/src/config.h.in (original)
+++ trunk/fsvs/src/config.h.in 2008-04-01 22:25:13-0700
@@ -88,16 +88,30 @@
 /** Does \c linux/kdev_t.h exist?
  * Needed for \a MAJOR() and \a MINOR() macros. */
 #undef HAVE_LINUX_KDEV_T_H
+/** Should we fake definitions? */
+#undef ENABLE_DEV_FAKE
+/** Error macro if no device definitions available. */
+#undef DEVICE_NODES_DISABLED
+
 #ifdef HAVE_LINUX_KDEV_T_H
-#include <linux/kdev_t.h>
+ #include <linux/kdev_t.h>
 #else
-/** \name fakedev Fake definitions, as reported with configure.
- * Taken from \c linux/kdev_t.h. */
-/** @{ */
-#define MAJOR(dev) ((dev)>>8)
-#define MINOR(dev) ((dev) & 0xff)
-#define MKDEV(ma,mi) ((ma)<<8 | (mi))
-/** @} */
+ #ifdef ENABLE_DEV_FAKE
+ /** \name fakedev Fake definitions, as reported with configure.
+ * Taken from \c linux/kdev_t.h. */
+ /** @{ */
+ #define MAJOR(dev) ((dev)>>8)
+ #define MINOR(dev) ((dev) & 0xff)
+ #define MKDEV(ma,mi) ((ma)<<8 | (mi))
+ /** @} */
+ #else
+ /** No definitions, disable some code. */
+ #define DEVICE_NODES_DISABLED() BUG("No MAJOR(), MINOR() or MKDEV() found at configure time.")
+
+ #undef MAJOR
+ #undef MINOR
+ #undef MKDEV
+ #endif
 #endif
 
 /** @} */

Modified: trunk/fsvs/src/est_ops.c
Url: http://fsvs.tigris.o​rg/source/browse/fsv​s/trunk/fsvs/src/est​_ops.c?view=diff​&rev=1578&p1=tru​nk/fsvs/src/est_ops.​c&p2=trunk/fsvs/​src/est_ops.c&r1​=1577&r2=1578
====================​====================​====================​==================
--- trunk/fsvs/src/est_ops.c (original)
+++ trunk/fsvs/src/est_ops.c 2008-04-01 22:25:13-0700
@@ -124,7 +124,11 @@
                 (type != 'c' && type != 'b'), EINVAL,
                 "'%s' is not parseable as a special description", data);
 
+#ifdef DEVICE_NODES_DISABLED
+ DEVICE_NODES_DISABLED();
+#else
         sts->st.rdev=MKDEV(maj, min);
+#endif
         mode = type == 'c' ? S_IFCHR : S_IFBLK;
         ft = type == 'c' ? FT_CDEV : FT_BDEV;
     }
@@ -181,11 +185,15 @@
             sts->name,
             sts->entry_type, sts->st.mode);
 
+#ifdef DEVICE_NODES_DISABLED
+ DEVICE_NODES_DISABLED();
+#else
     sprintf(buffer, "%s%c0x%x:0x%x",
             S_ISBLK(sts->st.mode) ? "bdev" : "cdev",
             delimiter,
             (int)MAJOR(sts->st.rdev),
             (int)MINOR(sts->st.rdev));
+#endif
 
     return buffer;
 }

Modified: trunk/fsvs/src/fsvs.c
Url: http://fsvs.tigris.o​rg/source/browse/fsv​s/trunk/fsvs/src/fsv​s.c?view=diff&re​v=1578&p1=trunk/​fsvs/src/fsvs.c&​p2=trunk/fsvs/src/fs​vs.c&r1=1577​&r2=1578
====================​====================​====================​==================
--- trunk/fsvs/src/fsvs.c (original)
+++ trunk/fsvs/src/fsvs.c 2008-04-01 22:25:13-0700
@@ -381,6 +381,9 @@
 
 struct url_t *current_url;
 
+/* For Solaris, which doesn't have one ... */
+char **environ=NULL;
+
 
 /** -.
  * Never called directly, used only via the macro DEBUGP(). */
@@ -565,6 +568,9 @@
     {
         fprintf(output, "compiled on " __DATE__ " " __TIME__
                 ", with options:\n\t"
+#ifdef HAVE_VALGRIND
+ STRINGIFY(HAVE_VALGRIND)
+#endif
 #ifdef HAVE_VALGRIND_VALGRIND_H
                 STRINGIFY(HAVE_VALGR​IND_VALGRIND_H)
 #endif
@@ -613,6 +619,12 @@
 #ifdef HAVE_LINUX_KDEV_T_H
                 STRINGIFY(HAVE_LINUX_KDEV_T_H)
 #endif
+#ifdef ENABLE_DEV_FAKE
+ STRINGIFY(ENABLE_DEV_FAKE)
+#endif
+#ifdef DEVICE_NODES_DISABLED
+ STRINGIFY(DEVICE_NOD​ES_DISABLED)
+#endif
                 "\n");
     }
     return Id;
@@ -921,7 +933,7 @@
  * them there.
  *
  * */
-int main(int argc, char *args[])
+int main(int argc, char *args[], char *env[])
 {
     struct estat root = { };
     int status, help;
@@ -933,6 +945,7 @@
 
     help=0;
     eo_args=1;
+ environ=env;
     program_name=args[0];
 #ifdef ENABLE_DEBUG
     /* If STDOUT and STDIN are on a terminal, we could possibly be

Modified: trunk/fsvs/src/global.h
Url: http://fsvs.tigris.o​rg/source/browse/fsv​s/trunk/fsvs/src/glo​bal.h?view=diff&​rev=1578&p1=trun​k/fsvs/src/global.h​&p2=trunk/fsvs/sr​c/global.h&r1=15​77&r2=1578
====================​====================​====================​==================
--- trunk/fsvs/src/global.h (original)
+++ trunk/fsvs/src/global.h 2008-04-01 22:25:13-0700
@@ -870,4 +870,7 @@
 #define ANSI__NORMAL "\x1b[0;0m"
 /** @} */
 
+/** For Solaris */
+extern char **environ;
+
 #endif

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=1578&p1=trun​k/fsvs/src/ignore.c​&p2=trunk/fsvs/sr​c/ignore.c&r1=15​77&r2=1578
====================​====================​====================​==================
--- trunk/fsvs/src/ignore.c (original)
+++ trunk/fsvs/src/ignore.c 2008-04-01 22:25:13-0700
@@ -696,7 +696,6 @@
 int ign___init_pattern_into(char *pattern, char *end, struct ignore_t *ignore)
 {
     int status, stop;
- int mj, mn;
     char *cp;
 
 
@@ -806,6 +805,11 @@
     }
     else if (strncmp(inode_prefix, pattern, strlen(inode_prefix)) == 0)
     {
+#ifdef DEVICE_NODES_DISABLED
+ DEVICE_NODES_DISABLED();
+#else
+ int mj, mn;
+
         ignore->type=PT_INODE;
         ignore->compare_string = pattern;
         pattern+=strlen(inode_prefix);
@@ -826,6 +830,7 @@
         STOPIF_CODE_ERR( cp == pattern || *cp!= 0, EINVAL,
                 "garbage after inode in %s?", ignore->pattern);
 
+#endif
         status=0;
     }
     else
@@ -963,6 +968,9 @@
  * */
 inline int ign___compare_dev(struct sstat_t *st, struct ignore_t *ign)
 {
+#ifdef DEVICE_NODES_DISABLED
+ DEVICE_NODES_DISABLED();
+#else
     int mj, mn;
 
     mj=(int)MAJOR(st->dev);
@@ -974,6 +982,7 @@
     if (!ign->has_minor) return 0;
     if (mn > ign->minor) return +1;
     if (mn < ign->minor) return -1;
+#endif
 
     return 0;
 }

Modified: trunk/fsvs/src/status.c
Url: http://fsvs.tigris.o​rg/source/browse/fsv​s/trunk/fsvs/src/sta​tus.c?view=diff&​rev=1578&p1=trun​k/fsvs/src/status.c​&p2=trunk/fsvs/sr​c/status.c&r1=15​77&r2=1578
====================​====================​====================​==================
--- trunk/fsvs/src/status.c (original)
+++ trunk/fsvs/src/status.c 2008-04-01 22:25:13-0700
@@ -689,9 +689,13 @@
                 cs__md52hex(sts->md5));
 
     if (sts->entry_type==FT_BDEV || sts->entry_type==FT_CDEV)
+#ifdef DEVICE_NODES_DISABLED
+ DEVICE_NODES_DISABLED();
+#else
         status |= printf("\tDevice number:\t%llu:%llu\n",
                 (t_ull)MAJOR(sts->st.rdev),
                 (t_ull)MINOR(sts->st.rdev));
+#endif
     else
         status |= printf("\tSize:\t\t%llu\n", (t_ull)sts->st.size);

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

Messages

Show all messages in topic

svn commit: r1578 - trunk: . fsvs fsvs/src pmarek P.Marek 2008-04-01 22:25:14 PDT
Messages per page: