aboutsummaryrefslogtreecommitdiff
path: root/util-linux
diff options
context:
space:
mode:
authorDenis Vlasenko <vda.linux@googlemail.com>2007-01-29 22:51:44 +0000
committerDenis Vlasenko <vda.linux@googlemail.com>2007-01-29 22:51:44 +0000
commit06c0a71d2315756db874e98bc4f760ca3283b6a6 (patch)
treedf385c84041f3fd8328e7a50caef4495ef2734a8 /util-linux
parentb6aae0f38194cd39960a898606ee65d4be93a895 (diff)
downloadbusybox-06c0a71d2315756db874e98bc4f760ca3283b6a6.tar.gz
preparatory patch for -Wwrite-strings #3
Diffstat (limited to 'util-linux')
-rw-r--r--util-linux/fdisk.c4
-rw-r--r--util-linux/fdisk_osf.c8
-rw-r--r--util-linux/ipcrm.c8
-rw-r--r--util-linux/mount.c10
4 files changed, 15 insertions, 15 deletions
diff --git a/util-linux/fdisk.c b/util-linux/fdisk.c
index f15b9af91..6d827105e 100644
--- a/util-linux/fdisk.c
+++ b/util-linux/fdisk.c
@@ -185,7 +185,7 @@ static void reread_partition_table(int leave);
static void delete_partition(int i);
static int get_partition(int warn, int max);
static void list_types(const struct systypes *sys);
-static unsigned read_int(unsigned low, unsigned dflt, unsigned high, unsigned base, char *mesg);
+static unsigned read_int(unsigned low, unsigned dflt, unsigned high, unsigned base, const char *mesg);
#endif
static const char *partition_type(unsigned char type);
static void fdisk_fatal(enum failure why) ATTRIBUTE_NORETURN;
@@ -1410,7 +1410,7 @@ get_boot(enum action what)
* There is no default if DFLT is not between LOW and HIGH.
*/
static unsigned
-read_int(unsigned low, unsigned dflt, unsigned high, unsigned base, char *mesg)
+read_int(unsigned low, unsigned dflt, unsigned high, unsigned base, const char *mesg)
{
unsigned i;
int default_ok = 1;
diff --git a/util-linux/fdisk_osf.c b/util-linux/fdisk_osf.c
index 3f56bd27d..2555c2e7b 100644
--- a/util-linux/fdisk_osf.c
+++ b/util-linux/fdisk_osf.c
@@ -630,7 +630,7 @@ xbsd_create_disklabel(void)
}
static int
-edit_int(int def, char *mesg)
+edit_int(int def, const char *mesg)
{
mesg = xasprintf("%s (%d): ", mesg, def);
do {
@@ -639,7 +639,7 @@ edit_int(int def, char *mesg)
} while (!isdigit(*line_ptr));
def = atoi(line_ptr);
ret:
- free(mesg);
+ free((char*)mesg);
return def;
}
@@ -707,9 +707,9 @@ sync_disks(void)
static void
xbsd_write_bootstrap(void)
{
- char *bootdir = BSD_LINUX_BOOTDIR;
char path[MAXPATHLEN];
- char *dkbasename;
+ const char *bootdir = BSD_LINUX_BOOTDIR;
+ const char *dkbasename;
struct xbsd_disklabel dl;
char *d, *p, *e;
int sector;
diff --git a/util-linux/ipcrm.c b/util-linux/ipcrm.c
index 507e58fe3..886c2efbd 100644
--- a/util-linux/ipcrm.c
+++ b/util-linux/ipcrm.c
@@ -152,8 +152,8 @@ int ipcrm_main(int argc, char **argv)
(c == 'm') ? shmget(key, 0, 0) : semget(key, 0, 0));
if (id < 0) {
- char *errmsg;
- const char * const what = "key";
+ const char *errmsg;
+ const char *const what = "key";
error++;
switch (errno) {
@@ -183,8 +183,8 @@ int ipcrm_main(int argc, char **argv)
semctl(id, 0, IPC_RMID, arg));
if (result) {
- char *errmsg;
- const char * const what = iskey ? "key" : "id";
+ const char *errmsg;
+ const char *const what = iskey ? "key" : "id";
error++;
switch (errno) {
diff --git a/util-linux/mount.c b/util-linux/mount.c
index ee45f01a6..ba98519b6 100644
--- a/util-linux/mount.c
+++ b/util-linux/mount.c
@@ -64,7 +64,7 @@ enum {
* flags */
struct {
- char *name;
+ const char *name;
long flags;
} static mount_options[] = {
// MS_FLAGS set a bit. ~MS_FLAGS disable that bit. 0 flags are NOPs.
@@ -122,7 +122,7 @@ struct {
#define VECTOR_SIZE(v) (sizeof(v) / sizeof((v)[0]))
/* Append mount options to string */
-static void append_mount_options(char **oldopts, char *newopts)
+static void append_mount_options(char **oldopts, const char *newopts)
{
if (*oldopts && **oldopts) {
/* do not insert options which are already there */
@@ -303,7 +303,7 @@ static int mount_it_now(struct mntent *mp, int vfsflags, char *filteropts)
fsname = 0;
if (!mp->mnt_type || !*mp->mnt_type) { /* bind mount */
mp->mnt_fsname = fsname = bb_simplify_path(mp->mnt_fsname);
- mp->mnt_type = "bind";
+ mp->mnt_type = (char*)"bind";
}
mp->mnt_freq = mp->mnt_passno = 0;
@@ -1342,7 +1342,7 @@ prepare_kernel_data:
do_mount: /* perform actual mount */
- mp->mnt_type = "nfs";
+ mp->mnt_type = (char*)"nfs";
retval = mount_it_now(mp, vfsflags, (char*)&data);
goto ret;
@@ -1428,7 +1428,7 @@ static int singlemount(struct mntent *mp, int ignore_busy)
// lock is required
vfsflags |= MS_MANDLOCK;
- mp->mnt_type = "cifs";
+ mp->mnt_type = (char*)"cifs";
rc = mount_it_now(mp, vfsflags, filteropts);
if (ENABLE_FEATURE_CLEAN_UP) free(mp->mnt_fsname);
goto report_error;