diff options
author | Manuel Novoa III <mjn3@codepoet.org> | 2003-03-19 09:13:01 +0000 |
---|---|---|
committer | Manuel Novoa III <mjn3@codepoet.org> | 2003-03-19 09:13:01 +0000 |
commit | cad5364599eb5062d59e0c397ed638ddd61a8d5d (patch) | |
tree | a318d0f03aa076c74b576ea45dc543a5669e8e91 /util-linux/nfsmount.c | |
parent | e01f9662a5bd5d91be4f6b3941b57fff73cd5af1 (diff) | |
download | busybox-w32-cad5364599eb5062d59e0c397ed638ddd61a8d5d.tar.gz busybox-w32-cad5364599eb5062d59e0c397ed638ddd61a8d5d.tar.bz2 busybox-w32-cad5364599eb5062d59e0c397ed638ddd61a8d5d.zip |
Major coreutils update.
Diffstat (limited to 'util-linux/nfsmount.c')
-rw-r--r-- | util-linux/nfsmount.c | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/util-linux/nfsmount.c b/util-linux/nfsmount.c index ba14aa6bc..0edfdf34a 100644 --- a/util-linux/nfsmount.c +++ b/util-linux/nfsmount.c | |||
@@ -357,7 +357,7 @@ int nfsmount(const char *spec, const char *node, int *flags, | |||
357 | msock = fsock = -1; | 357 | msock = fsock = -1; |
358 | mclient = NULL; | 358 | mclient = NULL; |
359 | if (strlen(spec) >= sizeof(hostdir)) { | 359 | if (strlen(spec) >= sizeof(hostdir)) { |
360 | error_msg("excessively long host:dir argument"); | 360 | bb_error_msg("excessively long host:dir argument"); |
361 | goto fail; | 361 | goto fail; |
362 | } | 362 | } |
363 | strcpy(hostdir, spec); | 363 | strcpy(hostdir, spec); |
@@ -369,10 +369,10 @@ int nfsmount(const char *spec, const char *node, int *flags, | |||
369 | until they can be fully supported. (mack@sgi.com) */ | 369 | until they can be fully supported. (mack@sgi.com) */ |
370 | if ((s = strchr(hostdir, ','))) { | 370 | if ((s = strchr(hostdir, ','))) { |
371 | *s = '\0'; | 371 | *s = '\0'; |
372 | error_msg("warning: multiple hostnames not supported"); | 372 | bb_error_msg("warning: multiple hostnames not supported"); |
373 | } | 373 | } |
374 | } else { | 374 | } else { |
375 | error_msg("directory to mount not in host:dir format"); | 375 | bb_error_msg("directory to mount not in host:dir format"); |
376 | goto fail; | 376 | goto fail; |
377 | } | 377 | } |
378 | 378 | ||
@@ -382,11 +382,11 @@ int nfsmount(const char *spec, const char *node, int *flags, | |||
382 | #endif | 382 | #endif |
383 | { | 383 | { |
384 | if ((hp = gethostbyname(hostname)) == NULL) { | 384 | if ((hp = gethostbyname(hostname)) == NULL) { |
385 | herror_msg("%s", hostname); | 385 | bb_herror_msg("%s", hostname); |
386 | goto fail; | 386 | goto fail; |
387 | } else { | 387 | } else { |
388 | if (hp->h_length > sizeof(struct in_addr)) { | 388 | if (hp->h_length > sizeof(struct in_addr)) { |
389 | error_msg("got bad hp->h_length"); | 389 | bb_error_msg("got bad hp->h_length"); |
390 | hp->h_length = sizeof(struct in_addr); | 390 | hp->h_length = sizeof(struct in_addr); |
391 | } | 391 | } |
392 | memcpy(&server_addr.sin_addr, | 392 | memcpy(&server_addr.sin_addr, |
@@ -403,12 +403,12 @@ int nfsmount(const char *spec, const char *node, int *flags, | |||
403 | if (!old_opts) | 403 | if (!old_opts) |
404 | old_opts = ""; | 404 | old_opts = ""; |
405 | if (strlen(old_opts) + strlen(s) + 10 >= sizeof(new_opts)) { | 405 | if (strlen(old_opts) + strlen(s) + 10 >= sizeof(new_opts)) { |
406 | error_msg("excessively long option argument"); | 406 | bb_error_msg("excessively long option argument"); |
407 | goto fail; | 407 | goto fail; |
408 | } | 408 | } |
409 | sprintf(new_opts, "%s%saddr=%s", | 409 | sprintf(new_opts, "%s%saddr=%s", |
410 | old_opts, *old_opts ? "," : "", s); | 410 | old_opts, *old_opts ? "," : "", s); |
411 | *extra_opts = xstrdup(new_opts); | 411 | *extra_opts = bb_xstrdup(new_opts); |
412 | 412 | ||
413 | /* Set default options. | 413 | /* Set default options. |
414 | * rsize/wsize (and bsize, for ver >= 3) are left 0 in order to | 414 | * rsize/wsize (and bsize, for ver >= 3) are left 0 in order to |
@@ -476,7 +476,7 @@ int nfsmount(const char *spec, const char *node, int *flags, | |||
476 | else if (!strcmp(opt, "mountport")) | 476 | else if (!strcmp(opt, "mountport")) |
477 | mountport = val; | 477 | mountport = val; |
478 | else if (!strcmp(opt, "mounthost")) | 478 | else if (!strcmp(opt, "mounthost")) |
479 | mounthost=xstrndup(opteq+1, | 479 | mounthost=bb_xstrndup(opteq+1, |
480 | strcspn(opteq+1," \t\n\r,")); | 480 | strcspn(opteq+1," \t\n\r,")); |
481 | else if (!strcmp(opt, "mountprog")) | 481 | else if (!strcmp(opt, "mountprog")) |
482 | mountprog = val; | 482 | mountprog = val; |
@@ -563,11 +563,11 @@ int nfsmount(const char *spec, const char *node, int *flags, | |||
563 | data.flags |= (nolock ? NFS_MOUNT_NONLM : 0); | 563 | data.flags |= (nolock ? NFS_MOUNT_NONLM : 0); |
564 | #endif | 564 | #endif |
565 | if (nfsvers > MAX_NFSPROT) { | 565 | if (nfsvers > MAX_NFSPROT) { |
566 | error_msg("NFSv%d not supported!", nfsvers); | 566 | bb_error_msg("NFSv%d not supported!", nfsvers); |
567 | return 0; | 567 | return 0; |
568 | } | 568 | } |
569 | if (mountvers > MAX_NFSPROT) { | 569 | if (mountvers > MAX_NFSPROT) { |
570 | error_msg("NFSv%d not supported!", nfsvers); | 570 | bb_error_msg("NFSv%d not supported!", nfsvers); |
571 | return 0; | 571 | return 0; |
572 | } | 572 | } |
573 | if (nfsvers && !mountvers) | 573 | if (nfsvers && !mountvers) |
@@ -627,11 +627,11 @@ int nfsmount(const char *spec, const char *node, int *flags, | |||
627 | mount_server_addr.sin_addr.s_addr = inet_addr(hostname); | 627 | mount_server_addr.sin_addr.s_addr = inet_addr(hostname); |
628 | } else { | 628 | } else { |
629 | if ((hp = gethostbyname(mounthost)) == NULL) { | 629 | if ((hp = gethostbyname(mounthost)) == NULL) { |
630 | herror_msg("%s", mounthost); | 630 | bb_herror_msg("%s", mounthost); |
631 | goto fail; | 631 | goto fail; |
632 | } else { | 632 | } else { |
633 | if (hp->h_length > sizeof(struct in_addr)) { | 633 | if (hp->h_length > sizeof(struct in_addr)) { |
634 | error_msg("got bad hp->h_length?"); | 634 | bb_error_msg("got bad hp->h_length?"); |
635 | hp->h_length = sizeof(struct in_addr); | 635 | hp->h_length = sizeof(struct in_addr); |
636 | } | 636 | } |
637 | mount_server_addr.sin_family = AF_INET; | 637 | mount_server_addr.sin_family = AF_INET; |
@@ -753,7 +753,7 @@ int nfsmount(const char *spec, const char *node, int *flags, | |||
753 | if (!bg) | 753 | if (!bg) |
754 | goto fail; | 754 | goto fail; |
755 | if (!running_bg) { | 755 | if (!running_bg) { |
756 | prev_bg_host = xstrdup(hostname); | 756 | prev_bg_host = bb_xstrdup(hostname); |
757 | if (retry > 0) | 757 | if (retry > 0) |
758 | retval = EX_BG; | 758 | retval = EX_BG; |
759 | goto fail; | 759 | goto fail; |
@@ -766,7 +766,7 @@ int nfsmount(const char *spec, const char *node, int *flags, | |||
766 | 766 | ||
767 | if (nfsvers == 2) { | 767 | if (nfsvers == 2) { |
768 | if (status.nfsv2.fhs_status != 0) { | 768 | if (status.nfsv2.fhs_status != 0) { |
769 | error_msg("%s:%s failed, reason given by server: %s", | 769 | bb_error_msg("%s:%s failed, reason given by server: %s", |
770 | hostname, pathname, | 770 | hostname, pathname, |
771 | nfs_strerror(status.nfsv2.fhs_status)); | 771 | nfs_strerror(status.nfsv2.fhs_status)); |
772 | goto fail; | 772 | goto fail; |
@@ -784,7 +784,7 @@ int nfsmount(const char *spec, const char *node, int *flags, | |||
784 | #if NFS_MOUNT_VERSION >= 4 | 784 | #if NFS_MOUNT_VERSION >= 4 |
785 | fhandle3 *my_fhandle; | 785 | fhandle3 *my_fhandle; |
786 | if (status.nfsv3.fhs_status != 0) { | 786 | if (status.nfsv3.fhs_status != 0) { |
787 | error_msg("%s:%s failed, reason given by server: %s", | 787 | bb_error_msg("%s:%s failed, reason given by server: %s", |
788 | hostname, pathname, | 788 | hostname, pathname, |
789 | nfs_strerror(status.nfsv3.fhs_status)); | 789 | nfs_strerror(status.nfsv3.fhs_status)); |
790 | goto fail; | 790 | goto fail; |