mirror of
https://github.com/vincentmli/bpfire.git
synced 2026-04-10 02:55:55 +02:00
misc-progs: Remove unused functions.
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user