* Mini umount implementation for busybox
*
*
- * Copyright (C) 1999,2000 by Lineo, inc.
+ * Copyright (C) 1999,2000,2001 by Lineo, inc.
* Written by Erik Andersen <andersen@lineo.com>, <andersee@debian.org>
*
* This program is free software; you can redistribute it and/or modify
*
*/
-#include "busybox.h"
#include <stdio.h>
#include <mntent.h>
#include <errno.h>
+#include <string.h>
+#include <stdlib.h>
+#include "busybox.h"
static const int MNT_FORCE = 1;
return;
if ((fp = setmntent(mtab_file, "r")) == NULL) {
- error_msg("Cannot open %s\n", mtab_file);
+ error_msg("Cannot open %s", mtab_file);
return;
}
while ((e = getmntent(fp))) {
if (status != 0 && doForce == TRUE) {
status = umount2(blockDevice, MNT_FORCE);
if (status != 0) {
- error_msg_and_die("forced umount of %s failed!\n", blockDevice);
+ error_msg_and_die("forced umount of %s failed!", blockDevice);
}
}
#endif
status = mount(blockDevice, name, NULL,
MS_MGC_VAL | MS_REMOUNT | MS_RDONLY, NULL);
if (status == 0) {
- error_msg("%s busy - remounted read-only\n", blockDevice);
+ error_msg("%s busy - remounted read-only", blockDevice);
} else {
- error_msg("Cannot remount %s read-only\n", blockDevice);
+ error_msg("Cannot remount %s read-only", blockDevice);
}
}
if (status == 0) {
extern int umount_main(int argc, char **argv)
{
if (argc < 2) {
- usage(umount_usage);
+ show_usage();
}
#ifdef BB_FEATURE_CLEAN_UP
atexit(mtab_free);
case 'v':
break; /* ignore -v */
default:
- usage(umount_usage);
+ show_usage();
}
}