projects
/
oweals
/
busybox.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
iPatch from waldi, fixes usage of ip route flush (from)? (match|exact)
[oweals/busybox.git]
/
networking
/
hostname.c
diff --git
a/networking/hostname.c
b/networking/hostname.c
index b2c3fef8937eecf2f68c149cd3dfd76bbd6367e3..6522bb21bbd2a074adc3f40fdbb3e46872270284 100644
(file)
--- a/
networking/hostname.c
+++ b/
networking/hostname.c
@@
-1,6
+1,6
@@
/* vi: set sw=4 ts=4: */
/*
/* vi: set sw=4 ts=4: */
/*
- * $Id: hostname.c,v 1.3
3 2002/10/18 22:13:23 andersen
Exp $
+ * $Id: hostname.c,v 1.3
5 2003/03/19 09:12:37 mjn3
Exp $
* Mini hostname implementation for busybox
*
* Copyright (C) 1999 by Randolph Chung <tausq@debian.org>
* Mini hostname implementation for busybox
*
* Copyright (C) 1999 by Randolph Chung <tausq@debian.org>
@@
-46,12
+46,12
@@
static void do_sethostname(char *s, int isfile)
if (!isfile) {
if (sethostname(s, strlen(s)) < 0) {
if (errno == EPERM)
if (!isfile) {
if (sethostname(s, strlen(s)) < 0) {
if (errno == EPERM)
- error_msg_and_die("you must be root to change the hostname");
+
bb_
error_msg_and_die("you must be root to change the hostname");
else
else
- perror_msg_and_die("sethostname");
+
bb_
perror_msg_and_die("sethostname");
}
} else {
}
} else {
- f = xfopen(s, "r");
+ f =
bb_
xfopen(s, "r");
while (fgets(buf, 255, f) != NULL) {
if (buf[0] =='#') {
continue;
while (fgets(buf, 255, f) != NULL) {
if (buf[0] =='#') {
continue;
@@
-75,7
+75,7
@@
int hostname_main(int argc, char **argv)
char *p = NULL;
if (argc < 1)
char *p = NULL;
if (argc < 1)
- show_usage();
+
bb_
show_usage();
while ((opt = getopt(argc, argv, "dfisF:")) > 0) {
switch (opt) {
while ((opt = getopt(argc, argv, "dfisF:")) > 0) {
switch (opt) {
@@
-89,7
+89,7
@@
int hostname_main(int argc, char **argv)
filename = optarg;
break;
default:
filename = optarg;
break;
default:
- show_usage();
+
bb_
show_usage();
}
}
}
}
@@
-104,7
+104,7
@@
int hostname_main(int argc, char **argv)
if (p != NULL) {
*p = 0;
}
if (p != NULL) {
*p = 0;
}
- puts(
buf
);
+ puts(
hp->h_name
);
} else if (type == 'd') {
if (p) puts(p + 1);
} else if (type == 'i') {
} else if (type == 'd') {
if (p) puts(p + 1);
} else if (type == 'i') {