diff options
author | Denis Vlasenko <vda.linux@googlemail.com> | 2007-01-29 22:51:44 +0000 |
---|---|---|
committer | Denis Vlasenko <vda.linux@googlemail.com> | 2007-01-29 22:51:44 +0000 |
commit | 06c0a71d2315756db874e98bc4f760ca3283b6a6 (patch) | |
tree | df385c84041f3fd8328e7a50caef4495ef2734a8 /util-linux | |
parent | b6aae0f38194cd39960a898606ee65d4be93a895 (diff) | |
download | busybox-w32-06c0a71d2315756db874e98bc4f760ca3283b6a6.tar.gz busybox-w32-06c0a71d2315756db874e98bc4f760ca3283b6a6.tar.bz2 busybox-w32-06c0a71d2315756db874e98bc4f760ca3283b6a6.zip |
preparatory patch for -Wwrite-strings #3
Diffstat (limited to 'util-linux')
-rw-r--r-- | util-linux/fdisk.c | 4 | ||||
-rw-r--r-- | util-linux/fdisk_osf.c | 8 | ||||
-rw-r--r-- | util-linux/ipcrm.c | 8 | ||||
-rw-r--r-- | util-linux/mount.c | 10 |
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); | |||
185 | static void delete_partition(int i); | 185 | static void delete_partition(int i); |
186 | static int get_partition(int warn, int max); | 186 | static int get_partition(int warn, int max); |
187 | static void list_types(const struct systypes *sys); | 187 | static void list_types(const struct systypes *sys); |
188 | static unsigned read_int(unsigned low, unsigned dflt, unsigned high, unsigned base, char *mesg); | 188 | static unsigned read_int(unsigned low, unsigned dflt, unsigned high, unsigned base, const char *mesg); |
189 | #endif | 189 | #endif |
190 | static const char *partition_type(unsigned char type); | 190 | static const char *partition_type(unsigned char type); |
191 | static void fdisk_fatal(enum failure why) ATTRIBUTE_NORETURN; | 191 | static void fdisk_fatal(enum failure why) ATTRIBUTE_NORETURN; |
@@ -1410,7 +1410,7 @@ get_boot(enum action what) | |||
1410 | * There is no default if DFLT is not between LOW and HIGH. | 1410 | * There is no default if DFLT is not between LOW and HIGH. |
1411 | */ | 1411 | */ |
1412 | static unsigned | 1412 | static unsigned |
1413 | read_int(unsigned low, unsigned dflt, unsigned high, unsigned base, char *mesg) | 1413 | read_int(unsigned low, unsigned dflt, unsigned high, unsigned base, const char *mesg) |
1414 | { | 1414 | { |
1415 | unsigned i; | 1415 | unsigned i; |
1416 | int default_ok = 1; | 1416 | 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) | |||
630 | } | 630 | } |
631 | 631 | ||
632 | static int | 632 | static int |
633 | edit_int(int def, char *mesg) | 633 | edit_int(int def, const char *mesg) |
634 | { | 634 | { |
635 | mesg = xasprintf("%s (%d): ", mesg, def); | 635 | mesg = xasprintf("%s (%d): ", mesg, def); |
636 | do { | 636 | do { |
@@ -639,7 +639,7 @@ edit_int(int def, char *mesg) | |||
639 | } while (!isdigit(*line_ptr)); | 639 | } while (!isdigit(*line_ptr)); |
640 | def = atoi(line_ptr); | 640 | def = atoi(line_ptr); |
641 | ret: | 641 | ret: |
642 | free(mesg); | 642 | free((char*)mesg); |
643 | return def; | 643 | return def; |
644 | } | 644 | } |
645 | 645 | ||
@@ -707,9 +707,9 @@ sync_disks(void) | |||
707 | static void | 707 | static void |
708 | xbsd_write_bootstrap(void) | 708 | xbsd_write_bootstrap(void) |
709 | { | 709 | { |
710 | char *bootdir = BSD_LINUX_BOOTDIR; | ||
711 | char path[MAXPATHLEN]; | 710 | char path[MAXPATHLEN]; |
712 | char *dkbasename; | 711 | const char *bootdir = BSD_LINUX_BOOTDIR; |
712 | const char *dkbasename; | ||
713 | struct xbsd_disklabel dl; | 713 | struct xbsd_disklabel dl; |
714 | char *d, *p, *e; | 714 | char *d, *p, *e; |
715 | int sector; | 715 | 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) | |||
152 | (c == 'm') ? shmget(key, 0, 0) : semget(key, 0, 0)); | 152 | (c == 'm') ? shmget(key, 0, 0) : semget(key, 0, 0)); |
153 | 153 | ||
154 | if (id < 0) { | 154 | if (id < 0) { |
155 | char *errmsg; | 155 | const char *errmsg; |
156 | const char * const what = "key"; | 156 | const char *const what = "key"; |
157 | 157 | ||
158 | error++; | 158 | error++; |
159 | switch (errno) { | 159 | switch (errno) { |
@@ -183,8 +183,8 @@ int ipcrm_main(int argc, char **argv) | |||
183 | semctl(id, 0, IPC_RMID, arg)); | 183 | semctl(id, 0, IPC_RMID, arg)); |
184 | 184 | ||
185 | if (result) { | 185 | if (result) { |
186 | char *errmsg; | 186 | const char *errmsg; |
187 | const char * const what = iskey ? "key" : "id"; | 187 | const char *const what = iskey ? "key" : "id"; |
188 | 188 | ||
189 | error++; | 189 | error++; |
190 | switch (errno) { | 190 | 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 { | |||
64 | * flags */ | 64 | * flags */ |
65 | 65 | ||
66 | struct { | 66 | struct { |
67 | char *name; | 67 | const char *name; |
68 | long flags; | 68 | long flags; |
69 | } static mount_options[] = { | 69 | } static mount_options[] = { |
70 | // MS_FLAGS set a bit. ~MS_FLAGS disable that bit. 0 flags are NOPs. | 70 | // MS_FLAGS set a bit. ~MS_FLAGS disable that bit. 0 flags are NOPs. |
@@ -122,7 +122,7 @@ struct { | |||
122 | #define VECTOR_SIZE(v) (sizeof(v) / sizeof((v)[0])) | 122 | #define VECTOR_SIZE(v) (sizeof(v) / sizeof((v)[0])) |
123 | 123 | ||
124 | /* Append mount options to string */ | 124 | /* Append mount options to string */ |
125 | static void append_mount_options(char **oldopts, char *newopts) | 125 | static void append_mount_options(char **oldopts, const char *newopts) |
126 | { | 126 | { |
127 | if (*oldopts && **oldopts) { | 127 | if (*oldopts && **oldopts) { |
128 | /* do not insert options which are already there */ | 128 | /* do not insert options which are already there */ |
@@ -303,7 +303,7 @@ static int mount_it_now(struct mntent *mp, int vfsflags, char *filteropts) | |||
303 | fsname = 0; | 303 | fsname = 0; |
304 | if (!mp->mnt_type || !*mp->mnt_type) { /* bind mount */ | 304 | if (!mp->mnt_type || !*mp->mnt_type) { /* bind mount */ |
305 | mp->mnt_fsname = fsname = bb_simplify_path(mp->mnt_fsname); | 305 | mp->mnt_fsname = fsname = bb_simplify_path(mp->mnt_fsname); |
306 | mp->mnt_type = "bind"; | 306 | mp->mnt_type = (char*)"bind"; |
307 | } | 307 | } |
308 | mp->mnt_freq = mp->mnt_passno = 0; | 308 | mp->mnt_freq = mp->mnt_passno = 0; |
309 | 309 | ||
@@ -1342,7 +1342,7 @@ prepare_kernel_data: | |||
1342 | 1342 | ||
1343 | do_mount: /* perform actual mount */ | 1343 | do_mount: /* perform actual mount */ |
1344 | 1344 | ||
1345 | mp->mnt_type = "nfs"; | 1345 | mp->mnt_type = (char*)"nfs"; |
1346 | retval = mount_it_now(mp, vfsflags, (char*)&data); | 1346 | retval = mount_it_now(mp, vfsflags, (char*)&data); |
1347 | goto ret; | 1347 | goto ret; |
1348 | 1348 | ||
@@ -1428,7 +1428,7 @@ static int singlemount(struct mntent *mp, int ignore_busy) | |||
1428 | // lock is required | 1428 | // lock is required |
1429 | vfsflags |= MS_MANDLOCK; | 1429 | vfsflags |= MS_MANDLOCK; |
1430 | 1430 | ||
1431 | mp->mnt_type = "cifs"; | 1431 | mp->mnt_type = (char*)"cifs"; |
1432 | rc = mount_it_now(mp, vfsflags, filteropts); | 1432 | rc = mount_it_now(mp, vfsflags, filteropts); |
1433 | if (ENABLE_FEATURE_CLEAN_UP) free(mp->mnt_fsname); | 1433 | if (ENABLE_FEATURE_CLEAN_UP) free(mp->mnt_fsname); |
1434 | goto report_error; | 1434 | goto report_error; |