*/
#include <getopt.h>
-#include <stdlib.h>
-#include "busybox.h"
+#include "libbb.h"
+int losetup_main(int argc, char **argv);
int losetup_main(int argc, char **argv)
{
unsigned opt;
char *opt_o;
- int offset = 0;
+ unsigned long long offset = 0;
opt = getopt32(argc, argv, "do:", &opt_o);
argc -= optind;
}
if (opt == 0x2) // -o
- offset = bb_xparse_number(opt_o, NULL);
+ offset = xatoull(opt_o);
/* -o or no option */
bb_perror_nomsg_and_die();
} else if (argc == 1) {
char *s = query_loop(argv[0]);
- if (!s) bb_perror_nomsg_and_die();
+ if (!s)
+ bb_perror_nomsg_and_die();
printf("%s: %s\n", argv[0], s);
- if (ENABLE_FEATURE_CLEAN_UP) free(s);
+ if (ENABLE_FEATURE_CLEAN_UP)
+ free(s);
} else {
char dev[sizeof(LOOP_NAME"0")] = LOOP_NAME"0";
char c;
s = query_loop(dev);
if (s) {
printf("%s: %s\n", dev, s);
- if (ENABLE_FEATURE_CLEAN_UP) free(s);
+ if (ENABLE_FEATURE_CLEAN_UP)
+ free(s);
}
}
}