From: Erez Zadok Date: Fri, 7 Oct 2005 17:24:16 +0000 (+0000) Subject: standard usage and formatting X-Git-Tag: am-utils-6_2a1~16 X-Git-Url: https://git.fsl.cs.sunysb.edu/?a=commitdiff_plain;h=c88b576425d59150e266070467a902754982efd2;p=am-utils-6.1.git standard usage and formatting --- diff --git a/conf/autofs/autofs_linux.c b/conf/autofs/autofs_linux.c index e5ced35..2b594c1 100644 --- a/conf/autofs/autofs_linux.c +++ b/conf/autofs/autofs_linux.c @@ -77,7 +77,8 @@ static int numfds = 0; static int bind_works = 1; -static void hash_init(void) +static void +hash_init(void) { int i; struct rlimit rlim; @@ -100,7 +101,8 @@ static void hash_init(void) } -static void hash_insert(int fd, am_node *mp) +static void +hash_insert(int fd, am_node *mp) { if (hash[fd] != 0) plog(XLOG_ERROR, "file descriptor %d already in the hash", fd); @@ -111,7 +113,8 @@ static void hash_insert(int fd, am_node *mp) } -static void hash_delete(int fd) +static void +hash_delete(int fd) { int i; @@ -639,7 +642,7 @@ autofs_mount_fs(am_node *mp, mntfs *mf) out: if (target2) - free(target2); + XFREE(target2); if (err) return errno; diff --git a/conf/autofs/autofs_solaris_v1.c b/conf/autofs/autofs_solaris_v1.c index 7453973..855f60a 100644 --- a/conf/autofs/autofs_solaris_v1.c +++ b/conf/autofs/autofs_solaris_v1.c @@ -96,6 +96,7 @@ static int autofs_unmount_1_req(struct umntrequest *ur, struct umntres *result, /* * AUTOFS XDR FUNCTIONS: */ + #ifndef HAVE_XDR_MNTREQUEST bool_t xdr_mntrequest(XDR *xdrs, mntrequest *objp) @@ -418,7 +419,7 @@ autofs_release_fh(am_node *mp) { autofs_fh_t *fh = mp->am_autofs_fh; #ifdef HAVE_AUTOFS_ARGS_T_ADDR - free(fh->addr.buf); + XFREE(fh->addr.buf); #endif /* HAVE_AUTOFS_ARGS_T_ADDR */ XFREE(fh); mp->am_autofs_fh = NULL; @@ -563,9 +564,9 @@ autofs_mount_fs(am_node *mp, mntfs *mf) } out: - free(space_hack); + XFREE(space_hack); if (target2) - free(target2); + XFREE(target2); if (err) return errno; @@ -603,7 +604,7 @@ autofs_umount_fs(am_node *mp, mntfs *mf) } out: - free(space_hack); + XFREE(space_hack); return err; } @@ -631,6 +632,7 @@ autofs_umount_succeeded(am_node *mp) return 0; } + int autofs_umount_failed(am_node *mp) { @@ -682,7 +684,7 @@ autofs_mount_succeeded(am_node *mp) mp->am_dev = stb.st_dev; mp->am_rdev = stb.st_rdev; } - free(space_hack); + XFREE(space_hack); /* don't expire the entries -- the kernel will do it for us */ mp->am_flags |= AMF_NOTIMEOUT; @@ -735,5 +737,4 @@ void autofs_timeout_mp(am_node *mp) /* We don't want any timeouts on autofs nodes */ mp->am_autofs_ttl = NEVER; } - #endif /* HAVE_FS_AUTOFS */ diff --git a/conf/autofs/autofs_solaris_v2_v3.c b/conf/autofs/autofs_solaris_v2_v3.c index 78c2714..422112f 100644 --- a/conf/autofs/autofs_solaris_v2_v3.c +++ b/conf/autofs/autofs_solaris_v2_v3.c @@ -98,6 +98,7 @@ bool_t xdr_postmountres(XDR *xdrs, postmountres *objp); /* * AUTOFS XDR FUNCTIONS: */ + bool_t xdr_autofs_stat(XDR *xdrs, autofs_stat *objp) { @@ -106,6 +107,7 @@ xdr_autofs_stat(XDR *xdrs, autofs_stat *objp) return (TRUE); } + bool_t xdr_autofs_action(XDR *xdrs, autofs_action *objp) { @@ -114,6 +116,7 @@ xdr_autofs_action(XDR *xdrs, autofs_action *objp) return (TRUE); } + bool_t xdr_linka(XDR *xdrs, linka *objp) { @@ -124,6 +127,7 @@ xdr_linka(XDR *xdrs, linka *objp) return (TRUE); } + bool_t xdr_autofs_netbuf(XDR *xdrs, struct netbuf *objp) { @@ -136,6 +140,7 @@ xdr_autofs_netbuf(XDR *xdrs, struct netbuf *objp) return (dummy); } + bool_t xdr_autofs_args(XDR *xdrs, autofs_args *objp) { @@ -160,6 +165,7 @@ xdr_autofs_args(XDR *xdrs, autofs_args *objp) return (TRUE); } + bool_t xdr_mounta(XDR *xdrs, struct mounta *objp) { @@ -179,6 +185,7 @@ xdr_mounta(XDR *xdrs, struct mounta *objp) return (TRUE); } + bool_t xdr_action_list_entry(XDR *xdrs, action_list_entry *objp) { @@ -199,6 +206,7 @@ xdr_action_list_entry(XDR *xdrs, action_list_entry *objp) return (TRUE); } + bool_t xdr_action_list(XDR *xdrs, action_list *objp) { @@ -210,6 +218,7 @@ xdr_action_list(XDR *xdrs, action_list *objp) return (TRUE); } + bool_t xdr_umntrequest(XDR *xdrs, umntrequest *objp) { @@ -252,6 +261,7 @@ xdr_umntres(XDR *xdrs, umntres *objp) return (TRUE); } + /* * These exist only in the AutoFS V2 protocol. */ @@ -270,6 +280,7 @@ xdr_postumntreq(XDR *xdrs, postumntreq *objp) return (TRUE); } + bool_t xdr_postumntres(XDR *xdrs, postumntres *objp) { @@ -278,6 +289,7 @@ xdr_postumntres(XDR *xdrs, postumntres *objp) return (TRUE); } + bool_t xdr_postmountreq(XDR *xdrs, postmountreq *objp) { @@ -294,6 +306,7 @@ xdr_postmountreq(XDR *xdrs, postmountreq *objp) return (TRUE); } + bool_t xdr_postmountres(XDR *xdrs, postmountres *objp) { @@ -303,6 +316,7 @@ xdr_postmountres(XDR *xdrs, postmountres *objp) } #endif /* AUTOFS_POSTUNMOUNT */ + bool_t xdr_autofs_res(XDR *xdrs, autofs_res *objp) { @@ -311,6 +325,7 @@ xdr_autofs_res(XDR *xdrs, autofs_res *objp) return (TRUE); } + bool_t xdr_autofs_lookupargs(XDR *xdrs, autofs_lookupargs *objp) { @@ -353,6 +368,7 @@ xdr_mount_result_type(XDR *xdrs, mount_result_type *objp) return (TRUE); } + bool_t xdr_autofs_mountres(XDR *xdrs, autofs_mountres *objp) { @@ -367,6 +383,7 @@ xdr_autofs_mountres(XDR *xdrs, autofs_mountres *objp) return (TRUE); } + bool_t xdr_lookup_result_type(XDR *xdrs, lookup_result_type *objp) { @@ -383,6 +400,7 @@ xdr_lookup_result_type(XDR *xdrs, lookup_result_type *objp) return (TRUE); } + bool_t xdr_autofs_lookupres(XDR *xdrs, autofs_lookupres *objp) { @@ -395,6 +413,7 @@ xdr_autofs_lookupres(XDR *xdrs, autofs_lookupres *objp) return (TRUE); } + bool_t xdr_autofs_rddirargs(XDR *xdrs, autofs_rddirargs *objp) { @@ -995,7 +1014,7 @@ autofs_release_fh(am_node *mp) { autofs_fh_t *fh = mp->am_autofs_fh; #ifdef HAVE_AUTOFS_ARGS_T_ADDR - free(fh->addr.buf); + XFREE(fh->addr.buf); #endif /* HAVE_AUTOFS_ARGS_T_ADDR */ XFREE(fh); mp->am_autofs_fh = NULL; @@ -1113,7 +1132,7 @@ autofs_mount_fs(am_node *mp, mntfs *mf) out: if (target2) - free(target2); + XFREE(target2); if (err) return errno; @@ -1165,6 +1184,7 @@ autofs_umount_succeeded(am_node *mp) return 0; } + int autofs_umount_failed(am_node *mp) {