summaryrefslogtreecommitdiff
path: root/util-linux
diff options
context:
space:
mode:
Diffstat (limited to 'util-linux')
-rw-r--r--util-linux/fbset.c4
-rw-r--r--util-linux/fsck_minix.c2
-rw-r--r--util-linux/getopt.c8
-rw-r--r--util-linux/mkfs_minix.c50
-rw-r--r--util-linux/mkswap.c32
-rw-r--r--util-linux/mount.c10
-rw-r--r--util-linux/nfsmount.c24
-rw-r--r--util-linux/rdate.c2
-rw-r--r--util-linux/swaponoff.c2
-rw-r--r--util-linux/umount.c8
10 files changed, 71 insertions, 71 deletions
diff --git a/util-linux/fbset.c b/util-linux/fbset.c
index 637896b..f20c284 100644
--- a/util-linux/fbset.c
+++ b/util-linux/fbset.c
@@ -284,7 +284,7 @@ static int readmode(struct fb_var_screeninfo *base, const char *fn,
}
}
#else
- error_msg( "mode reading not compiled in\n");
+ error_msg( "mode reading not compiled in");
#endif
return 0;
}
@@ -434,7 +434,7 @@ extern int fbset_main(int argc, char **argv)
perror_msg_and_die("fbset(ioctl)");
if (g_options & OPT_READMODE) {
if (!readmode(&var, modefile, mode)) {
- error_msg("Unknown video mode `%s'\n", mode);
+ error_msg("Unknown video mode `%s'", mode);
return EXIT_FAILURE;
}
}
diff --git a/util-linux/fsck_minix.c b/util-linux/fsck_minix.c
index 18841ec..9d76220 100644
--- a/util-linux/fsck_minix.c
+++ b/util-linux/fsck_minix.c
@@ -290,7 +290,7 @@ static void show_usage(void)
static void die(const char *str)
{
- error_msg("%s\n", str);
+ error_msg("%s", str);
leave(8);
}
diff --git a/util-linux/getopt.c b/util-linux/getopt.c
index ff55a3e..6252631 100644
--- a/util-linux/getopt.c
+++ b/util-linux/getopt.c
@@ -258,7 +258,7 @@ void add_long_options(char *options)
arg_opt=required_argument;
}
if (strlen(tokptr) == 0)
- error_msg("empty long option after -l or --long argument\n");
+ error_msg("empty long option after -l or --long argument");
}
add_longopt(tokptr,arg_opt);
}
@@ -277,7 +277,7 @@ void set_shell(const char *new_shell)
else if (!strcmp(new_shell,"csh"))
shell=TCSH;
else
- error_msg("unknown shell after -s or --shell argument\n");
+ error_msg("unknown shell after -s or --shell argument");
}
@@ -326,7 +326,7 @@ int getopt_main(int argc, char *argv[])
printf(" --\n");
exit(0);
} else
- error_msg_and_die("missing optstring argument\n");
+ error_msg_and_die("missing optstring argument");
}
if (argv[1][0] != '-' || compatible) {
@@ -377,7 +377,7 @@ int getopt_main(int argc, char *argv[])
if (!optstr) {
if (optind >= argc)
- error_msg_and_die("missing optstring argument\n");
+ error_msg_and_die("missing optstring argument");
else {
optstr=xmalloc(strlen(argv[optind])+1);
strcpy(optstr,argv[optind]);
diff --git a/util-linux/mkfs_minix.c b/util-linux/mkfs_minix.c
index 21965d3..a2b6d8a 100644
--- a/util-linux/mkfs_minix.c
+++ b/util-linux/mkfs_minix.c
@@ -279,7 +279,7 @@ static void check_mount(void)
if (!mnt)
return;
- error_msg_and_die("%s is mounted; will not make a filesystem here!\n", device_name);
+ error_msg_and_die("%s is mounted; will not make a filesystem here!", device_name);
}
static long valid_offset(int fd, int offset)
@@ -336,28 +336,28 @@ static void write_tables(void)
Super.s_state &= ~MINIX_ERROR_FS;
if (lseek(DEV, 0, SEEK_SET))
- error_msg_and_die("seek to boot block failed in write_tables\n");
+ error_msg_and_die("seek to boot block failed in write_tables");
if (512 != write(DEV, boot_block_buffer, 512))
- error_msg_and_die("unable to clear boot sector\n");
+ error_msg_and_die("unable to clear boot sector");
if (BLOCK_SIZE != lseek(DEV, BLOCK_SIZE, SEEK_SET))
- error_msg_and_die("seek failed in write_tables\n");
+ error_msg_and_die("seek failed in write_tables");
if (BLOCK_SIZE != write(DEV, super_block_buffer, BLOCK_SIZE))
- error_msg_and_die("unable to write super-block\n");
+ error_msg_and_die("unable to write super-block");
if (IMAPS * BLOCK_SIZE != write(DEV, inode_map, IMAPS * BLOCK_SIZE))
- error_msg_and_die("unable to write inode map\n");
+ error_msg_and_die("unable to write inode map");
if (ZMAPS * BLOCK_SIZE != write(DEV, zone_map, ZMAPS * BLOCK_SIZE))
- error_msg_and_die("unable to write zone map\n");
+ error_msg_and_die("unable to write zone map");
if (INODE_BUFFER_SIZE != write(DEV, inode_buffer, INODE_BUFFER_SIZE))
- error_msg_and_die("unable to write inodes\n");
+ error_msg_and_die("unable to write inodes");
}
static void write_block(int blk, char *buffer)
{
if (blk * BLOCK_SIZE != lseek(DEV, blk * BLOCK_SIZE, SEEK_SET))
- error_msg_and_die("seek failed in write_block\n");
+ error_msg_and_die("seek failed in write_block");
if (BLOCK_SIZE != write(DEV, buffer, BLOCK_SIZE))
- error_msg_and_die("write failed in write_block\n");
+ error_msg_and_die("write failed in write_block");
}
static int get_free_block(void)
@@ -365,7 +365,7 @@ static int get_free_block(void)
int blk;
if (used_good_blocks + 1 >= MAX_GOOD_BLOCKS)
- error_msg_and_die("too many bad blocks\n");
+ error_msg_and_die("too many bad blocks");
if (used_good_blocks)
blk = good_blocks_table[used_good_blocks - 1] + 1;
else
@@ -373,7 +373,7 @@ static int get_free_block(void)
while (blk < ZONES && zone_in_use(blk))
blk++;
if (blk >= ZONES)
- error_msg_and_die("not enough good blocks\n");
+ error_msg_and_die("not enough good blocks");
good_blocks_table[used_good_blocks] = blk;
used_good_blocks++;
return blk;
@@ -439,7 +439,7 @@ static void make_bad_inode(void)
goto end_bad;
}
}
- error_msg_and_die("too many bad blocks\n");
+ error_msg_and_die("too many bad blocks");
end_bad:
if (ind)
write_block(ind, (char *) ind_block);
@@ -489,7 +489,7 @@ static void make_bad_inode2(void)
}
}
/* Could make triple indirect block here */
- error_msg_and_die("too many bad blocks\n");
+ error_msg_and_die("too many bad blocks");
end_bad:
if (ind)
write_block(ind, (char *) ind_block);
@@ -590,7 +590,7 @@ static void setup_tables(void)
* /sbin/mkfs.minix -i 200 test.fs
* */
if (i >= 999) {
- error_msg_and_die("unable to allocate buffers for maps\n");
+ error_msg_and_die("unable to allocate buffers for maps");
}
FIRSTZONE = NORM_FIRSTZONE;
inode_map = xmalloc(IMAPS * BLOCK_SIZE);
@@ -621,7 +621,7 @@ long do_check(char *buffer, int try, unsigned int current_block)
/* Seek to the correct loc. */
if (lseek(DEV, current_block * BLOCK_SIZE, SEEK_SET) !=
current_block * BLOCK_SIZE) {
- error_msg_and_die("seek failed during testing of blocks\n");
+ error_msg_and_die("seek failed during testing of blocks");
}
@@ -661,7 +661,7 @@ static void check_blocks(void)
while (currently_testing < ZONES) {
if (lseek(DEV, currently_testing * BLOCK_SIZE, SEEK_SET) !=
currently_testing * BLOCK_SIZE)
- error_msg_and_die("seek failed in check_blocks\n");
+ error_msg_and_die("seek failed in check_blocks");
try = TEST_BUFFER_BLOCKS;
if (currently_testing + try > ZONES)
try = ZONES - currently_testing;
@@ -670,7 +670,7 @@ static void check_blocks(void)
if (got == try)
continue;
if (currently_testing < FIRSTZONE)
- error_msg_and_die("bad blocks before data-area: cannot make fs\n");
+ error_msg_and_die("bad blocks before data-area: cannot make fs");
mark_zone(currently_testing);
badblocks++;
currently_testing++;
@@ -690,7 +690,7 @@ char *filename;
listfile = fopen(filename, "r");
if (listfile == (FILE *) NULL) {
- error_msg_and_die("can't open file of bad blocks\n");
+ error_msg_and_die("can't open file of bad blocks");
}
while (!feof(listfile)) {
fscanf(listfile, "%ld\n", &blockno);
@@ -712,10 +712,10 @@ extern int mkfs_minix_main(int argc, char **argv)
int stopIt=FALSE;
if (INODE_SIZE * MINIX_INODES_PER_BLOCK != BLOCK_SIZE)
- error_msg_and_die("bad inode size\n");
+ error_msg_and_die("bad inode size");
#ifdef BB_FEATURE_MINIX2
if (INODE_SIZE2 * MINIX2_INODES_PER_BLOCK != BLOCK_SIZE)
- error_msg_and_die("bad inode size\n");
+ error_msg_and_die("bad inode size");
#endif
/* Parse options */
@@ -781,7 +781,7 @@ extern int mkfs_minix_main(int argc, char **argv)
#ifdef BB_FEATURE_MINIX2
version2 = 1;
#else
- error_msg("%s: not compiled with minix v2 support\n",
+ error_msg("%s: not compiled with minix v2 support",
device_name);
exit(-1);
#endif
@@ -832,13 +832,13 @@ goodbye:
strcpy(tmp + 2, ".badblocks");
DEV = open(device_name, O_RDWR);
if (DEV < 0)
- error_msg_and_die("unable to open %s\n", device_name);
+ error_msg_and_die("unable to open %s", device_name);
if (fstat(DEV, &statbuf) < 0)
- error_msg_and_die("unable to stat %s\n", device_name);
+ error_msg_and_die("unable to stat %s", device_name);
if (!S_ISBLK(statbuf.st_mode))
check = 0;
else if (statbuf.st_rdev == 0x0300 || statbuf.st_rdev == 0x0340)
- error_msg_and_die("will not try to make filesystem on '%s'\n", device_name);
+ error_msg_and_die("will not try to make filesystem on '%s'", device_name);
setup_tables();
if (check)
check_blocks();
diff --git a/util-linux/mkswap.c b/util-linux/mkswap.c
index 8a3c900..7d690ad 100644
--- a/util-linux/mkswap.c
+++ b/util-linux/mkswap.c
@@ -87,7 +87,7 @@ static void init_signature_page()
#ifdef PAGE_SIZE
if (pagesize != PAGE_SIZE)
- error_msg("Assuming pages of size %d\n", pagesize);
+ error_msg("Assuming pages of size %d", pagesize);
#endif
signature_page = (int *) xmalloc(pagesize);
memset(signature_page, 0, pagesize);
@@ -185,7 +185,7 @@ static void page_bad(int page)
bit_test_and_clear(signature_page, page);
else {
if (badpages == MAX_BADPAGES)
- error_msg_and_die("too many bad pages\n");
+ error_msg_and_die("too many bad pages");
p->badpages[badpages] = page;
}
badpages++;
@@ -206,7 +206,7 @@ static void check_blocks(void)
}
if (do_seek && lseek(DEV, current_page * pagesize, SEEK_SET) !=
current_page * pagesize)
- error_msg_and_die("seek failed in check_blocks\n");
+ error_msg_and_die("seek failed in check_blocks");
if ((do_seek = (pagesize != read(DEV, buffer, pagesize)))) {
page_bad(current_page++);
continue;
@@ -307,14 +307,14 @@ int mkswap_main(int argc, char **argv)
}
}
if (!device_name) {
- error_msg("error: Nowhere to set up swap on?\n");
+ error_msg("error: Nowhere to set up swap on?");
usage(mkswap_usage);
}
sz = get_size(device_name);
if (!PAGES) {
PAGES = sz;
} else if (PAGES > sz && !force) {
- error_msg("error: size %ld is larger than device size %d\n",
+ error_msg("error: size %ld is larger than device size %d",
PAGES * (pagesize / 1024), sz * (pagesize / 1024));
return EXIT_FAILURE;
}
@@ -330,11 +330,11 @@ int mkswap_main(int argc, char **argv)
version = 1;
}
if (version != 0 && version != 1) {
- error_msg("error: unknown version %d\n", version);
+ error_msg("error: unknown version %d", version);
usage(mkswap_usage);
}
if (PAGES < 10) {
- error_msg("error: swap area needs to be at least %ldkB\n",
+ error_msg("error: swap area needs to be at least %ldkB",
(long) (10 * pagesize / 1024));
usage(mkswap_usage);
}
@@ -353,7 +353,7 @@ int mkswap_main(int argc, char **argv)
#endif
if (PAGES > maxpages) {
PAGES = maxpages;
- error_msg("warning: truncating swap area to %ldkB\n",
+ error_msg("warning: truncating swap area to %ldkB",
PAGES * pagesize / 1024);
}
@@ -363,7 +363,7 @@ int mkswap_main(int argc, char **argv)
if (!S_ISBLK(statbuf.st_mode))
check = 0;
else if (statbuf.st_rdev == 0x0300 || statbuf.st_rdev == 0x0340)
- error_msg_and_die("Will not try to make swapdevice on '%s'\n", device_name);
+ error_msg_and_die("Will not try to make swapdevice on '%s'", device_name);
#ifdef __sparc__
if (!force && version == 0) {
@@ -372,7 +372,7 @@ int mkswap_main(int argc, char **argv)
unsigned short *q, sum;
if (read(DEV, buffer, 512) != 512)
- error_msg_and_die("fatal: first page unreadable\n");
+ error_msg_and_die("fatal: first page unreadable");
if (buffer[508] == 0xDA && buffer[509] == 0xBE) {
q = (unsigned short *) (buffer + 510);
for (sum = 0; q >= (unsigned short *) buffer;)
@@ -381,7 +381,7 @@ int mkswap_main(int argc, char **argv)
error_msg("Device '%s' contains a valid Sun disklabel.\n"
"This probably means creating v0 swap would destroy your partition table\n"
"No swap created. If you really want to create swap v0 on that device, use\n"
-"the -f option to force it.\n", device_name);
+"the -f option to force it.", device_name);
return EXIT_FAILURE;
}
}
@@ -391,7 +391,7 @@ int mkswap_main(int argc, char **argv)
if (version == 0 || check)
check_blocks();
if (version == 0 && !bit_test_and_clear(signature_page, 0))
- error_msg_and_die("fatal: first page unreadable\n");
+ error_msg_and_die("fatal: first page unreadable");
if (version == 1) {
p->version = version;
p->last_page = PAGES - 1;
@@ -400,23 +400,23 @@ int mkswap_main(int argc, char **argv)
goodpages = PAGES - badpages - 1;
if (goodpages <= 0)
- error_msg_and_die("Unable to set up swap-space: unreadable\n");
+ error_msg_and_die("Unable to set up swap-space: unreadable");
printf("Setting up swapspace version %d, size = %ld bytes\n",
version, (long) (goodpages * pagesize));
write_signature((version == 0) ? "SWAP-SPACE" : "SWAPSPACE2");
offset = ((version == 0) ? 0 : 1024);
if (lseek(DEV, offset, SEEK_SET) != offset)
- error_msg_and_die("unable to rewind swap-device\n");
+ error_msg_and_die("unable to rewind swap-device");
if (write(DEV, (char *) signature_page + offset, pagesize - offset)
!= pagesize - offset)
- error_msg_and_die("unable to write signature page\n");
+ error_msg_and_die("unable to write signature page");
/*
* A subsequent swapon() will fail if the signature
* is not actually on disk. (This is a kernel bug.)
*/
if (fsync(DEV))
- error_msg_and_die("fsync failed\n");
+ error_msg_and_die("fsync failed");
return EXIT_SUCCESS;
}
diff --git a/util-linux/mount.c b/util-linux/mount.c
index f78786e..b571e50 100644
--- a/util-linux/mount.c
+++ b/util-linux/mount.c
@@ -132,20 +132,20 @@ do_mount(char *specialfile, char *dir, char *filesystemtype,
specialfile = find_unused_loop_device();
if (specialfile == NULL) {
- error_msg_and_die("Could not find a spare loop device\n");
+ error_msg_and_die("Could not find a spare loop device");
}
if (set_loop(specialfile, lofile, 0, &loro)) {
- error_msg_and_die("Could not setup loop device\n");
+ error_msg_and_die("Could not setup loop device");
}
if (!(flags & MS_RDONLY) && loro) { /* loop is ro, but wanted rw */
- error_msg("WARNING: loop device is read-only\n");
+ error_msg("WARNING: loop device is read-only");
flags &= ~MS_RDONLY;
}
}
#endif
status = mount(specialfile, dir, filesystemtype, flags, string_flags);
if (errno == EROFS) {
- error_msg("%s is write-protected, mounting read-only\n", specialfile);
+ error_msg("%s is write-protected, mounting read-only", specialfile);
status = mount(specialfile, dir, filesystemtype, flags |= MS_RDONLY, string_flags);
}
}
@@ -171,7 +171,7 @@ do_mount(char *specialfile, char *dir, char *filesystemtype,
#endif
if (errno == EPERM) {
- error_msg_and_die("permission denied. Are you root?\n");
+ error_msg_and_die("permission denied. Are you root?");
}
return (FALSE);
diff --git a/util-linux/nfsmount.c b/util-linux/nfsmount.c
index b260a88..397858b 100644
--- a/util-linux/nfsmount.c
+++ b/util-linux/nfsmount.c
@@ -307,7 +307,7 @@ int nfsmount(const char *spec, const char *node, int *flags,
msock = fsock = -1;
mclient = NULL;
if (strlen(spec) >= sizeof(hostdir)) {
- error_msg("excessively long host:dir argument\n");
+ error_msg("excessively long host:dir argument");
goto fail;
}
strcpy(hostdir, spec);
@@ -319,10 +319,10 @@ int nfsmount(const char *spec, const char *node, int *flags,
until they can be fully supported. (mack@sgi.com) */
if ((s = strchr(hostdir, ','))) {
*s = '\0';
- error_msg("warning: multiple hostnames not supported\n");
+ error_msg("warning: multiple hostnames not supported");
}
} else {
- error_msg("directory to mount not in host:dir format\n");
+ error_msg("directory to mount not in host:dir format");
goto fail;
}
@@ -332,11 +332,11 @@ int nfsmount(const char *spec, const char *node, int *flags,
#endif
{
if ((hp = gethostbyname(hostname)) == NULL) {
- error_msg("can't get address for %s\n", hostname);
+ error_msg("can't get address for %s", hostname);
goto fail;
} else {
if (hp->h_length > sizeof(struct in_addr)) {
- error_msg("got bad hp->h_length\n");
+ error_msg("got bad hp->h_length");
hp->h_length = sizeof(struct in_addr);
}
memcpy(&server_addr.sin_addr,
@@ -353,7 +353,7 @@ int nfsmount(const char *spec, const char *node, int *flags,
if (!old_opts)
old_opts = "";
if (strlen(old_opts) + strlen(s) + 10 >= sizeof(new_opts)) {
- error_msg("excessively long option argument\n");
+ error_msg("excessively long option argument");
goto fail;
}
sprintf(new_opts, "%s%saddr=%s",
@@ -513,11 +513,11 @@ int nfsmount(const char *spec, const char *node, int *flags,
data.flags |= (nolock ? NFS_MOUNT_NONLM : 0);
#endif
if (nfsvers > MAX_NFSPROT) {
- error_msg("NFSv%d not supported!\n", nfsvers);
+ error_msg("NFSv%d not supported!", nfsvers);
return 0;
}
if (mountvers > MAX_NFSPROT) {
- error_msg("NFSv%d not supported!\n", nfsvers);
+ error_msg("NFSv%d not supported!", nfsvers);
return 0;
}
if (nfsvers && !mountvers)
@@ -577,11 +577,11 @@ int nfsmount(const char *spec, const char *node, int *flags,
mount_server_addr.sin_addr.s_addr = inet_addr(hostname);
} else {
if ((hp = gethostbyname(mounthost)) == NULL) {
- error_msg("can't get address for %s\n", hostname);
+ error_msg("can't get address for %s", hostname);
goto fail;
} else {
if (hp->h_length > sizeof(struct in_addr)) {
- error_msg("got bad hp->h_length?\n");
+ error_msg("got bad hp->h_length?");
hp->h_length = sizeof(struct in_addr);
}
mount_server_addr.sin_family = AF_INET;
@@ -716,7 +716,7 @@ int nfsmount(const char *spec, const char *node, int *flags,
if (nfsvers == 2) {
if (status.nfsv2.fhs_status != 0) {
- error_msg("%s:%s failed, reason given by server: %s\n",
+ error_msg("%s:%s failed, reason given by server: %s",
hostname, dirname,
nfs_strerror(status.nfsv2.fhs_status));
goto fail;
@@ -734,7 +734,7 @@ int nfsmount(const char *spec, const char *node, int *flags,
#if NFS_MOUNT_VERSION >= 4
fhandle3 *fhandle;
if (status.nfsv3.fhs_status != 0) {
- error_msg("%s:%s failed, reason given by server: %s\n",
+ error_msg("%s:%s failed, reason given by server: %s",
hostname, dirname,
nfs_strerror(status.nfsv3.fhs_status));
goto fail;
diff --git a/util-linux/rdate.c b/util-linux/rdate.c
index 0ad339b..d350be8 100644
--- a/util-linux/rdate.c
+++ b/util-linux/rdate.c
@@ -72,7 +72,7 @@ time_t askremotedate(char *host)
}
if (read(fd, (void *)&nett, 4) != 4) { /* read time from server */
close(fd);
- error_msg("%s did not send the complete time\n", host);
+ error_msg("%s did not send the complete time", host);
}
close(fd);
diff --git a/util-linux/swaponoff.c b/util-linux/swaponoff.c
index 8a9134c..74f6ec3 100644
--- a/util-linux/swaponoff.c
+++ b/util-linux/swaponoff.c
@@ -95,7 +95,7 @@ extern int swap_on_off_main(int argc, char **argv)
struct stat statBuf;
if (stat("/etc/fstab", &statBuf) < 0)
- error_msg_and_die("/etc/fstab file missing\n");
+ error_msg_and_die("/etc/fstab file missing");
}
do_em_all();
break;
diff --git a/util-linux/umount.c b/util-linux/umount.c
index 3772d55..39842d2 100644
--- a/util-linux/umount.c
+++ b/util-linux/umount.c
@@ -81,7 +81,7 @@ void mtab_read(void)
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))) {
@@ -181,7 +181,7 @@ static int do_umount(const char *name, int useMtab)
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
@@ -189,9 +189,9 @@ static int do_umount(const char *name, int useMtab)
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) {