stat: fix compile breakage (get_f_fsid() is used even if !FEATURE_STAT_FORMAT)
This commit is contained in:
@ -125,20 +125,6 @@ static const char *human_fstype(uint32_t f_type)
|
|||||||
return humantypes[i].fs;
|
return humantypes[i].fs;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if ENABLE_FEATURE_STAT_FORMAT
|
|
||||||
static void strcatc(char *str, char c)
|
|
||||||
{
|
|
||||||
int len = strlen(str);
|
|
||||||
str[len++] = c;
|
|
||||||
str[len] = '\0';
|
|
||||||
}
|
|
||||||
|
|
||||||
static void printfs(char *pformat, const char *msg)
|
|
||||||
{
|
|
||||||
strcatc(pformat, 's');
|
|
||||||
printf(pformat, msg);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* "man statfs" says that statfsbuf->f_fsid is a mess */
|
/* "man statfs" says that statfsbuf->f_fsid is a mess */
|
||||||
/* coreutils treats it as an array of ints, most significant first */
|
/* coreutils treats it as an array of ints, most significant first */
|
||||||
static unsigned long long get_f_fsid(const struct statfs *statfsbuf)
|
static unsigned long long get_f_fsid(const struct statfs *statfsbuf)
|
||||||
@ -153,6 +139,20 @@ static unsigned long long get_f_fsid(const struct statfs *statfsbuf)
|
|||||||
return r;
|
return r;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if ENABLE_FEATURE_STAT_FORMAT
|
||||||
|
static void strcatc(char *str, char c)
|
||||||
|
{
|
||||||
|
int len = strlen(str);
|
||||||
|
str[len++] = c;
|
||||||
|
str[len] = '\0';
|
||||||
|
}
|
||||||
|
|
||||||
|
static void printfs(char *pformat, const char *msg)
|
||||||
|
{
|
||||||
|
strcatc(pformat, 's');
|
||||||
|
printf(pformat, msg);
|
||||||
|
}
|
||||||
|
|
||||||
/* print statfs info */
|
/* print statfs info */
|
||||||
static void print_statfs(char *pformat, const char m,
|
static void print_statfs(char *pformat, const char m,
|
||||||
const char *const filename, const void *data
|
const char *const filename, const void *data
|
||||||
|
Reference in New Issue
Block a user