From 42ec14cf2b98fd599fbeb16a67a1dd7f4fb3e558 Mon Sep 17 00:00:00 2001 From: Michael Tremer Date: Sat, 12 Oct 2013 16:23:41 +0200 Subject: [PATCH] misc-progs: Remove unused functions. --- src/misc-progs/setuid.c | 28 ---------------------------- src/misc-progs/setuid.h | 4 ---- 2 files changed, 32 deletions(-) diff --git a/src/misc-progs/setuid.c b/src/misc-progs/setuid.c index d7fabd4941..9e5a8f54ef 100644 --- a/src/misc-progs/setuid.c +++ b/src/misc-progs/setuid.c @@ -174,31 +174,3 @@ int initsetuid(void) return 1; } - -/* check whether a file exists */ -int file_exists(const char *fname) { - struct stat st; - stat(fname, &st); - return S_ISREG(st.st_mode) ? 1 : 0; -} - -/* check whether a file exists. fname is wildcard eg: file_exists (/tmp/foo*) */ -int file_exists_w(const char *fname) -{ - /* do a quick check first */ - struct stat st; - stat(fname, &st); - if (S_ISREG(st.st_mode)) - return 1; - - /* check for possible wild cards in name */ - glob_t globbuf; - int retval=0; - if (glob(fname, GLOB_ERR, NULL, &globbuf)==0) { - if (globbuf.gl_pathc>0) { - retval=1; - } - } - globfree(&globbuf); - return retval; -} diff --git a/src/misc-progs/setuid.h b/src/misc-progs/setuid.h index e253a76570..1e0aed2a08 100644 --- a/src/misc-progs/setuid.h +++ b/src/misc-progs/setuid.h @@ -67,8 +67,4 @@ int unpriv_system(char* command, uid_t uid, gid_t gid); size_t strlcat(char *dst, const char *src, size_t len); int initsetuid(void); -/* check whether a file exists */ -int file_exists(const char *fname); -int file_exists_w(const char *fname); //wildcard filename test - #endif -- 2.39.5