misc-progs: Remove unused functions.

This commit is contained in:
Michael Tremer
2013-10-12 16:23:41 +02:00
parent ab89cb2253
commit 42ec14cf2b
2 changed files with 0 additions and 32 deletions

View File

@@ -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;
}

View File

@@ -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