From: Erez Zadok Date: Fri, 7 Oct 2005 17:15:36 +0000 (+0000) Subject: * conf/autofs/autofs_solaris_v1.h, conf/autofs/autofs_solaris_v1.c X-Git-Tag: am-utils-6_2a1~17 X-Git-Url: https://git.fsl.cs.stonybrook.edu/?a=commitdiff_plain;h=06c53847938d75767f6daf8c6f30b8eb4bcf853a;p=am-utils-6.1.git * 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). --- diff --git a/ChangeLog b/ChangeLog index f6ed181..99fa8b6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,12 @@ 2005-10-07 Erez Zadok + * 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. diff --git a/conf/autofs/autofs_solaris_v1.c b/conf/autofs/autofs_solaris_v1.c index eb3e5e7..7453973 100644 --- a/conf/autofs/autofs_solaris_v1.c +++ b/conf/autofs/autofs_solaris_v1.c @@ -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) { diff --git a/conf/autofs/autofs_solaris_v1.h b/conf/autofs/autofs_solaris_v1.h index f41d41a..d1f9781 100644 --- a/conf/autofs/autofs_solaris_v1.h +++ b/conf/autofs/autofs_solaris_v1.h @@ -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)