From owner-svn-src-head@FreeBSD.ORG Wed Nov 23 19:11:03 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B7DBA10657A0; Wed, 23 Nov 2011 19:11:03 +0000 (UTC) (envelope-from fjoe@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9CB458FC13; Wed, 23 Nov 2011 19:11:03 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pANJB3AZ059295; Wed, 23 Nov 2011 19:11:03 GMT (envelope-from fjoe@svn.freebsd.org) Received: (from fjoe@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pANJB3a4059292; Wed, 23 Nov 2011 19:11:03 GMT (envelope-from fjoe@svn.freebsd.org) Message-Id: <201111231911.pANJB3a4059292@svn.freebsd.org> From: Max Khon Date: Wed, 23 Nov 2011 19:11:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227903 - head/usr.sbin/sade X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Nov 2011 19:11:03 -0000 Author: fjoe Date: Wed Nov 23 19:11:03 2011 New Revision: 227903 URL: http://svn.freebsd.org/changeset/base/227903 Log: Remove unused functions. Modified: head/usr.sbin/sade/misc.c head/usr.sbin/sade/sade.h Modified: head/usr.sbin/sade/misc.c ============================================================================== --- head/usr.sbin/sade/misc.c Wed Nov 23 19:06:30 2011 (r227902) +++ head/usr.sbin/sade/misc.c Wed Nov 23 19:11:03 2011 (r227903) @@ -56,27 +56,6 @@ file_readable(char *fname) return FALSE; } -/* Quick check to see if a file is executable */ -Boolean -file_executable(char *fname) -{ - if (!access(fname, X_OK)) - return TRUE; - return FALSE; -} - -/* Concatenate two strings into static storage */ -char * -string_concat(char *one, char *two) -{ - static char tmp[FILENAME_MAX]; - - /* Yes, we're deliberately cavalier about not checking for overflow */ - strcpy(tmp, one); - strcat(tmp, two); - return tmp; -} - /* sane strncpy() function */ char * sstrncpy(char *dst, const char *src, int size) @@ -85,19 +64,6 @@ sstrncpy(char *dst, const char *src, int return strncpy(dst, src, size); } -/* Concatenate three strings into static storage */ -char * -string_concat3(char *one, char *two, char *three) -{ - static char tmp[FILENAME_MAX]; - - /* Yes, we're deliberately cavalier about not checking for overflow */ - strcpy(tmp, one); - strcat(tmp, two); - strcat(tmp, three); - return tmp; -} - /* Clip the whitespace off the end of a string */ char * string_prune(char *str) @@ -118,29 +84,6 @@ string_skipwhite(char *str) return str; } -/* copy optionally and allow second arg to be null */ -char * -string_copy(char *s1, char *s2) -{ - if (!s1) - return NULL; - if (!s2) - s1[0] = '\0'; - else - strcpy(s1, s2); - return s1; -} - -/* convert an integer to a string, using a static buffer */ -char * -itoa(int value) -{ - static char buf[13]; - - snprintf(buf, 12, "%d", value); - return buf; -} - Boolean directory_exists(const char *dirname) { @@ -159,22 +102,6 @@ directory_exists(const char *dirname) return (TRUE); } -char * -pathBaseName(const char *path) -{ - char *pt; - char *ret = (char *)path; - - pt = strrchr(path,(int)'/'); - - if (pt != 0) /* if there is a slash */ - { - ret = ++pt; /* start the file after it */ - } - - return(ret); -} - /* A free guaranteed to take NULL ptrs */ void safe_free(void *ptr) @@ -198,34 +125,6 @@ safe_malloc(size_t size) return ptr; } -/* A realloc that checks errors */ -void * -safe_realloc(void *orig, size_t size) -{ - void *ptr; - - if (size <= 0) - msgFatal("Invalid realloc size of %ld!", (long)size); - ptr = reallocf(orig, size); - if (!ptr) - msgFatal("Out of memory!"); - return ptr; -} - -/* Create a path biased from the VAR_INSTALL_ROOT variable (if not /) */ -char * -root_bias(char *path) -{ - static char tmp[FILENAME_MAX]; - char *cp = variable_get(VAR_INSTALL_ROOT); - - if (!strcmp(cp, "/")) - return path; - strcpy(tmp, variable_get(VAR_INSTALL_ROOT)); - strcat(tmp, path); - return tmp; -} - int Mkdir(char *ipath) { Modified: head/usr.sbin/sade/sade.h ============================================================================== --- head/usr.sbin/sade/sade.h Wed Nov 23 19:06:30 2011 (r227902) +++ head/usr.sbin/sade/sade.h Wed Nov 23 19:11:03 2011 (r227903) @@ -387,19 +387,11 @@ extern int diskLabelCommit(dialogMenuIte /* misc.c */ extern Boolean file_readable(char *fname); -extern Boolean file_executable(char *fname); extern Boolean directory_exists(const char *dirname); -extern char *root_bias(char *path); -extern char *itoa(int value); -extern char *string_concat(char *p1, char *p2); -extern char *string_concat3(char *p1, char *p2, char *p3); extern char *string_prune(char *str); extern char *string_skipwhite(char *str); -extern char *string_copy(char *s1, char *s2); -extern char *pathBaseName(const char *path); extern void safe_free(void *ptr); extern void *safe_malloc(size_t size); -extern void *safe_realloc(void *orig, size_t size); extern int Mkdir(char *); extern int Mount(char *, void *data);