extern int optind;
#endif
-void __attribute__((__noreturn__)) usage(char *prog)
+static void __attribute__((__noreturn__)) usage(char *prog)
{
fprintf(stderr, "Usage: %s [-f blkid_file] [-m debug_mask]\n", prog);
fprintf(stderr, "\tList all devices and exit\n");
extern int optind;
#endif
-void __attribute__((__noreturn__)) usage(char *prog)
+static void __attribute__((__noreturn__)) usage(char *prog)
{
fprintf(stderr, "Usage: %s [-f blkid_file] [-m debug_mask] device "
"[type value]\n",
}
#ifdef TEST_PROGRAM
-int test_ranges(struct fdisk_test *ts, int argc, char *argv[])
+static int test_ranges(struct fdisk_test *ts, int argc, char *argv[])
{
/* 1 - 3, 6, 8, 9, 11 13 */
size_t nums[] = { 1, 1, 1, 0, 0, 1, 0, 1, 1, 0, 1, 0, 1 };
}
#ifdef TEST_PROGRAM
-int test_getattr(struct fdisk_test *ts, int argc, char *argv[])
+static int test_getattr(struct fdisk_test *ts, int argc, char *argv[])
{
const char *disk = argv[1];
size_t part = strtoul(argv[2], NULL, 0) - 1;
return 0;
}
-int test_setattr(struct fdisk_test *ts, int argc, char *argv[])
+static int test_setattr(struct fdisk_test *ts, int argc, char *argv[])
{
const char *disk = argv[1];
size_t part = strtoul(argv[2], NULL, 0) - 1;
}
#ifdef TEST_PROGRAM
-int test_dump(struct fdisk_test *ts, int argc, char *argv[])
+static int test_dump(struct fdisk_test *ts, int argc, char *argv[])
{
char *devname = argv[1];
struct fdisk_context *cxt;
return 0;
}
-int test_read(struct fdisk_test *ts, int argc, char *argv[])
+static int test_read(struct fdisk_test *ts, int argc, char *argv[])
{
char *filename = argv[1];
struct fdisk_script *dp;
return 0;
}
-int test_stdin(struct fdisk_test *ts, int argc, char *argv[])
+static int test_stdin(struct fdisk_test *ts, int argc, char *argv[])
{
char buf[BUFSIZ];
struct fdisk_script *dp;
return rc;
}
-int test_apply(struct fdisk_test *ts, int argc, char *argv[])
+static int test_apply(struct fdisk_test *ts, int argc, char *argv[])
{
char *devname = argv[1], *scriptname = argv[2];
struct fdisk_context *cxt;
struct fdisk_label *fdisk_new_dos_label(struct fdisk_context *cxt) { return NULL; }
struct fdisk_label *fdisk_new_bsd_label(struct fdisk_context *cxt) { return NULL; }
-int test_partnames(struct fdisk_test *ts, int argc, char *argv[])
+static int test_partnames(struct fdisk_test *ts, int argc, char *argv[])
{
size_t i;
const char *disk = argv[1];
}
#ifdef TEST_PROGRAM
-int test_version(struct fdisk_test *ts, int argc, char *argv[])
+static int test_version(struct fdisk_test *ts, int argc, char *argv[])
{
const char *ver;
const char **features;
#ifdef TEST_PROGRAM
-int test_resolve_path(struct libmnt_test *ts, int argc, char *argv[])
+static int test_resolve_path(struct libmnt_test *ts, int argc, char *argv[])
{
char line[BUFSIZ];
struct libmnt_cache *cache;
return 0;
}
-int test_resolve_spec(struct libmnt_test *ts, int argc, char *argv[])
+static int test_resolve_spec(struct libmnt_test *ts, int argc, char *argv[])
{
char line[BUFSIZ];
struct libmnt_cache *cache;
return 0;
}
-int test_read_tags(struct libmnt_test *ts, int argc, char *argv[])
+static int test_read_tags(struct libmnt_test *ts, int argc, char *argv[])
{
char line[BUFSIZ];
struct libmnt_cache *cache;
mnt_unlock_file(lock);
}
-int test_mount(struct libmnt_test *ts, int argc, char *argv[])
+static int test_mount(struct libmnt_test *ts, int argc, char *argv[])
{
int idx = 1, rc = 0;
struct libmnt_context *cxt;
return rc;
}
-int test_umount(struct libmnt_test *ts, int argc, char *argv[])
+static int test_umount(struct libmnt_test *ts, int argc, char *argv[])
{
int idx = 1, rc = 0;
struct libmnt_context *cxt;
return rc;
}
-int test_flags(struct libmnt_test *ts, int argc, char *argv[])
+static int test_flags(struct libmnt_test *ts, int argc, char *argv[])
{
int idx = 1, rc = 0;
struct libmnt_context *cxt;
return rc;
}
-int test_mountall(struct libmnt_test *ts, int argc, char *argv[])
+static int test_mountall(struct libmnt_test *ts, int argc, char *argv[])
{
struct libmnt_context *cxt;
struct libmnt_iter *itr;
* read number from @filename, increment the number and
* write the number back to the file
*/
-void increment_data(const char *filename, int verbose, int loopno)
+static void increment_data(const char *filename, int verbose, int loopno)
{
long num;
FILE *f;
filename, num - 1, num, loopno);
}
-void clean_lock(void)
+static void clean_lock(void)
{
if (!lock)
return;
mnt_free_lock(lock);
}
-void __attribute__((__noreturn__)) sig_handler(int sig)
+static void __attribute__((__noreturn__)) sig_handler(int sig)
{
errx(EXIT_FAILURE, "\n%d: catch signal: %s\n", getpid(), strsignal(sig));
}
-int test_lock(struct libmnt_test *ts, int argc, char *argv[])
+static int test_lock(struct libmnt_test *ts, int argc, char *argv[])
{
time_t synctime = 0;
unsigned int usecs;
/*
* create a monitor and add the monitor fd to epoll
*/
-int __test_epoll(struct libmnt_test *ts, int argc, char *argv[], int cleanup)
+static int __test_epoll(struct libmnt_test *ts, int argc, char *argv[], int cleanup)
{
int fd, efd = -1, rc = -1;
struct epoll_event ev;
/*
* create a monitor and add the monitor fd to epoll
*/
-int test_epoll(struct libmnt_test *ts, int argc, char *argv[])
+static int test_epoll(struct libmnt_test *ts, int argc, char *argv[])
{
return __test_epoll(ts, argc, argv, 0);
}
-int test_epoll_cleanup(struct libmnt_test *ts, int argc, char *argv[])
+static int test_epoll_cleanup(struct libmnt_test *ts, int argc, char *argv[])
{
return __test_epoll(ts, argc, argv, 1);
}
/*
* create a monitor and wait for a change
*/
-int test_wait(struct libmnt_test *ts, int argc, char *argv[])
+static int test_wait(struct libmnt_test *ts, int argc, char *argv[])
{
const char *filename;
struct libmnt_monitor *mn = create_test_monitor(argc, argv);
#ifdef TEST_PROGRAM
-int test_append(struct libmnt_test *ts, int argc, char *argv[])
+static int test_append(struct libmnt_test *ts, int argc, char *argv[])
{
const char *value = NULL, *name;
char *optstr;
return rc;
}
-int test_prepend(struct libmnt_test *ts, int argc, char *argv[])
+static int test_prepend(struct libmnt_test *ts, int argc, char *argv[])
{
const char *value = NULL, *name;
char *optstr;
return rc;
}
-int test_split(struct libmnt_test *ts, int argc, char *argv[])
+static int test_split(struct libmnt_test *ts, int argc, char *argv[])
{
char *optstr, *user = NULL, *fs = NULL, *vfs = NULL;
int rc;
return rc;
}
-int test_flags(struct libmnt_test *ts, int argc, char *argv[])
+static int test_flags(struct libmnt_test *ts, int argc, char *argv[])
{
char *optstr;
int rc;
return rc;
}
-int test_apply(struct libmnt_test *ts, int argc, char *argv[])
+static int test_apply(struct libmnt_test *ts, int argc, char *argv[])
{
char *optstr;
int rc, map;
return rc;
}
-int test_set(struct libmnt_test *ts, int argc, char *argv[])
+static int test_set(struct libmnt_test *ts, int argc, char *argv[])
{
const char *value = NULL, *name;
char *optstr;
return rc;
}
-int test_get(struct libmnt_test *ts, int argc, char *argv[])
+static int test_get(struct libmnt_test *ts, int argc, char *argv[])
{
char *optstr;
const char *name;
return rc;
}
-int test_remove(struct libmnt_test *ts, int argc, char *argv[])
+static int test_remove(struct libmnt_test *ts, int argc, char *argv[])
{
const char *name;
char *optstr;
return rc;
}
-int test_dedup(struct libmnt_test *ts, int argc, char *argv[])
+static int test_dedup(struct libmnt_test *ts, int argc, char *argv[])
{
const char *name;
char *optstr;
return rc;
}
-int test_fix(struct libmnt_test *ts, int argc, char *argv[])
+static int test_fix(struct libmnt_test *ts, int argc, char *argv[])
{
char *optstr;
int rc = 0;
return 1; /* all errors are recoverable -- this is the default */
}
-struct libmnt_table *create_table(const char *file, int comments)
+static struct libmnt_table *create_table(const char *file, int comments)
{
struct libmnt_table *tb;
return NULL;
}
-int test_copy_fs(struct libmnt_test *ts, int argc, char *argv[])
+static int test_copy_fs(struct libmnt_test *ts, int argc, char *argv[])
{
struct libmnt_table *tb;
struct libmnt_fs *fs;
return rc;
}
-int test_parse(struct libmnt_test *ts, int argc, char *argv[])
+static int test_parse(struct libmnt_test *ts, int argc, char *argv[])
{
struct libmnt_table *tb = NULL;
struct libmnt_iter *itr = NULL;
return rc;
}
-int test_find(struct libmnt_test *ts, int argc, char *argv[], int dr)
+static int test_find(struct libmnt_test *ts, int argc, char *argv[], int dr)
{
struct libmnt_table *tb;
struct libmnt_fs *fs = NULL;
return rc;
}
-int test_find_bw(struct libmnt_test *ts, int argc, char *argv[])
+static int test_find_bw(struct libmnt_test *ts, int argc, char *argv[])
{
return test_find(ts, argc, argv, MNT_ITER_BACKWARD);
}
-int test_find_fw(struct libmnt_test *ts, int argc, char *argv[])
+static int test_find_fw(struct libmnt_test *ts, int argc, char *argv[])
{
return test_find(ts, argc, argv, MNT_ITER_FORWARD);
}
-int test_find_pair(struct libmnt_test *ts, int argc, char *argv[])
+static int test_find_pair(struct libmnt_test *ts, int argc, char *argv[])
{
struct libmnt_table *tb;
struct libmnt_fs *fs;
return rc;
}
-int test_find_mountpoint(struct libmnt_test *ts, int argc, char *argv[])
+static int test_find_mountpoint(struct libmnt_test *ts, int argc, char *argv[])
{
struct libmnt_table *tb;
struct libmnt_fs *fs;
#ifdef TEST_PROGRAM
-int test_diff(struct libmnt_test *ts, int argc, char *argv[])
+static int test_diff(struct libmnt_test *ts, int argc, char *argv[])
{
struct libmnt_table *tb_old = NULL, *tb_new = NULL;
struct libmnt_tabdiff *diff = NULL;
}
#ifdef TEST_PROGRAM
-int test_match_fstype(struct libmnt_test *ts, int argc, char *argv[])
+static int test_match_fstype(struct libmnt_test *ts, int argc, char *argv[])
{
char *type = argv[1];
char *pattern = argv[2];
return 0;
}
-int test_match_options(struct libmnt_test *ts, int argc, char *argv[])
+static int test_match_options(struct libmnt_test *ts, int argc, char *argv[])
{
char *optstr = argv[1];
char *pattern = argv[2];
return 0;
}
-int test_startswith(struct libmnt_test *ts, int argc, char *argv[])
+static int test_startswith(struct libmnt_test *ts, int argc, char *argv[])
{
char *optstr = argv[1];
char *pattern = argv[2];
return 0;
}
-int test_endswith(struct libmnt_test *ts, int argc, char *argv[])
+static int test_endswith(struct libmnt_test *ts, int argc, char *argv[])
{
char *optstr = argv[1];
char *pattern = argv[2];
return 0;
}
-int test_appendstr(struct libmnt_test *ts, int argc, char *argv[])
+static int test_appendstr(struct libmnt_test *ts, int argc, char *argv[])
{
char *str = strdup(argv[1]);
const char *ap = argv[2];
return 0;
}
-int test_mountpoint(struct libmnt_test *ts, int argc, char *argv[])
+static int test_mountpoint(struct libmnt_test *ts, int argc, char *argv[])
{
char *path = canonicalize_path(argv[1]),
*mnt = path ? mnt_get_mountpoint(path) : NULL;
return 0;
}
-int test_filesystems(struct libmnt_test *ts, int argc, char *argv[])
+static int test_filesystems(struct libmnt_test *ts, int argc, char *argv[])
{
char **filesystems = NULL;
int rc;
return rc;
}
-int test_chdir(struct libmnt_test *ts, int argc, char *argv[])
+static int test_chdir(struct libmnt_test *ts, int argc, char *argv[])
{
int rc;
char *path = canonicalize_path(argv[1]),
return rc;
}
-int test_kernel_cmdline(struct libmnt_test *ts, int argc, char *argv[])
+static int test_kernel_cmdline(struct libmnt_test *ts, int argc, char *argv[])
{
char *name = argv[1];
char *res;
return 0;
}
-int test_mkdir(struct libmnt_test *ts, int argc, char *argv[])
+static int test_mkdir(struct libmnt_test *ts, int argc, char *argv[])
{
int rc;
return rc;
}
-int test_statfs_type(struct libmnt_test *ts, int argc, char *argv[])
+static int test_statfs_type(struct libmnt_test *ts, int argc, char *argv[])
{
struct statfs vfs;
int rc;
}
#ifdef TEST_PROGRAM
-int test_version(struct libmnt_test *ts, int argc, char *argv[])
+static int test_version(struct libmnt_test *ts, int argc, char *argv[])
{
const char *ver;
const char **features;
{
int x = snprintf(buf, sz, "%s-%s-", prefix, sub_prefix);
- for ( ; x < sz - 1; x++)
+ for ( ; (size_t)x < sz - 1; x++)
buf[x] = *prefix;
buf[x++] = 'x';