From 4645618ec1ffc6717adf7b8e6afbf01398b637f0 Mon Sep 17 00:00:00 2001 From: Andrew Deason Date: Wed, 17 Apr 2024 21:28:11 -0500 Subject: [PATCH] venus: Remove dedebug This utility has never been built by default, currently does not build (because RXAFSCB_GetDE doesn't exist), and generates many warnings. Remove the dead code. Change-Id: I4c91eb44b3b3c265f0741b9918601abf338b492a Reviewed-on: https://gerrit.openafs.org/15738 Tested-by: BuildBot Reviewed-by: Michael Meffie Reviewed-by: Benjamin Kaduk --- Makefile.in | 3 -- src/venus/Makefile.in | 7 +-- src/venus/dedebug.c | 113 ------------------------------------------ 3 files changed, 1 insertion(+), 122 deletions(-) delete mode 100644 src/venus/dedebug.c diff --git a/Makefile.in b/Makefile.in index aef7f8cd3b..5c431d9ab6 100644 --- a/Makefile.in +++ b/Makefile.in @@ -458,9 +458,6 @@ kauth_depinstall: config rxgen comerr ptserver_depinstall: config rxgen comerr +${COMPILE_PART1} ptserver ${COMPILE_DEPINSTALL} -${DEST}/bin/dedebug: dedebug - ${INSTALL} $? $@ - # # libafs build targets diff --git a/src/venus/Makefile.in b/src/venus/Makefile.in index 3c9bd03897..a4c62c3654 100644 --- a/src/venus/Makefile.in +++ b/src/venus/Makefile.in @@ -120,11 +120,6 @@ cmdebug.o: cmdebug.c ${INCLS} AFS_component_version_number.c cmdebug: cmdebug.o ${CMLIBS} $(AFS_LDRULE) cmdebug.o ${CMLIBS} $(LIB_roken) ${XLIBS} -dedebug.o: dedebug.c ${INCLS} AFS_component_version_number.c - -dedebug: dedebug.o ${CMLIBS} - $(AFS_LDRULE) dedebug.o ${CMLIBS} $(LIB_roken) ${XLIBS} - # # Install targets # @@ -159,7 +154,7 @@ dest: fs livesys up fstrace cmdebug afsio clean: $(LT_CLEAN) $(RM) -f *.o *.a up fs core cmdebug \ - AFS_component_version_number.c fstrace gcpags livesys dedebug \ + AFS_component_version_number.c fstrace gcpags livesys \ cacheout afsio .PHONY: test diff --git a/src/venus/dedebug.c b/src/venus/dedebug.c deleted file mode 100644 index bdf46207d0..0000000000 --- a/src/venus/dedebug.c +++ /dev/null @@ -1,113 +0,0 @@ -/* - * Copyright 2000, International Business Machines Corporation and others. - * All Rights Reserved. - * - * This software has been released under the terms of the IBM Public - * License. For details, see the LICENSE file in the top-level source - * directory or online at http://www.openafs.org/dl/license10.html - */ - -#include -#include - -#include - -#include -#include -#include -#include -#include - -extern struct rx_securityClass *rxnull_NewServerSecurityObject(); -extern struct hostent *hostutil_GetHostByName(); - -static PrintCacheEntries(struct rx_connection *aconn, int aint32) -{ - int i; - afs_int32 code, addr, inode, flags, time; - char *fileName; - - for(i=0;i<100000;i++) { - code = RXAFSCB_GetDE(aconn, i, &addr, &inode, &flags, &time, &fileName); - if (code) { - if (code == 1) break; - printf("cmdebug: failed to get cache entry %d (%s)\n", i, - afs_error_message(code)); - return code; - } - - /* otherwise print this entry */ - printf("%d: ** dentry %d %08x %d %d %s\n", - i, addr, inode, flags, time, fileName); - - printf("\n"); - } - printf("Returned %d entries.\n", i); - return 0; -} - -static int -CommandProc(struct cmd_syndesc *as, void *arock) -{ - struct rx_connection *conn; - char *hostName; - struct hostent *thp; - afs_int32 port; - struct rx_securityClass *secobj; - int int32p; - afs_int32 addr; - - hostName = as->parms[0].items->data; - if (as->parms[1].items) - port = atoi(as->parms[1].items->data); - else - port = 7001; - thp = hostutil_GetHostByName(hostName); - if (!thp) { - printf("cmdebug: can't resolve address for host %s.\n", hostName); - exit(1); - } - memcpy(&addr, thp->h_addr, sizeof(afs_int32)); - secobj = rxnull_NewServerSecurityObject(); - conn = rx_NewConnection(addr, htons(port), 1, secobj, 0); - if (!conn) { - printf("cmdebug: failed to create connection for host %s\n", hostName); - exit(1); - } - if (as->parms[2].items) int32p = 1; - else int32p = 0; - PrintCacheEntries(conn, int32p); - return 0; -} - -#include "AFS_component_version_number.c" - -main(argc, argv) -int argc; -char **argv; { - struct cmd_syndesc *ts; - -#ifdef AFS_AIX32_ENV - /* - * The following signal action for AIX is necessary so that in case of a - * crash (i.e. core is generated) we can include the user's data section - * in the core dump. Unfortunately, by default, only a partial core is - * generated which, in many cases, isn't too useful. - */ - struct sigaction nsa; - - sigemptyset(&nsa.sa_mask); - nsa.sa_handler = SIG_DFL; - nsa.sa_flags = SA_FULLDUMP; - sigaction(SIGSEGV, &nsa, NULL); -#endif - rx_Init(0); - - ts = cmd_CreateSyntax(NULL, CommandProc, NULL, 0, "probe unik server"); - cmd_AddParm(ts, "-servers", CMD_SINGLE, CMD_REQUIRED, "server machine"); - cmd_AddParm(ts, "-port", CMD_SINGLE, CMD_OPTIONAL, "IP port"); - cmd_AddParm(ts, "-long", CMD_FLAG, CMD_OPTIONAL, "print all info"); - - cmd_Dispatch(argc, argv); - exit(0); -}