From aa9fcf3c970872e41335e9be06c6da18c8fc3d9d Mon Sep 17 00:00:00 2001 From: Erez Zadok Date: Fri, 7 Oct 2005 22:28:12 +0000 Subject: [PATCH] * conf/autofs/autofs_solaris_v1.h: redefine autofs_strdup_space_hack as a macro to str3cat(NULL,(s)," ",""). This works everywhere and we avoid linking problems, inline functions, etc. * conf/autofs/autofs_solaris_v1.c (autofs_mount_fs): remove autofs_strdup_space_hack() function altogether. --- ChangeLog | 8 ++++++++ conf/autofs/autofs_solaris_v1.c | 17 ----------------- conf/autofs/autofs_solaris_v1.h | 7 +++++++ 3 files changed, 15 insertions(+), 17 deletions(-) diff --git a/ChangeLog b/ChangeLog index 49a574b..b78e261 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,13 @@ 2005-10-07 Erez Zadok + * conf/autofs/autofs_solaris_v1.h: redefine + autofs_strdup_space_hack as a macro to str3cat(NULL,(s)," ",""). + This works everywhere and we avoid linking problems, inline + functions, etc. + + * conf/autofs/autofs_solaris_v1.c (autofs_mount_fs): remove + autofs_strdup_space_hack() function altogether. + * m4/macros/os_cflags.m4: remove hack that hardcodes pte_t=u_int. * configure.in: test for header. diff --git a/conf/autofs/autofs_solaris_v1.c b/conf/autofs/autofs_solaris_v1.c index 855f60a..11b4421 100644 --- a/conf/autofs/autofs_solaris_v1.c +++ b/conf/autofs/autofs_solaris_v1.c @@ -474,23 +474,6 @@ 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 d1f9781..1b2b79b 100644 --- a/conf/autofs/autofs_solaris_v1.h +++ b/conf/autofs/autofs_solaris_v1.h @@ -55,6 +55,13 @@ typedef autofs_args_t autofs_fh_t; #define NEED_AUTOFS_SPACE_HACK +/* + * 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. + */ +#define autofs_strdup_space_hack(s) str3cat(NULL, (s), " ", "") #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) -- 2.43.0