19 Aug
2009
19 Aug
'09
1:35 p.m.
...
+static const char * +get_mke2fs (void) +{ + static const char *progs[] = { "/sbin/mke4fs", "/sbin/mke2fs", NULL }; + int i; + + for (i = 0; progs[i]; ++i) + if (access (progs[i], F_OK) == 0) + return progs[i]; + + reply_with_error ("mke2fs: no mke2fs binary found in appliance"); + return NULL; ...
All looks good One nit: you can add one more "const" there, since it's a const list of const strings: static const char *const progs[] = { "/sbin/mke4fs", "/sbin/mke2fs", NULL };