#include <string.h>
#include <getopt.h>
-#include <lustre_disk.h>
-#include <lustre_ver.h>
+#include <asm/byteorder.h>
+#include <linux/lustre/lustre_disk.h>
+#include <linux/lustre/lustre_ver.h>
char *progname;
-static struct option const longopts[] = {
- { "help", no_argument, 0, 'h' },
- { "client", no_argument, 0, 'c' },
- { "reply", no_argument, 0, 'r' },
- { 0, 0, 0, 0}
-};
+static struct option const long_opts[] = {
+ { .val = 'c', .name = "client", .has_arg = no_argument },
+ { .val = 'h', .name = "help", .has_arg = no_argument },
+ { .val = 'r', .name = "reply", .has_arg = no_argument },
+ { .name = NULL } };
/* Executes the command \a cmd and returns command status.
*/
fd = mkstemp(log);
if (fd >= 0) {
close(fd);
- strncat(cmd, " >", 2);
- strncat(cmd, log, strlen(log));
+ strncat(cmd, " >", cmdsz);
+ strncat(cmd, log, cmdsz);
}
- strncat(cmd, " 2>&1", 5);
+ strncat(cmd, " 2>&1", cmdsz - strlen(cmd));
/* Can't use popen because we need the rv of the command */
rc = system(cmd);
int opt_reply = 0;
progname = argv[0];
- while ((c = getopt_long(argc, argv, "chr", longopts, NULL)) != -1) {
+ while ((c = getopt_long(argc, argv, "chr", long_opts, NULL)) != -1) {
switch (c) {
case 'c':
opt_client = 1;