* conf/autofs/autofs_solaris_v1.h, conf/autofs/autofs_solaris_v1.c
authorErez Zadok <ezk@cs.sunysb.edu>
Fri, 7 Oct 2005 17:15:36 +0000 (17:15 +0000)
committerErez Zadok <ezk@cs.sunysb.edu>
Fri, 7 Oct 2005 17:15:36 +0000 (17:15 +0000)
(autofs_strdup_space_hack): move "space_hack" function from static
inline in header, into the only source file that needs it.  This
is cleaner and also prevents linking problem with some compilers
that won't apply CPP macros inside static inline functions (for
the strl* functions).

ChangeLog
conf/autofs/autofs_solaris_v1.c
conf/autofs/autofs_solaris_v1.h

index f6ed1815682d43e3f4d10784d4c8482cf033ea44..99fa8b6ce5e2bbe629381c2d0b269e050871ccfb 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,12 @@
 2005-10-07  Erez Zadok  <ezk@cs.sunysb.edu>
 
+       * conf/autofs/autofs_solaris_v1.h, conf/autofs/autofs_solaris_v1.c
+       (autofs_strdup_space_hack): move "space_hack" function from static
+       inline in header, into the only source file that needs it.  This
+       is cleaner and also prevents linking problem with some compilers
+       that won't apply CPP macros inside static inline functions (for
+       the strl* functions).
+
        * amq/pawd.c (find_mt, find_mlp): remove obsolete, inefficient
        code.
        (transform_dir): call the new, efficient amqproc_pawd_1() routine.
index eb3e5e7dc4aed8fca2c45c59c88d5a2e47f9fcb9..74539734f29efcdc6e6f261378e79dfe4ccbd9bd 100644 (file)
@@ -473,6 +473,23 @@ destroy_autofs_service(void)
 }
 
 
+/*
+ * autofs hack: append a space to the directory name
+ * to stop the kernel->daemon recursion.
+ *
+ * Returns malloc'ed space which needs to be freed by the caller.
+ */
+static char *
+autofs_strdup_space_hack(char *s)
+{
+  size_t l = strlen(s) + 2;
+  char *tmp = xmalloc(l);
+  xstrlcpy(tmp, s, l);
+  xstrlcat(tmp, " ", l);
+  return tmp;
+}
+
+
 int
 autofs_mount_fs(am_node *mp, mntfs *mf)
 {
index f41d41a22cd0fec648c7f6dc4255d3d58144e8fe..d1f9781c6f1b798c16d00b0d10ff6410caa1909f 100644 (file)
@@ -56,23 +56,6 @@ typedef autofs_args_t autofs_fh_t;
 
 #define NEED_AUTOFS_SPACE_HACK
 
-static inline char *
-autofs_strdup_space_hack(char *s)
-{
-  /*
-   * autofs hack: append a space to the directory name
-   * to stop the kernel->daemon recursion.
-   *
-   * Returns malloc'ed space which needs to be freed by the caller.
-   */
-  extern void *malloc(size_t);
-  size_t l = strlen(s) + 2;
-  char *tmp = malloc(l);
-  xstrlcpy(tmp, s, l);
-  xstrlcat(tmp, " ", l);
-  return tmp;
-}
-
 #define AUTOFS_AUTO_FS_FLAGS   (FS_AMQINFO | FS_DIRECTORY | FS_AUTOFS | FS_ON_AUTOFS)
 #define AUTOFS_DIRECT_FS_FLAGS (FS_DIRECT | FS_NOTIMEOUT | FS_BACKGROUND | FS_AMQINFO | FS_DIRECTORY | FS_AUTOFS)
 #define AUTOFS_ERROR_FS_FLAGS  (FS_DISCARD)