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.
}
+/*
+ * 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)
{
#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)