X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=util-linux%2Fumount.c;h=0662cea1b48c4e6b3c4db6cfe4910731c6d39b3d;hb=4bdeaaf556043964d7d772b492882a6835eb4622;hp=6136fa97cd4c87e7154d002c7d6f73a5ad91c7fc;hpb=68404f13d4bf4826e3609703dad5375763db28ab;p=oweals%2Fbusybox.git diff --git a/util-linux/umount.c b/util-linux/umount.c index 6136fa97c..0662cea1b 100644 --- a/util-linux/umount.c +++ b/util-linux/umount.c @@ -9,9 +9,19 @@ */ #include -#include #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) @@ -27,7 +37,7 @@ //#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 */ @@ -59,7 +69,7 @@ int umount_main(int argc ATTRIBUTE_UNUSED, char **argv) 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 */ @@ -122,13 +132,13 @@ int umount_main(int argc ATTRIBUTE_UNUSED, char **argv) 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