*/
#include <mntent.h>
-#include <getopt.h>
#include "libbb.h"
+#if defined(__dietlibc__)
+/* 16.12.2006, Sampo Kellomaki (sampo@iki.fi)
+ * dietlibc-0.30 does not have implementation of getmntent_r() */
+static struct mntent *getmntent_r(FILE* stream, struct mntent* result,
+ char* buffer UNUSED_PARAM, int bufsize UNUSED_PARAM)
+{
+ struct mntent* ment = getmntent(stream);
+ return memcpy(result, ment, sizeof(*ment));
+}
+#endif
+
/* ignored: -v -d -t -i */
#define OPTION_STRING "fldnra" "vdt:i"
#define OPT_FORCE (1 << 0)
//#define MNT_DETACH 0x00000002 /* Just detach from the tree */
int umount_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
-int umount_main(int argc ATTRIBUTE_UNUSED, char **argv)
+int umount_main(int argc UNUSED_PARAM, char **argv)
{
int doForce;
char *const path = xmalloc(PATH_MAX + 2); /* to save stack */
fp = setmntent(bb_path_mtab_file, "r");
if (!fp) {
if (opt & OPT_ALL)
- bb_error_msg_and_die("cannot open %s", bb_path_mtab_file);
+ bb_error_msg_and_die("can't open %s", bb_path_mtab_file);
} else {
while (getmntent_r(fp, &me, path, PATH_MAX)) {
/* Match fstype if passed */
const char *msg = "%s busy - remounted read-only";
curstat = mount(m->device, zapit, NULL, MS_REMOUNT|MS_RDONLY, NULL);
if (curstat) {
- msg = "cannot remount %s read-only";
+ msg = "can't remount %s read-only";
status = EXIT_FAILURE;
}
bb_error_msg(msg, m->device);
} else {
status = EXIT_FAILURE;
- bb_perror_msg("cannot %sumount %s", (doForce ? "forcibly " : ""), zapit);
+ bb_perror_msg("can't %sumount %s", (doForce ? "forcibly " : ""), zapit);
}
} else {
// De-allocate the loop device. This ioctl should be ignored on