aboutsummaryrefslogtreecommitdiff
path: root/util-linux
diff options
context:
space:
mode:
authorMark Whitley <markw@lineo.com>2000-12-07 19:56:48 +0000
committerMark Whitley <markw@lineo.com>2000-12-07 19:56:48 +0000
commitf57c944e09417edcbcd69f2b01b937cadef39db2 (patch)
treea55822621d54bd82c54e272fa986e45698fea0f1 /util-linux
parent7b5c16ebe5f1b057603cf1c0b0187be418725c42 (diff)
downloadbusybox-f57c944e09417edcbcd69f2b01b937cadef39db2.tar.gz
Changed names of functions in utility.c and all affected files, to make
compliant with the style guide. Everybody rebuild your tags file!
Diffstat (limited to 'util-linux')
-rw-r--r--util-linux/fbset.c4
-rw-r--r--util-linux/freeramdisk.c4
-rw-r--r--util-linux/fsck_minix.c2
-rw-r--r--util-linux/getopt.c10
-rw-r--r--util-linux/mkfs_minix.c4
-rw-r--r--util-linux/mkswap.c16
-rw-r--r--util-linux/mount.c28
-rw-r--r--util-linux/nfsmount.c24
-rw-r--r--util-linux/rdate.c12
-rw-r--r--util-linux/swaponoff.c2
-rw-r--r--util-linux/umount.c8
11 files changed, 57 insertions, 57 deletions
diff --git a/util-linux/fbset.c b/util-linux/fbset.c
index 47130e355..86f7733c9 100644
--- a/util-linux/fbset.c
+++ b/util-linux/fbset.c
@@ -283,7 +283,7 @@ static int readmode(struct fb_var_screeninfo *base, const char *fn,
}
}
#else
- errorMsg( "mode reading not compiled in\n");
+ error_msg( "mode reading not compiled in\n");
#endif
return 0;
}
@@ -433,7 +433,7 @@ extern int fbset_main(int argc, char **argv)
PERROR("fbset(ioctl)");
if (g_options & OPT_READMODE) {
if (!readmode(&var, modefile, mode)) {
- errorMsg("Unknown video mode `%s'\n", mode);
+ error_msg("Unknown video mode `%s'\n", mode);
return EXIT_FAILURE;
}
}
diff --git a/util-linux/freeramdisk.c b/util-linux/freeramdisk.c
index 567151455..a568cc67c 100644
--- a/util-linux/freeramdisk.c
+++ b/util-linux/freeramdisk.c
@@ -43,10 +43,10 @@ freeramdisk_main(int argc, char **argv)
}
if ((f = open(argv[1], O_RDWR)) == -1) {
- fatalError( "cannot open %s: %s\n", argv[1], strerror(errno));
+ error_msg_and_die( "cannot open %s: %s\n", argv[1], strerror(errno));
}
if (ioctl(f, BLKFLSBUF) < 0) {
- fatalError( "failed ioctl on %s: %s\n", argv[1], strerror(errno));
+ error_msg_and_die( "failed ioctl on %s: %s\n", argv[1], strerror(errno));
}
/* Don't bother closing. Exit does
* that, so we can save a few bytes */
diff --git a/util-linux/fsck_minix.c b/util-linux/fsck_minix.c
index ef65e3073..9ebabe9e5 100644
--- a/util-linux/fsck_minix.c
+++ b/util-linux/fsck_minix.c
@@ -296,7 +296,7 @@ static void show_usage(void)
static void die(const char *str)
{
- errorMsg("%s\n", str);
+ error_msg("%s\n", str);
leave(8);
}
diff --git a/util-linux/getopt.c b/util-linux/getopt.c
index 8c94bb4c1..0ebf9df08 100644
--- a/util-linux/getopt.c
+++ b/util-linux/getopt.c
@@ -37,7 +37,7 @@
* <misiek@misiek.eu.org>)
* Ported to Busybox - Alfred M. Szmidt <ams@trillian.itslinux.org>
* Removed --version/-V and --help/-h in
- * Removed prase_error(), using errorMsg() from Busybox instead
+ * Removed prase_error(), using error_msg() from Busybox instead
* Replaced our_malloc with xmalloc and our_realloc with xrealloc
*
*/
@@ -258,7 +258,7 @@ void add_long_options(char *options)
arg_opt=required_argument;
}
if (strlen(tokptr) == 0)
- errorMsg("empty long option after -l or --long argument\n");
+ error_msg("empty long option after -l or --long argument\n");
}
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
- errorMsg("unknown shell after -s or --shell argument\n");
+ error_msg("unknown shell after -s or --shell argument\n");
}
@@ -326,7 +326,7 @@ int getopt_main(int argc, char *argv[])
printf(" --\n");
exit(0);
} else
- fatalError("missing optstring argument\n");
+ error_msg_and_die("missing optstring argument\n");
}
if (argv[1][0] != '-' || compatible) {
@@ -377,7 +377,7 @@ int getopt_main(int argc, char *argv[])
if (!optstr) {
if (optind >= argc)
- fatalError("missing optstring argument\n");
+ error_msg_and_die("missing optstring argument\n");
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 15cf531f0..95815fd4d 100644
--- a/util-linux/mkfs_minix.c
+++ b/util-linux/mkfs_minix.c
@@ -262,7 +262,7 @@ static inline int bit(char * a,unsigned int i)
*/
static volatile void die(char *str)
{
- errorMsg("%s\n", str);
+ error_msg("%s\n", str);
exit(8);
}
@@ -796,7 +796,7 @@ extern int mkfs_minix_main(int argc, char **argv)
#ifdef BB_FEATURE_MINIX2
version2 = 1;
#else
- errorMsg("%s: not compiled with minix v2 support\n",
+ error_msg("%s: not compiled with minix v2 support\n",
device_name);
exit(-1);
#endif
diff --git a/util-linux/mkswap.c b/util-linux/mkswap.c
index 4757e15f8..3a396894c 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)
- errorMsg("Assuming pages of size %d\n", pagesize);
+ error_msg("Assuming pages of size %d\n", pagesize);
#endif
signature_page = (int *) xmalloc(pagesize);
memset(signature_page, 0, pagesize);
@@ -175,7 +175,7 @@ static int bit_test_and_clear(unsigned int *addr, unsigned int nr)
void die(const char *str)
{
- errorMsg("%s\n", str);
+ error_msg("%s\n", str);
exit(EXIT_FAILURE);
}
@@ -316,14 +316,14 @@ int mkswap_main(int argc, char **argv)
}
}
if (!device_name) {
- errorMsg("error: Nowhere to set up swap on?\n");
+ error_msg("error: Nowhere to set up swap on?\n");
usage(mkswap_usage);
}
sz = get_size(device_name);
if (!PAGES) {
PAGES = sz;
} else if (PAGES > sz && !force) {
- errorMsg("error: size %ld is larger than device size %d\n",
+ error_msg("error: size %ld is larger than device size %d\n",
PAGES * (pagesize / 1024), sz * (pagesize / 1024));
return EXIT_FAILURE;
}
@@ -339,11 +339,11 @@ int mkswap_main(int argc, char **argv)
version = 1;
}
if (version != 0 && version != 1) {
- errorMsg("error: unknown version %d\n", version);
+ error_msg("error: unknown version %d\n", version);
usage(mkswap_usage);
}
if (PAGES < 10) {
- errorMsg("error: swap area needs to be at least %ldkB\n",
+ error_msg("error: swap area needs to be at least %ldkB\n",
(long) (10 * pagesize / 1024));
usage(mkswap_usage);
}
@@ -362,7 +362,7 @@ int mkswap_main(int argc, char **argv)
#endif
if (PAGES > maxpages) {
PAGES = maxpages;
- errorMsg("warning: truncating swap area to %ldkB\n",
+ error_msg("warning: truncating swap area to %ldkB\n",
PAGES * pagesize / 1024);
}
@@ -389,7 +389,7 @@ int mkswap_main(int argc, char **argv)
for (sum = 0; q >= (unsigned short *) buffer;)
sum ^= *q--;
if (!sum) {
- errorMsg("Device '%s' contains a valid Sun disklabel.\n"
+ 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);
diff --git a/util-linux/mount.c b/util-linux/mount.c
index ff8aef379..fa998122b 100644
--- a/util-linux/mount.c
+++ b/util-linux/mount.c
@@ -132,22 +132,22 @@ do_mount(char *specialfile, char *dir, char *filesystemtype,
specialfile = find_unused_loop_device();
if (specialfile == NULL) {
- errorMsg("Could not find a spare loop device\n");
+ error_msg("Could not find a spare loop device\n");
return (FALSE);
}
if (set_loop(specialfile, lofile, 0, &loro)) {
- errorMsg("Could not setup loop device\n");
+ error_msg("Could not setup loop device\n");
return (FALSE);
}
if (!(flags & MS_RDONLY) && loro) { /* loop is ro, but wanted rw */
- errorMsg("WARNING: loop device is read-only\n");
+ error_msg("WARNING: loop device is read-only\n");
flags &= ~MS_RDONLY;
}
}
#endif
status = mount(specialfile, dir, filesystemtype, flags, string_flags);
if (errno == EROFS) {
- errorMsg("%s is write-protected, mounting read-only\n", specialfile);
+ error_msg("%s is write-protected, mounting read-only\n", specialfile);
status = mount(specialfile, dir, filesystemtype, flags |= MS_RDONLY, string_flags);
}
}
@@ -173,7 +173,7 @@ do_mount(char *specialfile, char *dir, char *filesystemtype,
#endif
if (errno == EPERM) {
- fatalError("permission denied. Are you root?\n");
+ error_msg_and_die("permission denied. Are you root?\n");
}
return (FALSE);
@@ -273,18 +273,18 @@ mount_one(char *blockDevice, char *directory, char *filesystemType,
/* open device */
fd = open(device, O_RDONLY);
if (fd < 0)
- fatalError("open failed for `%s': %s\n", device, strerror (errno));
+ error_msg_and_die("open failed for `%s': %s\n", device, strerror (errno));
/* How many filesystems? We need to know to allocate enough space */
numfilesystems = ioctl (fd, DEVMTAB_COUNT_FILESYSTEMS);
if (numfilesystems<0)
- fatalError("\nDEVMTAB_COUNT_FILESYSTEMS: %s\n", strerror (errno));
+ error_msg_and_die("\nDEVMTAB_COUNT_FILESYSTEMS: %s\n", strerror (errno));
fslist = (struct k_fstype *) xcalloc ( numfilesystems, sizeof(struct k_fstype));
/* Grab the list of available filesystems */
status = ioctl (fd, DEVMTAB_GET_FILESYSTEMS, fslist);
if (status<0)
- fatalError("\nDEVMTAB_GET_FILESYSTEMS: %s\n", strerror (errno));
+ error_msg_and_die("\nDEVMTAB_GET_FILESYSTEMS: %s\n", strerror (errno));
/* Walk the list trying to mount filesystems
* that do not claim to be nodev filesystems */
@@ -309,7 +309,7 @@ mount_one(char *blockDevice, char *directory, char *filesystemType,
if (status == FALSE) {
if (whineOnErrors == TRUE) {
- errorMsg("Mounting %s on %s failed: %s\n",
+ error_msg("Mounting %s on %s failed: %s\n",
blockDevice, directory, strerror(errno));
}
return (FALSE);
@@ -342,18 +342,18 @@ extern int mount_main(int argc, char **argv)
/* open device */
fd = open(device, O_RDONLY);
if (fd < 0)
- fatalError("open failed for `%s': %s\n", device, strerror (errno));
+ error_msg_and_die("open failed for `%s': %s\n", device, strerror (errno));
/* How many mounted filesystems? We need to know to
* allocate enough space for later... */
numfilesystems = ioctl (fd, DEVMTAB_COUNT_MOUNTS);
if (numfilesystems<0)
- fatalError( "\nDEVMTAB_COUNT_MOUNTS: %s\n", strerror (errno));
+ error_msg_and_die( "\nDEVMTAB_COUNT_MOUNTS: %s\n", strerror (errno));
mntentlist = (struct k_mntent *) xcalloc ( numfilesystems, sizeof(struct k_mntent));
/* Grab the list of mounted filesystems */
if (ioctl (fd, DEVMTAB_GET_MOUNTS, mntentlist)<0)
- fatalError( "\nDEVMTAB_GET_MOUNTS: %s\n", strerror (errno));
+ error_msg_and_die( "\nDEVMTAB_GET_MOUNTS: %s\n", strerror (errno));
for( i = 0 ; i < numfilesystems ; i++) {
fprintf( stdout, "%s %s %s %s %d %d\n", mntentlist[i].mnt_fsname,
@@ -455,7 +455,7 @@ extern int mount_main(int argc, char **argv)
fstabmount = TRUE;
if (f == NULL)
- fatalError( "\nCannot read /etc/fstab: %s\n", strerror (errno));
+ error_msg_and_die( "\nCannot read /etc/fstab: %s\n", strerror (errno));
while ((m = getmntent(f)) != NULL) {
if (all == FALSE && directory == NULL && (
@@ -488,7 +488,7 @@ singlemount:
rc = nfsmount (device, directory, &flags,
&extra_opts, &string_flags, 1);
if ( rc != 0) {
- fatalError("nfsmount failed: %s\n", strerror(errno));
+ error_msg_and_die("nfsmount failed: %s\n", strerror(errno));
rc = EXIT_FAILURE;
}
}
diff --git a/util-linux/nfsmount.c b/util-linux/nfsmount.c
index f8735e52c..a8c0b0ea6 100644
--- a/util-linux/nfsmount.c
+++ b/util-linux/nfsmount.c
@@ -300,7 +300,7 @@ int nfsmount(const char *spec, const char *node, int *flags,
msock = fsock = -1;
mclient = NULL;
if (strlen(spec) >= sizeof(hostdir)) {
- errorMsg("excessively long host:dir argument\n");
+ error_msg("excessively long host:dir argument\n");
goto fail;
}
strcpy(hostdir, spec);
@@ -312,10 +312,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';
- errorMsg("warning: multiple hostnames not supported\n");
+ error_msg("warning: multiple hostnames not supported\n");
}
} else {
- errorMsg("directory to mount not in host:dir format\n");
+ error_msg("directory to mount not in host:dir format\n");
goto fail;
}
@@ -325,11 +325,11 @@ int nfsmount(const char *spec, const char *node, int *flags,
#endif
{
if ((hp = gethostbyname(hostname)) == NULL) {
- errorMsg("can't get address for %s\n", hostname);
+ error_msg("can't get address for %s\n", hostname);
goto fail;
} else {
if (hp->h_length > sizeof(struct in_addr)) {
- errorMsg("got bad hp->h_length\n");
+ error_msg("got bad hp->h_length\n");
hp->h_length = sizeof(struct in_addr);
}
memcpy(&server_addr.sin_addr,
@@ -346,7 +346,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)) {
- errorMsg("excessively long option argument\n");
+ error_msg("excessively long option argument\n");
goto fail;
}
sprintf(new_opts, "%s%saddr=%s",
@@ -506,11 +506,11 @@ int nfsmount(const char *spec, const char *node, int *flags,
data.flags |= (nolock ? NFS_MOUNT_NONLM : 0);
#endif
if (nfsvers > MAX_NFSPROT) {
- errorMsg("NFSv%d not supported!\n", nfsvers);
+ error_msg("NFSv%d not supported!\n", nfsvers);
return 0;
}
if (mountvers > MAX_NFSPROT) {
- errorMsg("NFSv%d not supported!\n", nfsvers);
+ error_msg("NFSv%d not supported!\n", nfsvers);
return 0;
}
if (nfsvers && !mountvers)
@@ -570,11 +570,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) {
- errorMsg("can't get address for %s\n", hostname);
+ error_msg("can't get address for %s\n", hostname);
goto fail;
} else {
if (hp->h_length > sizeof(struct in_addr)) {
- errorMsg("got bad hp->h_length?\n");
+ error_msg("got bad hp->h_length?\n");
hp->h_length = sizeof(struct in_addr);
}
mount_server_addr.sin_family = AF_INET;
@@ -709,7 +709,7 @@ int nfsmount(const char *spec, const char *node, int *flags,
if (nfsvers == 2) {
if (status.nfsv2.fhs_status != 0) {
- errorMsg("%s:%s failed, reason given by server: %s\n",
+ error_msg("%s:%s failed, reason given by server: %s\n",
hostname, dirname,
nfs_strerror(status.nfsv2.fhs_status));
goto fail;
@@ -727,7 +727,7 @@ int nfsmount(const char *spec, const char *node, int *flags,
#if NFS_MOUNT_VERSION >= 4
fhandle3 *fhandle;
if (status.nfsv3.fhs_status != 0) {
- errorMsg("%s:%s failed, reason given by server: %s\n",
+ error_msg("%s:%s failed, reason given by server: %s\n",
hostname, dirname,
nfs_strerror(status.nfsv3.fhs_status));
goto fail;
diff --git a/util-linux/rdate.c b/util-linux/rdate.c
index 7c8d54117..87edecbfc 100644
--- a/util-linux/rdate.c
+++ b/util-linux/rdate.c
@@ -47,15 +47,15 @@ time_t askremotedate(char *host)
int fd;
if (!(h = gethostbyname(host))) { /* get the IP addr */
- errorMsg("%s: %s\n", host, strerror(errno));
+ error_msg("%s: %s\n", host, strerror(errno));
return(-1);
}
if ((tserv = getservbyname("time", "tcp")) == NULL) { /* find port # */
- errorMsg("%s: %s\n", "time", strerror(errno));
+ error_msg("%s: %s\n", "time", strerror(errno));
return(-1);
}
if ((fd = socket(AF_INET, SOCK_STREAM, 0)) < 0) { /* get net connection */
- errorMsg("%s: %s\n", "socket", strerror(errno));
+ error_msg("%s: %s\n", "socket", strerror(errno));
return(-1);
}
@@ -64,13 +64,13 @@ time_t askremotedate(char *host)
sin.sin_family = AF_INET;
if (connect(fd, (struct sockaddr *)&sin, sizeof(sin)) < 0) { /* connect to time server */
- errorMsg("%s: %s\n", host, strerror(errno));
+ error_msg("%s: %s\n", host, strerror(errno));
close(fd);
return(-1);
}
if (read(fd, (void *)&nett, 4) != 4) { /* read time from server */
close(fd);
- errorMsg("%s did not send the complete time\n", host);
+ error_msg("%s did not send the complete time\n", host);
}
close(fd);
@@ -123,7 +123,7 @@ int rdate_main(int argc, char **argv)
}
if (setdate) {
if (stime(&time) < 0)
- fatalError("Could not set time of day: %s\n", strerror(errno));
+ error_msg_and_die("Could not set time of day: %s\n", strerror(errno));
}
if (printdate) {
fprintf(stdout, "%s", ctime(&time));
diff --git a/util-linux/swaponoff.c b/util-linux/swaponoff.c
index 0ae0c36ee..e40d169dd 100644
--- a/util-linux/swaponoff.c
+++ b/util-linux/swaponoff.c
@@ -96,7 +96,7 @@ extern int swap_on_off_main(int argc, char **argv)
struct stat statBuf;
if (stat("/etc/fstab", &statBuf) < 0)
- fatalError("/etc/fstab file missing\n");
+ error_msg_and_die("/etc/fstab file missing\n");
}
do_em_all();
break;
diff --git a/util-linux/umount.c b/util-linux/umount.c
index eff080463..e76e0521f 100644
--- a/util-linux/umount.c
+++ b/util-linux/umount.c
@@ -79,7 +79,7 @@ void mtab_read(void)
return;
if ((fp = setmntent(mtab_file, "r")) == NULL) {
- errorMsg("Cannot open %s\n", mtab_file);
+ error_msg("Cannot open %s\n", mtab_file);
return;
}
while ((e = getmntent(fp))) {
@@ -179,7 +179,7 @@ static int do_umount(const char *name, int useMtab)
if (status != 0 && doForce == TRUE) {
status = umount2(blockDevice, MNT_FORCE);
if (status != 0) {
- fatalError("forced umount of %s failed!\n", blockDevice);
+ error_msg_and_die("forced umount of %s failed!\n", blockDevice);
}
}
#endif
@@ -187,9 +187,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) {
- errorMsg("%s busy - remounted read-only\n", blockDevice);
+ error_msg("%s busy - remounted read-only\n", blockDevice);
} else {
- errorMsg("Cannot remount %s read-only\n", blockDevice);
+ error_msg("Cannot remount %s read-only\n", blockDevice);
}
}
if (status == 0) {