diff options
author | Mark Whitley <markw@lineo.com> | 2000-12-07 19:56:48 +0000 |
---|---|---|
committer | Mark Whitley <markw@lineo.com> | 2000-12-07 19:56:48 +0000 |
commit | f57c944e09417edcbcd69f2b01b937cadef39db2 (patch) | |
tree | a55822621d54bd82c54e272fa986e45698fea0f1 /util-linux | |
parent | 7b5c16ebe5f1b057603cf1c0b0187be418725c42 (diff) | |
download | busybox-w32-f57c944e09417edcbcd69f2b01b937cadef39db2.tar.gz busybox-w32-f57c944e09417edcbcd69f2b01b937cadef39db2.tar.bz2 busybox-w32-f57c944e09417edcbcd69f2b01b937cadef39db2.zip |
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.c | 4 | ||||
-rw-r--r-- | util-linux/freeramdisk.c | 4 | ||||
-rw-r--r-- | util-linux/fsck_minix.c | 2 | ||||
-rw-r--r-- | util-linux/getopt.c | 10 | ||||
-rw-r--r-- | util-linux/mkfs_minix.c | 4 | ||||
-rw-r--r-- | util-linux/mkswap.c | 16 | ||||
-rw-r--r-- | util-linux/mount.c | 28 | ||||
-rw-r--r-- | util-linux/nfsmount.c | 24 | ||||
-rw-r--r-- | util-linux/rdate.c | 12 | ||||
-rw-r--r-- | util-linux/swaponoff.c | 2 | ||||
-rw-r--r-- | util-linux/umount.c | 8 |
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, | |||
283 | } | 283 | } |
284 | } | 284 | } |
285 | #else | 285 | #else |
286 | errorMsg( "mode reading not compiled in\n"); | 286 | error_msg( "mode reading not compiled in\n"); |
287 | #endif | 287 | #endif |
288 | return 0; | 288 | return 0; |
289 | } | 289 | } |
@@ -433,7 +433,7 @@ extern int fbset_main(int argc, char **argv) | |||
433 | PERROR("fbset(ioctl)"); | 433 | PERROR("fbset(ioctl)"); |
434 | if (g_options & OPT_READMODE) { | 434 | if (g_options & OPT_READMODE) { |
435 | if (!readmode(&var, modefile, mode)) { | 435 | if (!readmode(&var, modefile, mode)) { |
436 | errorMsg("Unknown video mode `%s'\n", mode); | 436 | error_msg("Unknown video mode `%s'\n", mode); |
437 | return EXIT_FAILURE; | 437 | return EXIT_FAILURE; |
438 | } | 438 | } |
439 | } | 439 | } |
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) | |||
43 | } | 43 | } |
44 | 44 | ||
45 | if ((f = open(argv[1], O_RDWR)) == -1) { | 45 | if ((f = open(argv[1], O_RDWR)) == -1) { |
46 | fatalError( "cannot open %s: %s\n", argv[1], strerror(errno)); | 46 | error_msg_and_die( "cannot open %s: %s\n", argv[1], strerror(errno)); |
47 | } | 47 | } |
48 | if (ioctl(f, BLKFLSBUF) < 0) { | 48 | if (ioctl(f, BLKFLSBUF) < 0) { |
49 | fatalError( "failed ioctl on %s: %s\n", argv[1], strerror(errno)); | 49 | error_msg_and_die( "failed ioctl on %s: %s\n", argv[1], strerror(errno)); |
50 | } | 50 | } |
51 | /* Don't bother closing. Exit does | 51 | /* Don't bother closing. Exit does |
52 | * that, so we can save a few bytes */ | 52 | * 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) | |||
296 | 296 | ||
297 | static void die(const char *str) | 297 | static void die(const char *str) |
298 | { | 298 | { |
299 | errorMsg("%s\n", str); | 299 | error_msg("%s\n", str); |
300 | leave(8); | 300 | leave(8); |
301 | } | 301 | } |
302 | 302 | ||
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 @@ | |||
37 | * <misiek@misiek.eu.org>) | 37 | * <misiek@misiek.eu.org>) |
38 | * Ported to Busybox - Alfred M. Szmidt <ams@trillian.itslinux.org> | 38 | * Ported to Busybox - Alfred M. Szmidt <ams@trillian.itslinux.org> |
39 | * Removed --version/-V and --help/-h in | 39 | * Removed --version/-V and --help/-h in |
40 | * Removed prase_error(), using errorMsg() from Busybox instead | 40 | * Removed prase_error(), using error_msg() from Busybox instead |
41 | * Replaced our_malloc with xmalloc and our_realloc with xrealloc | 41 | * Replaced our_malloc with xmalloc and our_realloc with xrealloc |
42 | * | 42 | * |
43 | */ | 43 | */ |
@@ -258,7 +258,7 @@ void add_long_options(char *options) | |||
258 | arg_opt=required_argument; | 258 | arg_opt=required_argument; |
259 | } | 259 | } |
260 | if (strlen(tokptr) == 0) | 260 | if (strlen(tokptr) == 0) |
261 | errorMsg("empty long option after -l or --long argument\n"); | 261 | error_msg("empty long option after -l or --long argument\n"); |
262 | } | 262 | } |
263 | add_longopt(tokptr,arg_opt); | 263 | add_longopt(tokptr,arg_opt); |
264 | } | 264 | } |
@@ -277,7 +277,7 @@ void set_shell(const char *new_shell) | |||
277 | else if (!strcmp(new_shell,"csh")) | 277 | else if (!strcmp(new_shell,"csh")) |
278 | shell=TCSH; | 278 | shell=TCSH; |
279 | else | 279 | else |
280 | errorMsg("unknown shell after -s or --shell argument\n"); | 280 | error_msg("unknown shell after -s or --shell argument\n"); |
281 | } | 281 | } |
282 | 282 | ||
283 | 283 | ||
@@ -326,7 +326,7 @@ int getopt_main(int argc, char *argv[]) | |||
326 | printf(" --\n"); | 326 | printf(" --\n"); |
327 | exit(0); | 327 | exit(0); |
328 | } else | 328 | } else |
329 | fatalError("missing optstring argument\n"); | 329 | error_msg_and_die("missing optstring argument\n"); |
330 | } | 330 | } |
331 | 331 | ||
332 | if (argv[1][0] != '-' || compatible) { | 332 | if (argv[1][0] != '-' || compatible) { |
@@ -377,7 +377,7 @@ int getopt_main(int argc, char *argv[]) | |||
377 | 377 | ||
378 | if (!optstr) { | 378 | if (!optstr) { |
379 | if (optind >= argc) | 379 | if (optind >= argc) |
380 | fatalError("missing optstring argument\n"); | 380 | error_msg_and_die("missing optstring argument\n"); |
381 | else { | 381 | else { |
382 | optstr=xmalloc(strlen(argv[optind])+1); | 382 | optstr=xmalloc(strlen(argv[optind])+1); |
383 | strcpy(optstr,argv[optind]); | 383 | 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) | |||
262 | */ | 262 | */ |
263 | static volatile void die(char *str) | 263 | static volatile void die(char *str) |
264 | { | 264 | { |
265 | errorMsg("%s\n", str); | 265 | error_msg("%s\n", str); |
266 | exit(8); | 266 | exit(8); |
267 | } | 267 | } |
268 | 268 | ||
@@ -796,7 +796,7 @@ extern int mkfs_minix_main(int argc, char **argv) | |||
796 | #ifdef BB_FEATURE_MINIX2 | 796 | #ifdef BB_FEATURE_MINIX2 |
797 | version2 = 1; | 797 | version2 = 1; |
798 | #else | 798 | #else |
799 | errorMsg("%s: not compiled with minix v2 support\n", | 799 | error_msg("%s: not compiled with minix v2 support\n", |
800 | device_name); | 800 | device_name); |
801 | exit(-1); | 801 | exit(-1); |
802 | #endif | 802 | #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() | |||
87 | 87 | ||
88 | #ifdef PAGE_SIZE | 88 | #ifdef PAGE_SIZE |
89 | if (pagesize != PAGE_SIZE) | 89 | if (pagesize != PAGE_SIZE) |
90 | errorMsg("Assuming pages of size %d\n", pagesize); | 90 | error_msg("Assuming pages of size %d\n", pagesize); |
91 | #endif | 91 | #endif |
92 | signature_page = (int *) xmalloc(pagesize); | 92 | signature_page = (int *) xmalloc(pagesize); |
93 | memset(signature_page, 0, pagesize); | 93 | memset(signature_page, 0, pagesize); |
@@ -175,7 +175,7 @@ static int bit_test_and_clear(unsigned int *addr, unsigned int nr) | |||
175 | 175 | ||
176 | void die(const char *str) | 176 | void die(const char *str) |
177 | { | 177 | { |
178 | errorMsg("%s\n", str); | 178 | error_msg("%s\n", str); |
179 | exit(EXIT_FAILURE); | 179 | exit(EXIT_FAILURE); |
180 | } | 180 | } |
181 | 181 | ||
@@ -316,14 +316,14 @@ int mkswap_main(int argc, char **argv) | |||
316 | } | 316 | } |
317 | } | 317 | } |
318 | if (!device_name) { | 318 | if (!device_name) { |
319 | errorMsg("error: Nowhere to set up swap on?\n"); | 319 | error_msg("error: Nowhere to set up swap on?\n"); |
320 | usage(mkswap_usage); | 320 | usage(mkswap_usage); |
321 | } | 321 | } |
322 | sz = get_size(device_name); | 322 | sz = get_size(device_name); |
323 | if (!PAGES) { | 323 | if (!PAGES) { |
324 | PAGES = sz; | 324 | PAGES = sz; |
325 | } else if (PAGES > sz && !force) { | 325 | } else if (PAGES > sz && !force) { |
326 | errorMsg("error: size %ld is larger than device size %d\n", | 326 | error_msg("error: size %ld is larger than device size %d\n", |
327 | PAGES * (pagesize / 1024), sz * (pagesize / 1024)); | 327 | PAGES * (pagesize / 1024), sz * (pagesize / 1024)); |
328 | return EXIT_FAILURE; | 328 | return EXIT_FAILURE; |
329 | } | 329 | } |
@@ -339,11 +339,11 @@ int mkswap_main(int argc, char **argv) | |||
339 | version = 1; | 339 | version = 1; |
340 | } | 340 | } |
341 | if (version != 0 && version != 1) { | 341 | if (version != 0 && version != 1) { |
342 | errorMsg("error: unknown version %d\n", version); | 342 | error_msg("error: unknown version %d\n", version); |
343 | usage(mkswap_usage); | 343 | usage(mkswap_usage); |
344 | } | 344 | } |
345 | if (PAGES < 10) { | 345 | if (PAGES < 10) { |
346 | errorMsg("error: swap area needs to be at least %ldkB\n", | 346 | error_msg("error: swap area needs to be at least %ldkB\n", |
347 | (long) (10 * pagesize / 1024)); | 347 | (long) (10 * pagesize / 1024)); |
348 | usage(mkswap_usage); | 348 | usage(mkswap_usage); |
349 | } | 349 | } |
@@ -362,7 +362,7 @@ int mkswap_main(int argc, char **argv) | |||
362 | #endif | 362 | #endif |
363 | if (PAGES > maxpages) { | 363 | if (PAGES > maxpages) { |
364 | PAGES = maxpages; | 364 | PAGES = maxpages; |
365 | errorMsg("warning: truncating swap area to %ldkB\n", | 365 | error_msg("warning: truncating swap area to %ldkB\n", |
366 | PAGES * pagesize / 1024); | 366 | PAGES * pagesize / 1024); |
367 | } | 367 | } |
368 | 368 | ||
@@ -389,7 +389,7 @@ int mkswap_main(int argc, char **argv) | |||
389 | for (sum = 0; q >= (unsigned short *) buffer;) | 389 | for (sum = 0; q >= (unsigned short *) buffer;) |
390 | sum ^= *q--; | 390 | sum ^= *q--; |
391 | if (!sum) { | 391 | if (!sum) { |
392 | errorMsg("Device '%s' contains a valid Sun disklabel.\n" | 392 | error_msg("Device '%s' contains a valid Sun disklabel.\n" |
393 | "This probably means creating v0 swap would destroy your partition table\n" | 393 | "This probably means creating v0 swap would destroy your partition table\n" |
394 | "No swap created. If you really want to create swap v0 on that device, use\n" | 394 | "No swap created. If you really want to create swap v0 on that device, use\n" |
395 | "the -f option to force it.\n", device_name); | 395 | "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, | |||
132 | 132 | ||
133 | specialfile = find_unused_loop_device(); | 133 | specialfile = find_unused_loop_device(); |
134 | if (specialfile == NULL) { | 134 | if (specialfile == NULL) { |
135 | errorMsg("Could not find a spare loop device\n"); | 135 | error_msg("Could not find a spare loop device\n"); |
136 | return (FALSE); | 136 | return (FALSE); |
137 | } | 137 | } |
138 | if (set_loop(specialfile, lofile, 0, &loro)) { | 138 | if (set_loop(specialfile, lofile, 0, &loro)) { |
139 | errorMsg("Could not setup loop device\n"); | 139 | error_msg("Could not setup loop device\n"); |
140 | return (FALSE); | 140 | return (FALSE); |
141 | } | 141 | } |
142 | if (!(flags & MS_RDONLY) && loro) { /* loop is ro, but wanted rw */ | 142 | if (!(flags & MS_RDONLY) && loro) { /* loop is ro, but wanted rw */ |
143 | errorMsg("WARNING: loop device is read-only\n"); | 143 | error_msg("WARNING: loop device is read-only\n"); |
144 | flags &= ~MS_RDONLY; | 144 | flags &= ~MS_RDONLY; |
145 | } | 145 | } |
146 | } | 146 | } |
147 | #endif | 147 | #endif |
148 | status = mount(specialfile, dir, filesystemtype, flags, string_flags); | 148 | status = mount(specialfile, dir, filesystemtype, flags, string_flags); |
149 | if (errno == EROFS) { | 149 | if (errno == EROFS) { |
150 | errorMsg("%s is write-protected, mounting read-only\n", specialfile); | 150 | error_msg("%s is write-protected, mounting read-only\n", specialfile); |
151 | status = mount(specialfile, dir, filesystemtype, flags |= MS_RDONLY, string_flags); | 151 | status = mount(specialfile, dir, filesystemtype, flags |= MS_RDONLY, string_flags); |
152 | } | 152 | } |
153 | } | 153 | } |
@@ -173,7 +173,7 @@ do_mount(char *specialfile, char *dir, char *filesystemtype, | |||
173 | #endif | 173 | #endif |
174 | 174 | ||
175 | if (errno == EPERM) { | 175 | if (errno == EPERM) { |
176 | fatalError("permission denied. Are you root?\n"); | 176 | error_msg_and_die("permission denied. Are you root?\n"); |
177 | } | 177 | } |
178 | 178 | ||
179 | return (FALSE); | 179 | return (FALSE); |
@@ -273,18 +273,18 @@ mount_one(char *blockDevice, char *directory, char *filesystemType, | |||
273 | /* open device */ | 273 | /* open device */ |
274 | fd = open(device, O_RDONLY); | 274 | fd = open(device, O_RDONLY); |
275 | if (fd < 0) | 275 | if (fd < 0) |
276 | fatalError("open failed for `%s': %s\n", device, strerror (errno)); | 276 | error_msg_and_die("open failed for `%s': %s\n", device, strerror (errno)); |
277 | 277 | ||
278 | /* How many filesystems? We need to know to allocate enough space */ | 278 | /* How many filesystems? We need to know to allocate enough space */ |
279 | numfilesystems = ioctl (fd, DEVMTAB_COUNT_FILESYSTEMS); | 279 | numfilesystems = ioctl (fd, DEVMTAB_COUNT_FILESYSTEMS); |
280 | if (numfilesystems<0) | 280 | if (numfilesystems<0) |
281 | fatalError("\nDEVMTAB_COUNT_FILESYSTEMS: %s\n", strerror (errno)); | 281 | error_msg_and_die("\nDEVMTAB_COUNT_FILESYSTEMS: %s\n", strerror (errno)); |
282 | fslist = (struct k_fstype *) xcalloc ( numfilesystems, sizeof(struct k_fstype)); | 282 | fslist = (struct k_fstype *) xcalloc ( numfilesystems, sizeof(struct k_fstype)); |
283 | 283 | ||
284 | /* Grab the list of available filesystems */ | 284 | /* Grab the list of available filesystems */ |
285 | status = ioctl (fd, DEVMTAB_GET_FILESYSTEMS, fslist); | 285 | status = ioctl (fd, DEVMTAB_GET_FILESYSTEMS, fslist); |
286 | if (status<0) | 286 | if (status<0) |
287 | fatalError("\nDEVMTAB_GET_FILESYSTEMS: %s\n", strerror (errno)); | 287 | error_msg_and_die("\nDEVMTAB_GET_FILESYSTEMS: %s\n", strerror (errno)); |
288 | 288 | ||
289 | /* Walk the list trying to mount filesystems | 289 | /* Walk the list trying to mount filesystems |
290 | * that do not claim to be nodev filesystems */ | 290 | * that do not claim to be nodev filesystems */ |
@@ -309,7 +309,7 @@ mount_one(char *blockDevice, char *directory, char *filesystemType, | |||
309 | 309 | ||
310 | if (status == FALSE) { | 310 | if (status == FALSE) { |
311 | if (whineOnErrors == TRUE) { | 311 | if (whineOnErrors == TRUE) { |
312 | errorMsg("Mounting %s on %s failed: %s\n", | 312 | error_msg("Mounting %s on %s failed: %s\n", |
313 | blockDevice, directory, strerror(errno)); | 313 | blockDevice, directory, strerror(errno)); |
314 | } | 314 | } |
315 | return (FALSE); | 315 | return (FALSE); |
@@ -342,18 +342,18 @@ extern int mount_main(int argc, char **argv) | |||
342 | /* open device */ | 342 | /* open device */ |
343 | fd = open(device, O_RDONLY); | 343 | fd = open(device, O_RDONLY); |
344 | if (fd < 0) | 344 | if (fd < 0) |
345 | fatalError("open failed for `%s': %s\n", device, strerror (errno)); | 345 | error_msg_and_die("open failed for `%s': %s\n", device, strerror (errno)); |
346 | 346 | ||
347 | /* How many mounted filesystems? We need to know to | 347 | /* How many mounted filesystems? We need to know to |
348 | * allocate enough space for later... */ | 348 | * allocate enough space for later... */ |
349 | numfilesystems = ioctl (fd, DEVMTAB_COUNT_MOUNTS); | 349 | numfilesystems = ioctl (fd, DEVMTAB_COUNT_MOUNTS); |
350 | if (numfilesystems<0) | 350 | if (numfilesystems<0) |
351 | fatalError( "\nDEVMTAB_COUNT_MOUNTS: %s\n", strerror (errno)); | 351 | error_msg_and_die( "\nDEVMTAB_COUNT_MOUNTS: %s\n", strerror (errno)); |
352 | mntentlist = (struct k_mntent *) xcalloc ( numfilesystems, sizeof(struct k_mntent)); | 352 | mntentlist = (struct k_mntent *) xcalloc ( numfilesystems, sizeof(struct k_mntent)); |
353 | 353 | ||
354 | /* Grab the list of mounted filesystems */ | 354 | /* Grab the list of mounted filesystems */ |
355 | if (ioctl (fd, DEVMTAB_GET_MOUNTS, mntentlist)<0) | 355 | if (ioctl (fd, DEVMTAB_GET_MOUNTS, mntentlist)<0) |
356 | fatalError( "\nDEVMTAB_GET_MOUNTS: %s\n", strerror (errno)); | 356 | error_msg_and_die( "\nDEVMTAB_GET_MOUNTS: %s\n", strerror (errno)); |
357 | 357 | ||
358 | for( i = 0 ; i < numfilesystems ; i++) { | 358 | for( i = 0 ; i < numfilesystems ; i++) { |
359 | fprintf( stdout, "%s %s %s %s %d %d\n", mntentlist[i].mnt_fsname, | 359 | 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) | |||
455 | fstabmount = TRUE; | 455 | fstabmount = TRUE; |
456 | 456 | ||
457 | if (f == NULL) | 457 | if (f == NULL) |
458 | fatalError( "\nCannot read /etc/fstab: %s\n", strerror (errno)); | 458 | error_msg_and_die( "\nCannot read /etc/fstab: %s\n", strerror (errno)); |
459 | 459 | ||
460 | while ((m = getmntent(f)) != NULL) { | 460 | while ((m = getmntent(f)) != NULL) { |
461 | if (all == FALSE && directory == NULL && ( | 461 | if (all == FALSE && directory == NULL && ( |
@@ -488,7 +488,7 @@ singlemount: | |||
488 | rc = nfsmount (device, directory, &flags, | 488 | rc = nfsmount (device, directory, &flags, |
489 | &extra_opts, &string_flags, 1); | 489 | &extra_opts, &string_flags, 1); |
490 | if ( rc != 0) { | 490 | if ( rc != 0) { |
491 | fatalError("nfsmount failed: %s\n", strerror(errno)); | 491 | error_msg_and_die("nfsmount failed: %s\n", strerror(errno)); |
492 | rc = EXIT_FAILURE; | 492 | rc = EXIT_FAILURE; |
493 | } | 493 | } |
494 | } | 494 | } |
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, | |||
300 | msock = fsock = -1; | 300 | msock = fsock = -1; |
301 | mclient = NULL; | 301 | mclient = NULL; |
302 | if (strlen(spec) >= sizeof(hostdir)) { | 302 | if (strlen(spec) >= sizeof(hostdir)) { |
303 | errorMsg("excessively long host:dir argument\n"); | 303 | error_msg("excessively long host:dir argument\n"); |
304 | goto fail; | 304 | goto fail; |
305 | } | 305 | } |
306 | strcpy(hostdir, spec); | 306 | strcpy(hostdir, spec); |
@@ -312,10 +312,10 @@ int nfsmount(const char *spec, const char *node, int *flags, | |||
312 | until they can be fully supported. (mack@sgi.com) */ | 312 | until they can be fully supported. (mack@sgi.com) */ |
313 | if ((s = strchr(hostdir, ','))) { | 313 | if ((s = strchr(hostdir, ','))) { |
314 | *s = '\0'; | 314 | *s = '\0'; |
315 | errorMsg("warning: multiple hostnames not supported\n"); | 315 | error_msg("warning: multiple hostnames not supported\n"); |
316 | } | 316 | } |
317 | } else { | 317 | } else { |
318 | errorMsg("directory to mount not in host:dir format\n"); | 318 | error_msg("directory to mount not in host:dir format\n"); |
319 | goto fail; | 319 | goto fail; |
320 | } | 320 | } |
321 | 321 | ||
@@ -325,11 +325,11 @@ int nfsmount(const char *spec, const char *node, int *flags, | |||
325 | #endif | 325 | #endif |
326 | { | 326 | { |
327 | if ((hp = gethostbyname(hostname)) == NULL) { | 327 | if ((hp = gethostbyname(hostname)) == NULL) { |
328 | errorMsg("can't get address for %s\n", hostname); | 328 | error_msg("can't get address for %s\n", hostname); |
329 | goto fail; | 329 | goto fail; |
330 | } else { | 330 | } else { |
331 | if (hp->h_length > sizeof(struct in_addr)) { | 331 | if (hp->h_length > sizeof(struct in_addr)) { |
332 | errorMsg("got bad hp->h_length\n"); | 332 | error_msg("got bad hp->h_length\n"); |
333 | hp->h_length = sizeof(struct in_addr); | 333 | hp->h_length = sizeof(struct in_addr); |
334 | } | 334 | } |
335 | memcpy(&server_addr.sin_addr, | 335 | memcpy(&server_addr.sin_addr, |
@@ -346,7 +346,7 @@ int nfsmount(const char *spec, const char *node, int *flags, | |||
346 | if (!old_opts) | 346 | if (!old_opts) |
347 | old_opts = ""; | 347 | old_opts = ""; |
348 | if (strlen(old_opts) + strlen(s) + 10 >= sizeof(new_opts)) { | 348 | if (strlen(old_opts) + strlen(s) + 10 >= sizeof(new_opts)) { |
349 | errorMsg("excessively long option argument\n"); | 349 | error_msg("excessively long option argument\n"); |
350 | goto fail; | 350 | goto fail; |
351 | } | 351 | } |
352 | sprintf(new_opts, "%s%saddr=%s", | 352 | sprintf(new_opts, "%s%saddr=%s", |
@@ -506,11 +506,11 @@ int nfsmount(const char *spec, const char *node, int *flags, | |||
506 | data.flags |= (nolock ? NFS_MOUNT_NONLM : 0); | 506 | data.flags |= (nolock ? NFS_MOUNT_NONLM : 0); |
507 | #endif | 507 | #endif |
508 | if (nfsvers > MAX_NFSPROT) { | 508 | if (nfsvers > MAX_NFSPROT) { |
509 | errorMsg("NFSv%d not supported!\n", nfsvers); | 509 | error_msg("NFSv%d not supported!\n", nfsvers); |
510 | return 0; | 510 | return 0; |
511 | } | 511 | } |
512 | if (mountvers > MAX_NFSPROT) { | 512 | if (mountvers > MAX_NFSPROT) { |
513 | errorMsg("NFSv%d not supported!\n", nfsvers); | 513 | error_msg("NFSv%d not supported!\n", nfsvers); |
514 | return 0; | 514 | return 0; |
515 | } | 515 | } |
516 | if (nfsvers && !mountvers) | 516 | if (nfsvers && !mountvers) |
@@ -570,11 +570,11 @@ int nfsmount(const char *spec, const char *node, int *flags, | |||
570 | mount_server_addr.sin_addr.s_addr = inet_addr(hostname); | 570 | mount_server_addr.sin_addr.s_addr = inet_addr(hostname); |
571 | } else { | 571 | } else { |
572 | if ((hp = gethostbyname(mounthost)) == NULL) { | 572 | if ((hp = gethostbyname(mounthost)) == NULL) { |
573 | errorMsg("can't get address for %s\n", hostname); | 573 | error_msg("can't get address for %s\n", hostname); |
574 | goto fail; | 574 | goto fail; |
575 | } else { | 575 | } else { |
576 | if (hp->h_length > sizeof(struct in_addr)) { | 576 | if (hp->h_length > sizeof(struct in_addr)) { |
577 | errorMsg("got bad hp->h_length?\n"); | 577 | error_msg("got bad hp->h_length?\n"); |
578 | hp->h_length = sizeof(struct in_addr); | 578 | hp->h_length = sizeof(struct in_addr); |
579 | } | 579 | } |
580 | mount_server_addr.sin_family = AF_INET; | 580 | mount_server_addr.sin_family = AF_INET; |
@@ -709,7 +709,7 @@ int nfsmount(const char *spec, const char *node, int *flags, | |||
709 | 709 | ||
710 | if (nfsvers == 2) { | 710 | if (nfsvers == 2) { |
711 | if (status.nfsv2.fhs_status != 0) { | 711 | if (status.nfsv2.fhs_status != 0) { |
712 | errorMsg("%s:%s failed, reason given by server: %s\n", | 712 | error_msg("%s:%s failed, reason given by server: %s\n", |
713 | hostname, dirname, | 713 | hostname, dirname, |
714 | nfs_strerror(status.nfsv2.fhs_status)); | 714 | nfs_strerror(status.nfsv2.fhs_status)); |
715 | goto fail; | 715 | goto fail; |
@@ -727,7 +727,7 @@ int nfsmount(const char *spec, const char *node, int *flags, | |||
727 | #if NFS_MOUNT_VERSION >= 4 | 727 | #if NFS_MOUNT_VERSION >= 4 |
728 | fhandle3 *fhandle; | 728 | fhandle3 *fhandle; |
729 | if (status.nfsv3.fhs_status != 0) { | 729 | if (status.nfsv3.fhs_status != 0) { |
730 | errorMsg("%s:%s failed, reason given by server: %s\n", | 730 | error_msg("%s:%s failed, reason given by server: %s\n", |
731 | hostname, dirname, | 731 | hostname, dirname, |
732 | nfs_strerror(status.nfsv3.fhs_status)); | 732 | nfs_strerror(status.nfsv3.fhs_status)); |
733 | goto fail; | 733 | 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) | |||
47 | int fd; | 47 | int fd; |
48 | 48 | ||
49 | if (!(h = gethostbyname(host))) { /* get the IP addr */ | 49 | if (!(h = gethostbyname(host))) { /* get the IP addr */ |
50 | errorMsg("%s: %s\n", host, strerror(errno)); | 50 | error_msg("%s: %s\n", host, strerror(errno)); |
51 | return(-1); | 51 | return(-1); |
52 | } | 52 | } |
53 | if ((tserv = getservbyname("time", "tcp")) == NULL) { /* find port # */ | 53 | if ((tserv = getservbyname("time", "tcp")) == NULL) { /* find port # */ |
54 | errorMsg("%s: %s\n", "time", strerror(errno)); | 54 | error_msg("%s: %s\n", "time", strerror(errno)); |
55 | return(-1); | 55 | return(-1); |
56 | } | 56 | } |
57 | if ((fd = socket(AF_INET, SOCK_STREAM, 0)) < 0) { /* get net connection */ | 57 | if ((fd = socket(AF_INET, SOCK_STREAM, 0)) < 0) { /* get net connection */ |
58 | errorMsg("%s: %s\n", "socket", strerror(errno)); | 58 | error_msg("%s: %s\n", "socket", strerror(errno)); |
59 | return(-1); | 59 | return(-1); |
60 | } | 60 | } |
61 | 61 | ||
@@ -64,13 +64,13 @@ time_t askremotedate(char *host) | |||
64 | sin.sin_family = AF_INET; | 64 | sin.sin_family = AF_INET; |
65 | 65 | ||
66 | if (connect(fd, (struct sockaddr *)&sin, sizeof(sin)) < 0) { /* connect to time server */ | 66 | if (connect(fd, (struct sockaddr *)&sin, sizeof(sin)) < 0) { /* connect to time server */ |
67 | errorMsg("%s: %s\n", host, strerror(errno)); | 67 | error_msg("%s: %s\n", host, strerror(errno)); |
68 | close(fd); | 68 | close(fd); |
69 | return(-1); | 69 | return(-1); |
70 | } | 70 | } |
71 | if (read(fd, (void *)&nett, 4) != 4) { /* read time from server */ | 71 | if (read(fd, (void *)&nett, 4) != 4) { /* read time from server */ |
72 | close(fd); | 72 | close(fd); |
73 | errorMsg("%s did not send the complete time\n", host); | 73 | error_msg("%s did not send the complete time\n", host); |
74 | } | 74 | } |
75 | close(fd); | 75 | close(fd); |
76 | 76 | ||
@@ -123,7 +123,7 @@ int rdate_main(int argc, char **argv) | |||
123 | } | 123 | } |
124 | if (setdate) { | 124 | if (setdate) { |
125 | if (stime(&time) < 0) | 125 | if (stime(&time) < 0) |
126 | fatalError("Could not set time of day: %s\n", strerror(errno)); | 126 | error_msg_and_die("Could not set time of day: %s\n", strerror(errno)); |
127 | } | 127 | } |
128 | if (printdate) { | 128 | if (printdate) { |
129 | fprintf(stdout, "%s", ctime(&time)); | 129 | 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) | |||
96 | struct stat statBuf; | 96 | struct stat statBuf; |
97 | 97 | ||
98 | if (stat("/etc/fstab", &statBuf) < 0) | 98 | if (stat("/etc/fstab", &statBuf) < 0) |
99 | fatalError("/etc/fstab file missing\n"); | 99 | error_msg_and_die("/etc/fstab file missing\n"); |
100 | } | 100 | } |
101 | do_em_all(); | 101 | do_em_all(); |
102 | break; | 102 | 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) | |||
79 | return; | 79 | return; |
80 | 80 | ||
81 | if ((fp = setmntent(mtab_file, "r")) == NULL) { | 81 | if ((fp = setmntent(mtab_file, "r")) == NULL) { |
82 | errorMsg("Cannot open %s\n", mtab_file); | 82 | error_msg("Cannot open %s\n", mtab_file); |
83 | return; | 83 | return; |
84 | } | 84 | } |
85 | while ((e = getmntent(fp))) { | 85 | while ((e = getmntent(fp))) { |
@@ -179,7 +179,7 @@ static int do_umount(const char *name, int useMtab) | |||
179 | if (status != 0 && doForce == TRUE) { | 179 | if (status != 0 && doForce == TRUE) { |
180 | status = umount2(blockDevice, MNT_FORCE); | 180 | status = umount2(blockDevice, MNT_FORCE); |
181 | if (status != 0) { | 181 | if (status != 0) { |
182 | fatalError("forced umount of %s failed!\n", blockDevice); | 182 | error_msg_and_die("forced umount of %s failed!\n", blockDevice); |
183 | } | 183 | } |
184 | } | 184 | } |
185 | #endif | 185 | #endif |
@@ -187,9 +187,9 @@ static int do_umount(const char *name, int useMtab) | |||
187 | status = mount(blockDevice, name, NULL, | 187 | status = mount(blockDevice, name, NULL, |
188 | MS_MGC_VAL | MS_REMOUNT | MS_RDONLY, NULL); | 188 | MS_MGC_VAL | MS_REMOUNT | MS_RDONLY, NULL); |
189 | if (status == 0) { | 189 | if (status == 0) { |
190 | errorMsg("%s busy - remounted read-only\n", blockDevice); | 190 | error_msg("%s busy - remounted read-only\n", blockDevice); |
191 | } else { | 191 | } else { |
192 | errorMsg("Cannot remount %s read-only\n", blockDevice); | 192 | error_msg("Cannot remount %s read-only\n", blockDevice); |
193 | } | 193 | } |
194 | } | 194 | } |
195 | if (status == 0) { | 195 | if (status == 0) { |